From a72a4d97b3de2a149818ce6c7876d040333ed7a1 Mon Sep 17 00:00:00 2001 From: Green Sky Date: Wed, 22 Nov 2023 22:58:01 +0100 Subject: [PATCH] inital import of libircclient v1.10 --- .gitignore | 22 + CMakeLists.txt | 28 + libircclient/Changelog | 129 + libircclient/Doxyfile | 1153 ++++ libircclient/LICENSE | 482 ++ libircclient/Makefile | 26 + libircclient/README | 14 + libircclient/THANKS | 4 + libircclient/build-release.sh | 73 + .../cocoa/Classes/DDInvocationGrabber.h | 114 + .../cocoa/Classes/DDInvocationGrabber.m | 171 + libircclient/cocoa/Classes/IRCClientChannel.h | 153 + libircclient/cocoa/Classes/IRCClientChannel.m | 157 + .../cocoa/Classes/IRCClientChannelDelegate.h | 116 + libircclient/cocoa/Classes/IRCClientSession.h | 264 + libircclient/cocoa/Classes/IRCClientSession.m | 744 +++ .../cocoa/Classes/IRCClientSessionDelegate.h | 152 + .../cocoa/Classes/NSObject+DDExtensions.h | 35 + .../cocoa/Classes/NSObject+DDExtensions.m | 43 + libircclient/cocoa/Doxyfile | 293 + .../cocoa/English.lproj/InfoPlist.strings | Bin 0 -> 92 bytes .../IRCClient.xcodeproj/TemplateIcon.icns | Bin 0 -> 52318 bytes .../cocoa/IRCClient.xcodeproj/project.pbxproj | 408 ++ libircclient/cocoa/IRCClient_Prefix.pch | 7 + libircclient/cocoa/Info.plist | 26 + libircclient/cocoa/LICENSE | 482 ++ libircclient/cocoa/README | 21 + .../_d_d_invocation_grabber_8h-source.html | 140 + .../html/_i_r_c_client_channel_8h-source.html | 89 + .../doc/html/_i_r_c_client_channel_8h.html | 48 + ...r_c_client_channel_delegate_8h-source.html | 61 + .../_i_r_c_client_channel_delegate_8h.html | 51 + .../html/_i_r_c_client_session_8h-source.html | 107 + .../doc/html/_i_r_c_client_session_8h.html | 49 + ...r_c_client_session_delegate_8h-source.html | 74 + ..._s_object_09_d_d_extensions_8h-source.html | 61 + libircclient/cocoa/doc/html/annotated.html | 36 + .../class_i_r_c_client_channel-members.html | 55 + .../class_i_r_c_client_session-members.html | 69 + ..._c_client_channel_delegate_08-members.html | 39 + ..._c_client_session_delegate_08-members.html | 44 + libircclient/cocoa/doc/html/classes.html | 35 + libircclient/cocoa/doc/html/doxygen.css | 441 ++ libircclient/cocoa/doc/html/doxygen.png | Bin 0 -> 1281 bytes libircclient/cocoa/doc/html/files.html | 36 + libircclient/cocoa/doc/html/functions.html | 224 + .../cocoa/doc/html/functions_func.html | 182 + .../cocoa/doc/html/functions_prop.html | 74 + libircclient/cocoa/doc/html/hierarchy.html | 38 + libircclient/cocoa/doc/html/index.html | 59 + .../html/interface_i_r_c_client_channel.html | 473 ++ .../html/interface_i_r_c_client_channel.png | Bin 0 -> 400 bytes .../html/interface_i_r_c_client_session.html | 730 ++ .../html/interface_i_r_c_client_session.png | Bin 0 -> 401 bytes ...t_07_i_r_c_client_channel_delegate_08.html | 357 + ...t_07_i_r_c_client_session_delegate_08.html | 528 ++ libircclient/cocoa/doc/html/tab_b.gif | Bin 0 -> 35 bytes libircclient/cocoa/doc/html/tab_l.gif | Bin 0 -> 706 bytes libircclient/cocoa/doc/html/tab_r.gif | Bin 0 -> 2585 bytes libircclient/cocoa/doc/html/tabs.css | 102 + libircclient/configure | 5939 +++++++++++++++++ libircclient/configure.in | 115 + libircclient/doc/Makefile | 156 + libircclient/doc/conf.py | 296 + libircclient/doc/index.rst | 52 + libircclient/doc/make.bat | 190 + .../doc/sources/API_reference_callbacks.rst | 173 + .../doc/sources/API_reference_constants.rst | 126 + .../doc/sources/API_reference_functions.rst | 1710 +++++ .../doc/sources/API_reference_types.rst | 365 + libircclient/doc/sources/Appendix_FAQ.rst | 134 + libircclient/doc/sources/Appendix_LGPL.rst | 68 + libircclient/doc/sources/Introduction.rst | 58 + libircclient/doc/sources/Writing_code.rst | 608 ++ libircclient/examples/Makefile.in | 40 + libircclient/examples/censor.cpp | 213 + libircclient/examples/colors.cpp | 164 + libircclient/examples/ircftp.cpp | 191 + libircclient/examples/irctest.c | 343 + libircclient/examples/spammer.c | 213 + libircclient/include/libirc_errors.h | 235 + libircclient/include/libirc_events.h | 389 ++ libircclient/include/libirc_options.h | 56 + libircclient/include/libirc_rfcnumeric.h | 1255 ++++ libircclient/include/libircclient.h | 1499 +++++ libircclient/man/libircclient.1 | 4600 +++++++++++++ libircclient/src/Makefile.in | 46 + libircclient/src/colors.c | 388 ++ libircclient/src/config.h.in | 109 + libircclient/src/dcc.c | 897 +++ libircclient/src/dcc.h | 54 + libircclient/src/errors.c | 54 + libircclient/src/libircclient.c | 1287 ++++ libircclient/src/libircclient.def | 47 + libircclient/src/params.h | 36 + libircclient/src/portable.c | 149 + libircclient/src/session.h | 79 + libircclient/src/sockets.c | 159 + libircclient/src/ssl.c | 394 ++ libircclient/src/utils.c | 130 + 100 files changed, 32336 insertions(+) create mode 100644 .gitignore create mode 100644 CMakeLists.txt create mode 100644 libircclient/Changelog create mode 100644 libircclient/Doxyfile create mode 100644 libircclient/LICENSE create mode 100644 libircclient/Makefile create mode 100644 libircclient/README create mode 100644 libircclient/THANKS create mode 100755 libircclient/build-release.sh create mode 100644 libircclient/cocoa/Classes/DDInvocationGrabber.h create mode 100644 libircclient/cocoa/Classes/DDInvocationGrabber.m create mode 100644 libircclient/cocoa/Classes/IRCClientChannel.h create mode 100644 libircclient/cocoa/Classes/IRCClientChannel.m create mode 100644 libircclient/cocoa/Classes/IRCClientChannelDelegate.h create mode 100644 libircclient/cocoa/Classes/IRCClientSession.h create mode 100644 libircclient/cocoa/Classes/IRCClientSession.m create mode 100644 libircclient/cocoa/Classes/IRCClientSessionDelegate.h create mode 100644 libircclient/cocoa/Classes/NSObject+DDExtensions.h create mode 100644 libircclient/cocoa/Classes/NSObject+DDExtensions.m create mode 100644 libircclient/cocoa/Doxyfile create mode 100644 libircclient/cocoa/English.lproj/InfoPlist.strings create mode 100644 libircclient/cocoa/IRCClient.xcodeproj/TemplateIcon.icns create mode 100644 libircclient/cocoa/IRCClient.xcodeproj/project.pbxproj create mode 100644 libircclient/cocoa/IRCClient_Prefix.pch create mode 100644 libircclient/cocoa/Info.plist create mode 100644 libircclient/cocoa/LICENSE create mode 100644 libircclient/cocoa/README create mode 100644 libircclient/cocoa/doc/html/_d_d_invocation_grabber_8h-source.html create mode 100644 libircclient/cocoa/doc/html/_i_r_c_client_channel_8h-source.html create mode 100644 libircclient/cocoa/doc/html/_i_r_c_client_channel_8h.html create mode 100644 libircclient/cocoa/doc/html/_i_r_c_client_channel_delegate_8h-source.html create mode 100644 libircclient/cocoa/doc/html/_i_r_c_client_channel_delegate_8h.html create mode 100644 libircclient/cocoa/doc/html/_i_r_c_client_session_8h-source.html create mode 100644 libircclient/cocoa/doc/html/_i_r_c_client_session_8h.html create mode 100644 libircclient/cocoa/doc/html/_i_r_c_client_session_delegate_8h-source.html create mode 100644 libircclient/cocoa/doc/html/_n_s_object_09_d_d_extensions_8h-source.html create mode 100644 libircclient/cocoa/doc/html/annotated.html create mode 100644 libircclient/cocoa/doc/html/class_i_r_c_client_channel-members.html create mode 100644 libircclient/cocoa/doc/html/class_i_r_c_client_session-members.html create mode 100644 libircclient/cocoa/doc/html/class_n_s_object_07_i_r_c_client_channel_delegate_08-members.html create mode 100644 libircclient/cocoa/doc/html/class_n_s_object_07_i_r_c_client_session_delegate_08-members.html create mode 100644 libircclient/cocoa/doc/html/classes.html create mode 100644 libircclient/cocoa/doc/html/doxygen.css create mode 100644 libircclient/cocoa/doc/html/doxygen.png create mode 100644 libircclient/cocoa/doc/html/files.html create mode 100644 libircclient/cocoa/doc/html/functions.html create mode 100644 libircclient/cocoa/doc/html/functions_func.html create mode 100644 libircclient/cocoa/doc/html/functions_prop.html create mode 100644 libircclient/cocoa/doc/html/hierarchy.html create mode 100644 libircclient/cocoa/doc/html/index.html create mode 100644 libircclient/cocoa/doc/html/interface_i_r_c_client_channel.html create mode 100644 libircclient/cocoa/doc/html/interface_i_r_c_client_channel.png create mode 100644 libircclient/cocoa/doc/html/interface_i_r_c_client_session.html create mode 100644 libircclient/cocoa/doc/html/interface_i_r_c_client_session.png create mode 100644 libircclient/cocoa/doc/html/interface_n_s_object_07_i_r_c_client_channel_delegate_08.html create mode 100644 libircclient/cocoa/doc/html/interface_n_s_object_07_i_r_c_client_session_delegate_08.html create mode 100644 libircclient/cocoa/doc/html/tab_b.gif create mode 100644 libircclient/cocoa/doc/html/tab_l.gif create mode 100644 libircclient/cocoa/doc/html/tab_r.gif create mode 100644 libircclient/cocoa/doc/html/tabs.css create mode 100755 libircclient/configure create mode 100644 libircclient/configure.in create mode 100644 libircclient/doc/Makefile create mode 100644 libircclient/doc/conf.py create mode 100644 libircclient/doc/index.rst create mode 100644 libircclient/doc/make.bat create mode 100644 libircclient/doc/sources/API_reference_callbacks.rst create mode 100644 libircclient/doc/sources/API_reference_constants.rst create mode 100644 libircclient/doc/sources/API_reference_functions.rst create mode 100644 libircclient/doc/sources/API_reference_types.rst create mode 100644 libircclient/doc/sources/Appendix_FAQ.rst create mode 100644 libircclient/doc/sources/Appendix_LGPL.rst create mode 100644 libircclient/doc/sources/Introduction.rst create mode 100644 libircclient/doc/sources/Writing_code.rst create mode 100644 libircclient/examples/Makefile.in create mode 100644 libircclient/examples/censor.cpp create mode 100644 libircclient/examples/colors.cpp create mode 100644 libircclient/examples/ircftp.cpp create mode 100644 libircclient/examples/irctest.c create mode 100644 libircclient/examples/spammer.c create mode 100644 libircclient/include/libirc_errors.h create mode 100644 libircclient/include/libirc_events.h create mode 100644 libircclient/include/libirc_options.h create mode 100644 libircclient/include/libirc_rfcnumeric.h create mode 100644 libircclient/include/libircclient.h create mode 100644 libircclient/man/libircclient.1 create mode 100644 libircclient/src/Makefile.in create mode 100644 libircclient/src/colors.c create mode 100644 libircclient/src/config.h.in create mode 100644 libircclient/src/dcc.c create mode 100644 libircclient/src/dcc.h create mode 100644 libircclient/src/errors.c create mode 100644 libircclient/src/libircclient.c create mode 100644 libircclient/src/libircclient.def create mode 100644 libircclient/src/params.h create mode 100644 libircclient/src/portable.c create mode 100644 libircclient/src/session.h create mode 100644 libircclient/src/sockets.c create mode 100644 libircclient/src/ssl.c create mode 100644 libircclient/src/utils.c diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..248798c --- /dev/null +++ b/.gitignore @@ -0,0 +1,22 @@ +.vs/ +*.o +*.swp +~* +*~ +.idea/ +cmake-build-debug/ +cmake-build-debugandtest/ +cmake-build-release/ +*.stackdump +*.coredump +compile_commands.json +/build* +.clangd +.cache + +.DS_Store +.AppleDouble +.LSOverride + +CMakeLists.txt.user* +CMakeCache.txt diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..8696b94 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,28 @@ +cmake_minimum_required(VERSION 3.24 FATAL_ERROR) + +# cmake setup begin +project(libircclient) + +add_library(libircclient + ./libircclient/include/libircclient.h + ./libircclient/include/libirc_rfcnumeric.h + + ./libircclient/include/libirc_errors.h + ./libircclient/include/libirc_events.h + ./libircclient/include/libirc_options.h + + ./libircclient/src/colors.c + ./libircclient/src/dcc.h + ./libircclient/src/dcc.c + ./libircclient/src/errors.c + ./libircclient/src/libircclient.c + ./libircclient/src/params.h + ./libircclient/src/portable.c + ./libircclient/src/session.h + ./libircclient/src/sockets.c + ./libircclient/src/ssl.c + ./libircclient/src/utils.c +) + +target_include_directories(libircclient PUBLIC ./libircclient/include) + diff --git a/libircclient/Changelog b/libircclient/Changelog new file mode 100644 index 0000000..fd9f159 --- /dev/null +++ b/libircclient/Changelog @@ -0,0 +1,129 @@ +2018-08-26 George Yunaev + * libircclient 1.10 released. + * Fixed compatibility with OpenSSL 1.1.x (thanks Antoine Amarilli) + +2016-05-03 George Yunaev + * libircclient 1.9 released. + * Fixed a few minor Win32 compatibility bugs. + * Fixed an error if the TCP connection to the IRC server couldn't be established under 250ms. + * Fixed a potential deadlock caused by WSAStartup() being called in DllMain() + +2014-05-10 George Yunaev + * libircclient 1.8 released. + * A few minor bugfixes and minor feature enchancements. + +2013-06-23 George Yunaev + * libircclient 1.7 released. + * Documentation rewritten using RST, and is now much better. + * Fixed a race condition when multiple threads attempt to call irc_connect while using SSL. + * Merged a fix for the IRC servers which (incorrectly) terminate lines with CR instead of CRLF as required by RFC. + * Several small bugfixes. + +2012-01-22 George Yunaev + * libircclient 1.6 released. + * Fixed PRIVMSG events incorrectly reported as CHANNEL (thx Dennis Bretjes) + * Added -fpic option for the shared library; fixed make install + * WIN32 macro replaced by _WIN32 (Lothar May) + * Fixed IPv6 and IPv4 connections being used simultaneously (Lothar May) + * Fixed DCC file transfer with IPv6 build (Lothar May) + +2012-01-18 George Yunaev + * libircclient 1.5 released. + * Added SSL support + * Fixed some compilation warnings + +2009-01-03 George Yunaev + * libircclient 1.3 released. + * Added IPv6 support (thanks Lothar May) + * Now provides more information about ACTION (thx chromerium) + * Updated contact info and copyrights. + * Removed ircmud sample as it never worked anyway. + +2006-08-29 George Yunaev + * libircclient 1.2 released. + * Windows: added missed expored functions from .def file. + +2005-03-10 George Yunaev + * libircclient 1.1 released. + * Fixed DCC buffer size which resulted extra callback on DCC tranfers + (thanks flohimself). + +2004-11-12 George Yunaev + * libircclient 1.0 released. + * Fixed compilation on FreeBSD. + +2004-10-31 George Yunaev + * When more than one DCC chat sessions were active, only the latest + generated callbacks. + * libircclient 0.8 released. + +2004-10-17 George Yunaev + * libircclient 0.7 released. + * Fixed DCC chat lockup in multithread programs (thanks olifozzy). + +2004-10-15 George Yunaev + * Win32 static library does not have dllmain anymore (thanks olifozzy). + * DCC chat crashed if there were several DCC session, and one of them was + closed (thanks olifozzy). + * DCC chat speed increased when several messages are stored in buffer. + +2004-10-10 George Yunaev + * libircclient 0.6 released. + * Added color support. + +2004-10-07 George Yunaev + * CTCP TIME reply was malformed on some platforms with buggy locales. + * Socket stuff rewritten to be signal-safe and more portable. + * Data and commands are now sent faster to IRC server. + * event_umode now works. + +2004-10-06 George Yunaev + * CHANGED BEHAVIOR: the built-in CTCP handler is used if not set. + Therefore, irc_event_ctcp_internal() is not public anymore. + * Added a small (as yet) FAQ. + * Add extra numeric codes from RFC2812. + +2004-10-03 George Yunaev + * Libircclient error codes are now well-documented. + * Modules documentation is extended. + * Added new methods: irc_cmd_part, irc_cmd_invite, irc_cmd_names, + irc_cmd_list, irc_cmd_topic, irc_cmd_channel_mode, irc_cmd_user_mode, + irc_cmd_nick, irc_cmd_whois. + * Added the improved error handling for NULL pointers to all the irc_cmd* + methods. + * Fixed the nickname tracking bug (after the nickname changing, all + privmsgs were treaten as channel messages). + * All the numeric reply codes from RFC1459 are now documented. + * Numeric reply codes for every command are now described. + +2004-09-30 George Yunaev + * libircclient 0.4 released + * exported an irc_is_connected method. + * fixed error output in examples. + * fixed several errors in Win32 build (there were no multithread support) + * add a Win32 dsp/dsw to build the library from VC6/7 + * add a .dsp for an example. + +2004-09-14 George Yunaev + * libircclient 0.3 released + * Fix CTCP time bug. + * Added working Win32 Visual Studio build, and libs. + * Added ircmud example, which allows people to play MUD through IRC client. + * Some stuff rewritten in more portable way. + +2004-09-13 George Yunaev + * Fix solaris x86/sparc compilation. + +2004-09-12 George Yunaev + * libircclient 0.2 released + * select() timeout decreased to 0.25sec (was 1 sec). The reason: when + the output buffer is empty, and server doesn't send anything, but a + command was asynchronously added, it will be processed only after + select() timeout. + * Fixed bug in DCC sessions - all DCC sessions requested by bots were + terminated in 60 secs with TIMEOUT error. + * Add DCC error description in irctest example. + + +2004-09-08 George Yunaev + * libircclient 0.1 released diff --git a/libircclient/Doxyfile b/libircclient/Doxyfile new file mode 100644 index 0000000..40f7211 --- /dev/null +++ b/libircclient/Doxyfile @@ -0,0 +1,1153 @@ +# Doxyfile 1.3.8 + +# This file describes the settings to be used by the documentation system +# doxygen (www.doxygen.org) for a project +# +# All text after a hash (#) is considered a comment and will be ignored +# The format is: +# TAG = value [value, ...] +# For lists items can also be appended using: +# TAG += value [value, ...] +# Values that contain spaces should be placed between quotes (" ") + +#--------------------------------------------------------------------------- +# 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. + +PROJECT_NAME = libircclient + +# The PROJECT_NUMBER tag can be used to enter a project or revision number. +# This could be handy for archiving the generated documentation or +# if some version control system is used. + +PROJECT_NUMBER = 1.3 + +# 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. + +OUTPUT_DIRECTORY = doc + +# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create +# 4096 sub-directories (in 2 levels) under the output directory of each output +# format and will distribute the generated files over these directories. +# Enabling this option can be useful when feeding doxygen a huge amount of source +# files, where putting all generated files in the same directory would otherwise +# cause performance problems for the file system. + +CREATE_SUBDIRS = NO + +# The OUTPUT_LANGUAGE tag is used to specify the language in which all +# documentation generated by doxygen is written. Doxygen will use this +# information to generate all constant output in the proper language. +# The default language is English, other supported languages are: +# Brazilian, Catalan, Chinese, Chinese-Traditional, Croatian, Czech, Danish, +# Dutch, Finnish, French, German, Greek, Hungarian, Italian, Japanese, +# Japanese-en (Japanese with English messages), Korean, Korean-en, Norwegian, +# Polish, Portuguese, Romanian, Russian, Serbian, Slovak, Slovene, Spanish, +# Swedish, and Ukrainian. + +OUTPUT_LANGUAGE = English + +# This tag can be used to specify the encoding used in the generated output. +# The encoding is not always determined by the language that is chosen, +# but also whether or not the output is meant for Windows or non-Windows users. +# In case there is a difference, setting the USE_WINDOWS_ENCODING tag to YES +# forces the Windows encoding (this is the default for the Windows binary), +# whereas setting the tag to NO uses a Unix-style encoding (the default for +# all platforms other than Windows). + +USE_WINDOWS_ENCODING = YES + +# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will +# include brief member descriptions after the members that are listed in +# the file and class documentation (similar to JavaDoc). +# Set to NO to disable this. + +BRIEF_MEMBER_DESC = YES + +# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend +# the brief description of a member or function before the detailed description. +# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the +# brief descriptions will be completely suppressed. + +REPEAT_BRIEF = YES + +# This tag implements a quasi-intelligent brief description abbreviator +# that is used to form the text in various listings. Each string +# in this list, if found as the leading text of the brief description, will be +# stripped from the text and the result after processing the whole list, is used +# as the annotated text. Otherwise, the brief description is used as-is. If left +# blank, the following values are used ("$name" is automatically replaced with the +# name of the entity): "The $name class" "The $name widget" "The $name file" +# "is" "provides" "specifies" "contains" "represents" "a" "an" "the" + +ABBREVIATE_BRIEF = + +# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then +# Doxygen will generate a detailed section even if there is only a brief +# description. + +ALWAYS_DETAILED_SEC = NO + +# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all inherited +# members of a class in the documentation of that class as if those members were +# ordinary class members. Constructors, destructors and assignment operators of +# the base classes will not be shown. + +INLINE_INHERITED_MEMB = NO + +# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full +# path before files name in the file list and in the header files. If set +# to NO the shortest path that makes the file name unique will be used. + +FULL_PATH_NAMES = NO + +# 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 = + +# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of +# the path mentioned in the documentation of a class, which tells +# the reader which header file to include in order to use a class. +# If left blank only the name of the header file containing the class +# definition is used. Otherwise one should specify the include paths that +# are normally passed to the compiler using the -I flag. + +STRIP_FROM_INC_PATH = + +# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter +# (but less readable) file names. This can be useful is your file systems +# doesn't support long names like on DOS, Mac, or CD-ROM. + +SHORT_NAMES = NO + +# 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 = NO + +# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen +# treat a multi-line C++ special comment block (i.e. a block of //! or /// +# comments) as a brief description. This used to be the default behaviour. +# The new default is to treat a multi-line C++ comment block as a detailed +# description. Set this tag to YES if you prefer the old behaviour instead. + +MULTILINE_CPP_IS_BRIEF = NO + +# If the DETAILS_AT_TOP tag is set to YES then Doxygen +# will output the detailed description near the top, like JavaDoc. +# If set to NO, the detailed description appears after the member +# documentation. + +DETAILS_AT_TOP = NO + +# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented +# member inherits the documentation from any documented member that it +# re-implements. + +INHERIT_DOCS = YES + +# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC +# tag is set to YES, then doxygen will reuse the documentation of the first +# member in the group (if any) for the other members of the group. By default +# all members of a group must be documented explicitly. + +DISTRIBUTE_GROUP_DOC = NO + +# The TAB_SIZE tag can be used to set the number of spaces in a tab. +# Doxygen uses this value to replace tabs by spaces in code fragments. + +TAB_SIZE = 4 + +# This tag can be used to specify a number of aliases that acts +# as commands in the documentation. An alias has the form "name=value". +# For example adding "sideeffect=\par Side Effects:\n" will allow you to +# put the command \sideeffect (or @sideeffect) in the documentation, which +# will result in a user-defined paragraph with heading "Side Effects:". +# You can put \n's in the value part of an alias to insert newlines. + +ALIASES = + +# 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 + +# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java sources +# only. Doxygen will then generate output that is more tailored for Java. +# For instance, namespaces will be presented as packages, qualified scopes +# will look different, etc. + +OPTIMIZE_OUTPUT_JAVA = NO + +# Set the SUBGROUPING tag to YES (the default) to allow class member groups of +# the same type (for instance a group of public functions) to be put as a +# subgroup of that type (e.g. under the Public Functions section). Set it to +# NO to prevent subgrouping. Alternatively, this can be done per class using +# the \nosubgrouping command. + +SUBGROUPING = YES + +#--------------------------------------------------------------------------- +# 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 = NO + +# If the EXTRACT_PRIVATE tag is set to YES all private members of a class +# will be included in the documentation. + +EXTRACT_PRIVATE = YES + +# If the EXTRACT_STATIC tag is set to YES all static members of a file +# will be included in the documentation. + +EXTRACT_STATIC = NO + +# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) +# defined locally in source files will be included in the documentation. +# If set to NO only classes defined in header files are included. + +EXTRACT_LOCAL_CLASSES = NO + +# This flag is only useful for Objective-C code. When set to YES local +# methods, which are defined in the implementation section but not in +# the interface are included in the documentation. +# If set to NO (the default) only methods in the interface are included. + +EXTRACT_LOCAL_METHODS = NO + +# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all +# undocumented members of documented classes, files or namespaces. +# If set to NO (the default) these members will be included in the +# various overviews, but no documentation section is generated. +# This option has no effect if EXTRACT_ALL is enabled. + +HIDE_UNDOC_MEMBERS = NO + +# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all +# undocumented classes that are normally visible in the class hierarchy. +# If set to NO (the default) these classes will be included in the various +# overviews. This option has no effect if EXTRACT_ALL is enabled. + +HIDE_UNDOC_CLASSES = NO + +# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all +# friend (class|struct|union) declarations. +# If set to NO (the default) these declarations will be included in the +# documentation. + +HIDE_FRIEND_COMPOUNDS = NO + +# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any +# documentation blocks found inside the body of a function. +# If set to NO (the default) these blocks will be appended to the +# function's detailed documentation block. + +HIDE_IN_BODY_DOCS = NO + +# The INTERNAL_DOCS tag determines if documentation +# that is typed after a \internal command is included. If the tag is set +# to NO (the default) then the documentation will be excluded. +# Set it to YES to include the internal documentation. + +INTERNAL_DOCS = NO + +# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate +# file names in lower-case letters. If set to YES upper-case letters are also +# allowed. This is useful if you have classes or files whose names only differ +# in case and if your file system supports case sensitive file names. Windows +# and Mac users are advised to set this option to NO. + +CASE_SENSE_NAMES = YES + +# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen +# will show members with their full class and namespace scopes in the +# documentation. If set to YES the scope will be hidden. + +HIDE_SCOPE_NAMES = NO + +# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen +# will put a list of the files that are included by a file in the documentation +# of that file. + +SHOW_INCLUDE_FILES = YES + +# If the INLINE_INFO tag is set to YES (the default) then a tag [inline] +# is inserted in the documentation for inline members. + +INLINE_INFO = YES + +# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen +# will sort the (detailed) documentation of file and class members +# alphabetically by member name. If set to NO the members will appear in +# declaration order. + +SORT_MEMBER_DOCS = YES + +# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the +# brief documentation of file, namespace and class members alphabetically +# by member name. If set to NO (the default) the members will appear in +# declaration order. + +SORT_BRIEF_DOCS = NO + +# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be +# sorted by fully-qualified names, including namespaces. If set to +# NO (the default), the class list will be sorted only by class name, +# not including the namespace part. +# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. +# Note: This option applies only to the class list, not to the +# alphabetical list. + +SORT_BY_SCOPE_NAME = NO + +# The GENERATE_TODOLIST tag can be used to enable (YES) or +# disable (NO) the todo list. This list is created by putting \todo +# commands in the documentation. + +GENERATE_TODOLIST = YES + +# The GENERATE_TESTLIST tag can be used to enable (YES) or +# disable (NO) the test list. This list is created by putting \test +# commands in the documentation. + +GENERATE_TESTLIST = YES + +# The GENERATE_BUGLIST tag can be used to enable (YES) or +# disable (NO) the bug list. This list is created by putting \bug +# commands in the documentation. + +GENERATE_BUGLIST = YES + +# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or +# disable (NO) the deprecated list. This list is created by putting +# \deprecated commands in the documentation. + +GENERATE_DEPRECATEDLIST= YES + +# The ENABLED_SECTIONS tag can be used to enable conditional +# documentation sections, marked by \if sectionname ... \endif. + +ENABLED_SECTIONS = + +# The MAX_INITIALIZER_LINES tag determines the maximum number of lines +# the initial value of a variable or define consists of for it to appear in +# the documentation. If the initializer consists of more lines than specified +# here it will be hidden. Use a value of 0 to hide initializers completely. +# The appearance of the initializer of individual variables and defines in the +# documentation can be controlled using \showinitializer or \hideinitializer +# command in the documentation regardless of this setting. + +MAX_INITIALIZER_LINES = 30 + +# Set the SHOW_USED_FILES tag to NO to disable the list of files generated +# at the bottom of the documentation of classes and structs. If set to YES the +# list will mention the files that were used to generate the documentation. + +SHOW_USED_FILES = YES + +#--------------------------------------------------------------------------- +# configuration options related to warning and progress messages +#--------------------------------------------------------------------------- + +# The QUIET tag can be used to turn on/off the messages that are generated +# by doxygen. Possible values are YES and NO. If left blank NO is used. + +QUIET = NO + +# The WARNINGS tag can be used to turn on/off the warning messages that are +# generated by doxygen. Possible values are YES and NO. If left blank +# NO is used. + +WARNINGS = YES + +# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings +# for undocumented members. If EXTRACT_ALL is set to YES then this flag will +# automatically be disabled. + +WARN_IF_UNDOCUMENTED = YES + +# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for +# potential errors in the documentation, such as not documenting some +# parameters in a documented function, or documenting parameters that +# don't exist or using markup commands wrongly. + +WARN_IF_DOC_ERROR = YES + +# The WARN_FORMAT tag determines the format of the warning messages that +# doxygen can produce. The string should contain the $file, $line, and $text +# tags, which will be replaced by the file and line number from which the +# warning originated and the warning text. + +WARN_FORMAT = "$file:$line: $text" + +# The WARN_LOGFILE tag can be used to specify a file to which warning +# and error messages should be written. If left blank the output is written +# to stderr. + +WARN_LOGFILE = + +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- + +# 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. + +INPUT = include/ + +# If the value of the INPUT tag contains directories, you can use the +# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp +# and *.h) to filter out the source-files in the directories. If left +# blank the following patterns are tested: +# *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx *.hpp +# *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm + +FILE_PATTERNS = + +# 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. + +RECURSIVE = NO + +# The EXCLUDE tag can be used to specify files and/or directories that should +# excluded from the INPUT source files. This way you can easily exclude a +# subdirectory from a directory tree whose root is specified with the INPUT tag. + +EXCLUDE = + +# The EXCLUDE_SYMLINKS tag can be used select whether or not files or directories +# that are symbolic links (a Unix filesystem feature) are excluded from the input. + +EXCLUDE_SYMLINKS = NO + +# If the value of the INPUT tag contains directories, you can use the +# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude +# certain files from those directories. + +EXCLUDE_PATTERNS = + +# The EXAMPLE_PATH tag can be used to specify one or more files or +# directories that contain example code fragments that are included (see +# the \include command). + +EXAMPLE_PATH = + +# If the value of the EXAMPLE_PATH tag contains directories, you can use the +# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp +# and *.h) to filter out the source-files in the directories. If left +# blank all files are included. + +EXAMPLE_PATTERNS = + +# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be +# searched for input files to be used with the \include or \dontinclude +# commands irrespective of the value of the RECURSIVE tag. +# Possible values are YES and NO. If left blank NO is used. + +EXAMPLE_RECURSIVE = NO + +# The IMAGE_PATH tag can be used to specify one or more files or +# directories that contain image that are included in the documentation (see +# the \image command). + +IMAGE_PATH = + +# The INPUT_FILTER tag can be used to specify a program that doxygen should +# invoke to filter for each input file. Doxygen will invoke the filter program +# by executing (via popen()) the command , where +# is the value of the INPUT_FILTER tag, and is the name of an +# input file. Doxygen will then use the output that the filter program writes +# to standard output. If FILTER_PATTERNS is specified, this tag will be +# ignored. + +INPUT_FILTER = + +# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern +# basis. Doxygen will compare the file name with each pattern and apply the +# filter if there is a match. The filters are a list of the form: +# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further +# info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER +# is applied to all files. + +FILTER_PATTERNS = + +# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using +# INPUT_FILTER) will be used to filter the input files when producing source +# files to browse (i.e. when SOURCE_BROWSER is set to YES). + +FILTER_SOURCE_FILES = NO + +#--------------------------------------------------------------------------- +# 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 = NO + +# Setting the INLINE_SOURCES tag to YES will include the body +# of functions and classes directly in the documentation. + +INLINE_SOURCES = NO + +# 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 = YES + +# If the REFERENCED_BY_RELATION tag is set to YES (the default) +# 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 (the default) +# then for each documented function all documented entities +# called/used by that function will be listed. + +REFERENCES_RELATION = YES + +# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen +# will generate a verbatim copy of the header file for each class for +# which an include is specified. Set to NO to disable this. + +VERBATIM_HEADERS = NO + +#--------------------------------------------------------------------------- +# configuration options related to the alphabetical class index +#--------------------------------------------------------------------------- + +# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index +# of all compounds will be generated. Enable this if the project +# contains a lot of classes, structs, unions or interfaces. + +ALPHABETICAL_INDEX = NO + +# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then +# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns +# in which this list will be split (can be a number in the range [1..20]) + +COLS_IN_ALPHA_INDEX = 5 + +# In case all classes in a project start with a common prefix, all +# classes will be put under the same header in the alphabetical index. +# The IGNORE_PREFIX tag can be used to specify one or more prefixes that +# should be ignored while generating the index headers. + +IGNORE_PREFIX = + +#--------------------------------------------------------------------------- +# configuration options related to the HTML output +#--------------------------------------------------------------------------- + +# If the GENERATE_HTML tag is set to YES (the default) Doxygen will +# generate HTML output. + +GENERATE_HTML = YES + +# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `html' will be used as the default path. + +HTML_OUTPUT = html + +# The HTML_FILE_EXTENSION tag can be used to specify the file extension for +# each generated HTML page (for example: .htm,.php,.asp). If it is left blank +# doxygen will generate files with .html extension. + +HTML_FILE_EXTENSION = .html + +# The HTML_HEADER tag can be used to specify a personal HTML header for +# each generated HTML page. If it is left blank doxygen will generate a +# standard header. + +HTML_HEADER = + +# 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 = + +# The HTML_STYLESHEET tag can be used to specify a user-defined cascading +# style sheet that is used by each HTML page. It can be used to +# fine-tune the look of the HTML output. If the tag is left blank doxygen +# will generate a default style sheet. Note that doxygen will try to copy +# the style sheet file to the HTML output directory, so don't put your own +# stylesheet in the HTML output directory as well, or it will be erased! + +HTML_STYLESHEET = + +# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes, +# files or namespaces will be aligned in HTML using tables. If set to +# NO a bullet list will be used. + +HTML_ALIGN_MEMBERS = YES + +# If the GENERATE_HTMLHELP tag is set to YES, additional index files +# will be generated that can be used as input for tools like the +# Microsoft HTML help workshop to generate a compressed HTML help file (.chm) +# of the generated HTML documentation. + +GENERATE_HTMLHELP = NO + +# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can +# be used to specify the file name of the resulting .chm file. You +# can add a path in front of the file if the result should not be +# written to the html output directory. + +CHM_FILE = + +# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can +# be used to specify the location (absolute path including file name) of +# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run +# the HTML help compiler on the generated index.hhp. + +HHC_LOCATION = + +# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag +# controls if a separate .chi index file is generated (YES) or that +# it should be included in the master .chm file (NO). + +GENERATE_CHI = NO + +# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag +# controls whether a binary table of contents is generated (YES) or a +# normal table of contents (NO) in the .chm file. + +BINARY_TOC = NO + +# The TOC_EXPAND flag can be set to YES to add extra items for group members +# to the contents of the HTML help documentation and to the tree view. + +TOC_EXPAND = NO + +# The DISABLE_INDEX tag can be used to turn on/off the condensed index at +# top of each HTML page. The value NO (the default) enables the index and +# the value YES disables it. + +DISABLE_INDEX = NO + +# This tag can be used to set the number of enum values (range [1..20]) +# that doxygen will group on one line in the generated HTML documentation. + +ENUM_VALUES_PER_LINE = 4 + +# If the GENERATE_TREEVIEW tag is set to YES, a side panel will be +# generated containing a tree-like index structure (just like the one that +# is generated for HTML Help). For this to work a browser that supports +# JavaScript, DHTML, CSS and frames is required (for instance Mozilla 1.0+, +# Netscape 6.0+, Internet explorer 5.0+, or Konqueror). Windows users are +# probably better off using the HTML help feature. + +GENERATE_TREEVIEW = NO + +# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be +# used to set the initial width (in pixels) of the frame in which the tree +# is shown. + +TREEVIEW_WIDTH = 250 + +#--------------------------------------------------------------------------- +# configuration options related to the LaTeX output +#--------------------------------------------------------------------------- + +# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will +# generate Latex output. + +GENERATE_LATEX = NO + +# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `latex' will be used as the default path. + +LATEX_OUTPUT = latex + +# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be +# invoked. If left blank `latex' will be used as the default command name. + +LATEX_CMD_NAME = latex + +# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to +# generate index for LaTeX. If left blank `makeindex' will be used as the +# default command name. + +MAKEINDEX_CMD_NAME = makeindex + +# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact +# LaTeX documents. This may be useful for small projects and may help to +# save some trees in general. + +COMPACT_LATEX = NO + +# The PAPER_TYPE tag can be used to set the paper type that is used +# by the printer. Possible values are: a4, a4wide, letter, legal and +# executive. If left blank a4wide will be used. + +PAPER_TYPE = a4wide + +# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX +# packages that should be included in the LaTeX output. + +EXTRA_PACKAGES = + +# The LATEX_HEADER tag can be used to specify a personal LaTeX header for +# the generated latex document. The header should contain everything until +# the first chapter. If it is left blank doxygen will generate a +# standard header. Notice: only use this tag if you know what you are doing! + +LATEX_HEADER = + +# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated +# is prepared for conversion to pdf (using ps2pdf). The pdf file will +# contain links (just like the HTML output) instead of page references +# This makes the output suitable for online browsing using a pdf viewer. + +PDF_HYPERLINKS = NO + +# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of +# plain latex in the generated Makefile. Set this option to YES to get a +# higher quality PDF documentation. + +USE_PDFLATEX = NO + +# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode. +# command to the generated LaTeX files. This will instruct LaTeX to keep +# running if errors occur, instead of asking the user for help. +# This option is also used when generating formulas in HTML. + +LATEX_BATCHMODE = NO + +# If LATEX_HIDE_INDICES is set to YES then doxygen will not +# include the index chapters (such as File Index, Compound Index, etc.) +# in the output. + +LATEX_HIDE_INDICES = NO + +#--------------------------------------------------------------------------- +# configuration options related to the RTF output +#--------------------------------------------------------------------------- + +# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output +# The RTF output is optimized for Word 97 and may not look very pretty with +# other RTF readers or editors. + +GENERATE_RTF = NO + +# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `rtf' will be used as the default path. + +RTF_OUTPUT = rtf + +# If the COMPACT_RTF tag is set to YES Doxygen generates more compact +# RTF documents. This may be useful for small projects and may help to +# save some trees in general. + +COMPACT_RTF = NO + +# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated +# will contain hyperlink fields. The RTF file will +# contain links (just like the HTML output) instead of page references. +# This makes the output suitable for online browsing using WORD or other +# programs which support those fields. +# Note: wordpad (write) and others do not support links. + +RTF_HYPERLINKS = NO + +# Load stylesheet definitions from file. Syntax is similar to doxygen's +# config file, i.e. a series of assignments. You only have to provide +# replacements, missing definitions are set to their default value. + +RTF_STYLESHEET_FILE = + +# Set optional variables used in the generation of an rtf document. +# Syntax is similar to doxygen's config file. + +RTF_EXTENSIONS_FILE = + +#--------------------------------------------------------------------------- +# configuration options related to the man page output +#--------------------------------------------------------------------------- + +# If the GENERATE_MAN tag is set to YES (the default) Doxygen will +# generate man pages + +GENERATE_MAN = YES + +# The MAN_OUTPUT tag is used to specify where the man pages will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `man' will be used as the default path. + +MAN_OUTPUT = man + +# The MAN_EXTENSION tag determines the extension that is added to +# the generated man pages (default is the subroutine's section .3) + +MAN_EXTENSION = .3 + +# If the MAN_LINKS tag is set to YES and Doxygen generates man output, +# then it will generate one additional man file for each entity +# documented in the real man page(s). These additional files +# only source the real man page, but without them the man command +# would be unable to find the correct page. The default is NO. + +MAN_LINKS = YES + +#--------------------------------------------------------------------------- +# configuration options related to the XML output +#--------------------------------------------------------------------------- + +# If the GENERATE_XML tag is set to YES Doxygen will +# generate an XML file that captures the structure of +# the code including all documentation. + +GENERATE_XML = NO + +# The XML_OUTPUT tag is used to specify where the XML pages will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `xml' will be used as the default path. + +XML_OUTPUT = xml + +# The XML_SCHEMA tag can be used to specify an XML schema, +# which can be used by a validating XML parser to check the +# syntax of the XML files. + +XML_SCHEMA = + +# The XML_DTD tag can be used to specify an XML DTD, +# which can be used by a validating XML parser to check the +# syntax of the XML files. + +XML_DTD = + +# If the XML_PROGRAMLISTING tag is set to YES Doxygen will +# dump the program listings (including syntax highlighting +# and cross-referencing information) to the XML output. Note that +# enabling this will significantly increase the size of the XML output. + +XML_PROGRAMLISTING = YES + +#--------------------------------------------------------------------------- +# configuration options for the AutoGen Definitions output +#--------------------------------------------------------------------------- + +# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will +# generate an AutoGen Definitions (see autogen.sf.net) file +# that captures the structure of the code including all +# documentation. Note that this feature is still experimental +# and incomplete at the moment. + +GENERATE_AUTOGEN_DEF = NO + +#--------------------------------------------------------------------------- +# configuration options related to the Perl module output +#--------------------------------------------------------------------------- + +# If the GENERATE_PERLMOD tag is set to YES Doxygen will +# generate a Perl module file that captures the structure of +# the code including all documentation. Note that this +# feature is still experimental and incomplete at the +# moment. + +GENERATE_PERLMOD = NO + +# If the PERLMOD_LATEX tag is set to YES Doxygen will generate +# the necessary Makefile rules, Perl scripts and LaTeX code to be able +# to generate PDF and DVI output from the Perl module output. + +PERLMOD_LATEX = NO + +# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be +# nicely formatted so it can be parsed by a human reader. This is useful +# if you want to understand what is going on. On the other hand, if this +# tag is set to NO the size of the Perl module output will be much smaller +# and Perl will parse it just the same. + +PERLMOD_PRETTY = YES + +# The names of the make variables in the generated doxyrules.make file +# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. +# This is useful so different doxyrules.make files included by the same +# Makefile don't overwrite each other's variables. + +PERLMOD_MAKEVAR_PREFIX = + +#--------------------------------------------------------------------------- +# Configuration options related to the preprocessor +#--------------------------------------------------------------------------- + +# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will +# evaluate all C-preprocessor directives found in the sources and include +# files. + +ENABLE_PREPROCESSING = YES + +# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro +# names in the source code. If set to NO (the default) only conditional +# compilation will be performed. Macro expansion can be done in a controlled +# way by setting EXPAND_ONLY_PREDEF to YES. + +MACRO_EXPANSION = NO + +# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES +# then the macro expansion is limited to the macros specified with the +# PREDEFINED and EXPAND_AS_PREDEFINED tags. + +EXPAND_ONLY_PREDEF = NO + +# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files +# in the INCLUDE_PATH (see below) will be search if a #include is found. + +SEARCH_INCLUDES = YES + +# The INCLUDE_PATH tag can be used to specify one or more directories that +# contain include files that are not input files but should be processed by +# the preprocessor. + +INCLUDE_PATH = + +# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard +# patterns (like *.h and *.hpp) to filter out the header-files in the +# directories. If left blank, the patterns specified with FILE_PATTERNS will +# be used. + +INCLUDE_FILE_PATTERNS = + +# 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. + +PREDEFINED = + +# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then +# this tag can be used to specify a list of macro names that should be expanded. +# The macro definition that is found in the sources will be used. +# Use the PREDEFINED tag if you want to use a different macro definition. + +EXPAND_AS_DEFINED = + +# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then +# doxygen's preprocessor will remove all function-like macros that are alone +# on a line, have an all uppercase name, and do not end with a semicolon. Such +# function macros are typically used for boiler-plate code, and will confuse the +# parser if not removed. + +SKIP_FUNCTION_MACROS = YES + +#--------------------------------------------------------------------------- +# Configuration::additions related to external references +#--------------------------------------------------------------------------- + +# The TAGFILES option can be used to specify one or more tagfiles. +# Optionally an initial location of the external documentation +# can be added for each tagfile. The format of a tag file without +# this location is as follows: +# TAGFILES = file1 file2 ... +# Adding location for the tag files is done as follows: +# TAGFILES = file1=loc1 "file2 = loc2" ... +# where "loc1" and "loc2" can be relative or absolute paths or +# URLs. If a location is present for each tag, the installdox tool +# does not have to be run to correct the links. +# Note that each tag file must have a unique name +# (where the name does NOT include the path) +# If a tag file is not located in the directory in which doxygen +# is run, you must also specify the path to the tagfile here. + +TAGFILES = + +# When a file name is specified after GENERATE_TAGFILE, doxygen will create +# a tag file that is based on the input files it reads. + +GENERATE_TAGFILE = + +# If the ALLEXTERNALS tag is set to YES all external classes will be listed +# in the class index. If set to NO only the inherited external classes +# will be listed. + +ALLEXTERNALS = NO + +# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed +# in the modules index. If set to NO, only the current project's groups will +# be listed. + +EXTERNAL_GROUPS = YES + +# The PERL_PATH should be the absolute path and name of the perl script +# interpreter (i.e. the result of `which perl'). + +PERL_PATH = /usr/bin/perl + +#--------------------------------------------------------------------------- +# Configuration options related to the dot tool +#--------------------------------------------------------------------------- + +# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will +# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base or +# super classes. Setting the tag to NO turns the diagrams off. Note that this +# option is superseded by the HAVE_DOT option below. This is only a fallback. It is +# recommended to install and use dot, since it yields more powerful graphs. + +CLASS_DIAGRAMS = NO + +# If set to YES, the inheritance and collaboration graphs will hide +# inheritance and usage relations if the target is undocumented +# or is not a class. + +HIDE_UNDOC_RELATIONS = YES + +# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is +# available from the path. This tool is part of Graphviz, a graph visualization +# toolkit from AT&T and Lucent Bell Labs. The other options in this section +# have no effect if this option is set to NO (the default) + +HAVE_DOT = NO + +# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen +# will generate a graph for each documented class showing the direct and +# indirect inheritance relations. Setting this tag to YES will force the +# the CLASS_DIAGRAMS tag to NO. + +CLASS_GRAPH = NO + +# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen +# will generate a graph for each documented class showing the direct and +# indirect implementation dependencies (inheritance, containment, and +# class references variables) of the class with other documented classes. + +COLLABORATION_GRAPH = YES + +# If the UML_LOOK tag is set to YES doxygen will generate inheritance and +# collaboration diagrams in a style similar to the OMG's Unified Modeling +# Language. + +UML_LOOK = NO + +# If set to YES, the inheritance and collaboration graphs will show the +# relations between templates and their instances. + +TEMPLATE_RELATIONS = YES + +# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT +# tags are set to YES then doxygen will generate a graph for each documented +# file showing the direct and indirect include dependencies of the file with +# other documented files. + +INCLUDE_GRAPH = YES + +# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and +# HAVE_DOT tags are set to YES then doxygen will generate a graph for each +# documented header file showing the documented files that directly or +# indirectly include this file. + +INCLUDED_BY_GRAPH = YES + +# If the CALL_GRAPH and HAVE_DOT tags are set to YES then doxygen will +# generate a call dependency graph for every global function or class method. +# Note that enabling this option will significantly increase the time of a run. +# So in most cases it will be better to enable call graphs for selected +# functions only using the \callgraph command. + +CALL_GRAPH = NO + +# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen +# will graphical hierarchy of all classes instead of a textual one. + +GRAPHICAL_HIERARCHY = YES + +# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images +# generated by dot. Possible values are png, jpg, or gif +# If left blank png will be used. + +DOT_IMAGE_FORMAT = png + +# The tag DOT_PATH can be used to specify the path where the dot tool can be +# found. If left blank, it is assumed the dot tool can be found on the path. + +DOT_PATH = + +# The DOTFILE_DIRS tag can be used to specify one or more directories that +# contain dot files that are included in the documentation (see the +# \dotfile command). + +DOTFILE_DIRS = + +# The MAX_DOT_GRAPH_WIDTH tag can be used to set the maximum allowed width +# (in pixels) of the graphs generated by dot. If a graph becomes larger than +# this value, doxygen will try to truncate the graph, so that it fits within +# the specified constraint. Beware that most browsers cannot cope with very +# large images. + +MAX_DOT_GRAPH_WIDTH = 1024 + +# The MAX_DOT_GRAPH_HEIGHT tag can be used to set the maximum allows height +# (in pixels) of the graphs generated by dot. If a graph becomes larger than +# this value, doxygen will try to truncate the graph, so that it fits within +# the specified constraint. Beware that most browsers cannot cope with very +# large images. + +MAX_DOT_GRAPH_HEIGHT = 1024 + +# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the +# graphs generated by dot. A depth value of 3 means that only nodes reachable +# from the root by following a path via at most 3 edges will be shown. Nodes that +# lay further from the root node will be omitted. Note that setting this option to +# 1 or 2 may greatly reduce the computation time needed for large code bases. Also +# note that a graph may be further truncated if the graph's image dimensions are +# not sufficient to fit the graph (see MAX_DOT_GRAPH_WIDTH and MAX_DOT_GRAPH_HEIGHT). +# If 0 is used for the depth value (the default), the graph is not depth-constrained. + +MAX_DOT_GRAPH_DEPTH = 0 + +# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will +# generate a legend page explaining the meaning of the various boxes and +# arrows in the dot generated graphs. + +GENERATE_LEGEND = YES + +# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will +# remove the intermediate dot files that are used to generate +# the various graphs. + +DOT_CLEANUP = YES + +#--------------------------------------------------------------------------- +# Configuration::additions related to the search engine +#--------------------------------------------------------------------------- + +# The SEARCHENGINE tag specifies whether or not a search engine should be +# used. If set to NO the values of all tags below this one will be ignored. + +SEARCHENGINE = NO diff --git a/libircclient/LICENSE b/libircclient/LICENSE new file mode 100644 index 0000000..161a3d1 --- /dev/null +++ b/libircclient/LICENSE @@ -0,0 +1,482 @@ + GNU LIBRARY GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1991 Free Software Foundation, Inc. + 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + +[This is the first released version of the library GPL. It is + numbered 2 because it goes with version 2 of the ordinary GPL.] + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +Licenses are intended to guarantee your freedom to share and change +free software--to make sure the software is free for all its users. + + This license, the Library General Public License, applies to some +specially designated Free Software Foundation software, and to any +other libraries whose authors decide to use it. You can use it for +your libraries, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if +you distribute copies of the library, or if you modify it. + + For example, if you distribute copies of the library, whether gratis +or for a fee, you must give the recipients all the rights that we gave +you. You must make sure that they, too, receive or can get the source +code. If you link a program with the library, you must provide +complete object files to the recipients so that they can relink them +with the library, after making changes to the library and recompiling +it. And you must show them these terms so they know their rights. + + Our method of protecting your rights has two steps: (1) copyright +the library, and (2) offer you this license which gives you legal +permission to copy, distribute and/or modify the library. + + Also, for each distributor's protection, we want to make certain +that everyone understands that there is no warranty for this free +library. If the library is modified by someone else and passed on, we +want its recipients to know that what they have is not the original +version, so that any problems introduced by others will not reflect on +the original authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that companies distributing free +software will individually obtain patent licenses, thus in effect +transforming the program into proprietary software. To prevent this, +we have made it clear that any patent must be licensed for everyone's +free use or not licensed at all. + + Most GNU software, including some libraries, is covered by the ordinary +GNU General Public License, which was designed for utility programs. This +license, the GNU Library General Public License, applies to certain +designated libraries. This license is quite different from the ordinary +one; be sure to read it in full, and don't assume that anything in it is +the same as in the ordinary license. + + The reason we have a separate public license for some libraries is that +they blur the distinction we usually make between modifying or adding to a +program and simply using it. Linking a program with a library, without +changing the library, is in some sense simply using the library, and is +analogous to running a utility program or application program. However, in +a textual and legal sense, the linked executable is a combined work, a +derivative of the original library, and the ordinary General Public License +treats it as such. + + Because of this blurred distinction, using the ordinary General +Public License for libraries did not effectively promote software +sharing, because most developers did not use the libraries. We +concluded that weaker conditions might promote sharing better. + + However, unrestricted linking of non-free programs would deprive the +users of those programs of all benefit from the free status of the +libraries themselves. This Library General Public License is intended to +permit developers of non-free programs to use free libraries, while +preserving your freedom as a user of such programs to change the free +libraries that are incorporated in them. (We have not seen how to achieve +this as regards changes in header files, but we have achieved it as regards +changes in the actual functions of the Library.) The hope is that this +will lead to faster development of free libraries. + + The precise terms and conditions for copying, distribution and +modification follow. Pay close attention to the difference between a +"work based on the library" and a "work that uses the library". The +former contains code derived from the library, while the latter only +works together with the library. + + Note that it is possible for a library to be covered by the ordinary +General Public License rather than by this special one. + + GNU LIBRARY GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License Agreement applies to any software library which +contains a notice placed by the copyright holder or other authorized +party saying it may be distributed under the terms of this Library +General Public License (also called "this License"). Each licensee is +addressed as "you". + + A "library" means a collection of software functions and/or data +prepared so as to be conveniently linked with application programs +(which use some of those functions and data) to form executables. + + The "Library", below, refers to any such software library or work +which has been distributed under these terms. A "work based on the +Library" means either the Library or any derivative work under +copyright law: that is to say, a work containing the Library or a +portion of it, either verbatim or with modifications and/or translated +straightforwardly into another language. (Hereinafter, translation is +included without limitation in the term "modification".) + + "Source code" for a work means the preferred form of the work for +making modifications to it. For a library, complete source code means +all the source code for all modules it contains, plus any associated +interface definition files, plus the scripts used to control compilation +and installation of the library. + + Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running a program using the Library is not restricted, and output from +such a program is covered only if its contents constitute a work based +on the Library (independent of the use of the Library in a tool for +writing it). Whether that is true depends on what the Library does +and what the program that uses the Library does. + + 1. You may copy and distribute verbatim copies of the Library's +complete source code as you receive it, in any medium, provided that +you conspicuously and appropriately publish on each copy an +appropriate copyright notice and disclaimer of warranty; keep intact +all the notices that refer to this License and to the absence of any +warranty; and distribute a copy of this License along with the +Library. + + You may charge a fee for the physical act of transferring a copy, +and you may at your option offer warranty protection in exchange for a +fee. + + 2. You may modify your copy or copies of the Library or any portion +of it, thus forming a work based on the Library, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) The modified work must itself be a software library. + + b) You must cause the files modified to carry prominent notices + stating that you changed the files and the date of any change. + + c) You must cause the whole of the work to be licensed at no + charge to all third parties under the terms of this License. + + d) If a facility in the modified Library refers to a function or a + table of data to be supplied by an application program that uses + the facility, other than as an argument passed when the facility + is invoked, then you must make a good faith effort to ensure that, + in the event an application does not supply such function or + table, the facility still operates, and performs whatever part of + its purpose remains meaningful. + + (For example, a function in a library to compute square roots has + a purpose that is entirely well-defined independent of the + application. Therefore, Subsection 2d requires that any + application-supplied function or table used by this function must + be optional: if the application does not supply it, the square + root function must still compute square roots.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Library, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Library, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote +it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Library. + +In addition, mere aggregation of another work not based on the Library +with the Library (or with a work based on the Library) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may opt to apply the terms of the ordinary GNU General Public +License instead of this License to a given copy of the Library. To do +this, you must alter all the notices that refer to this License, so +that they refer to the ordinary GNU General Public License, version 2, +instead of to this License. (If a newer version than version 2 of the +ordinary GNU General Public License has appeared, then you can specify +that version instead if you wish.) Do not make any other change in +these notices. + + Once this change is made in a given copy, it is irreversible for +that copy, so the ordinary GNU General Public License applies to all +subsequent copies and derivative works made from that copy. + + This option is useful when you wish to copy part of the code of +the Library into a program that is not a library. + + 4. You may copy and distribute the Library (or a portion or +derivative of it, under Section 2) in object code or executable form +under the terms of Sections 1 and 2 above provided that you accompany +it with the complete corresponding machine-readable source code, which +must be distributed under the terms of Sections 1 and 2 above on a +medium customarily used for software interchange. + + If distribution of object code is made by offering access to copy +from a designated place, then offering equivalent access to copy the +source code from the same place satisfies the requirement to +distribute the source code, even though third parties are not +compelled to copy the source along with the object code. + + 5. A program that contains no derivative of any portion of the +Library, but is designed to work with the Library by being compiled or +linked with it, is called a "work that uses the Library". Such a +work, in isolation, is not a derivative work of the Library, and +therefore falls outside the scope of this License. + + However, linking a "work that uses the Library" with the Library +creates an executable that is a derivative of the Library (because it +contains portions of the Library), rather than a "work that uses the +library". The executable is therefore covered by this License. +Section 6 states terms for distribution of such executables. + + When a "work that uses the Library" uses material from a header file +that is part of the Library, the object code for the work may be a +derivative work of the Library even though the source code is not. +Whether this is true is especially significant if the work can be +linked without the Library, or if the work is itself a library. The +threshold for this to be true is not precisely defined by law. + + If such an object file uses only numerical parameters, data +structure layouts and accessors, and small macros and small inline +functions (ten lines or less in length), then the use of the object +file is unrestricted, regardless of whether it is legally a derivative +work. (Executables containing this object code plus portions of the +Library will still fall under Section 6.) + + Otherwise, if the work is a derivative of the Library, you may +distribute the object code for the work under the terms of Section 6. +Any executables containing that work also fall under Section 6, +whether or not they are linked directly with the Library itself. + + 6. As an exception to the Sections above, you may also compile or +link a "work that uses the Library" with the Library to produce a +work containing portions of the Library, and distribute that work +under terms of your choice, provided that the terms permit +modification of the work for the customer's own use and reverse +engineering for debugging such modifications. + + You must give prominent notice with each copy of the work that the +Library is used in it and that the Library and its use are covered by +this License. You must supply a copy of this License. If the work +during execution displays copyright notices, you must include the +copyright notice for the Library among them, as well as a reference +directing the user to the copy of this License. Also, you must do one +of these things: + + a) Accompany the work with the complete corresponding + machine-readable source code for the Library including whatever + changes were used in the work (which must be distributed under + Sections 1 and 2 above); and, if the work is an executable linked + with the Library, with the complete machine-readable "work that + uses the Library", as object code and/or source code, so that the + user can modify the Library and then relink to produce a modified + executable containing the modified Library. (It is understood + that the user who changes the contents of definitions files in the + Library will not necessarily be able to recompile the application + to use the modified definitions.) + + b) Accompany the work with a written offer, valid for at + least three years, to give the same user the materials + specified in Subsection 6a, above, for a charge no more + than the cost of performing this distribution. + + c) If distribution of the work is made by offering access to copy + from a designated place, offer equivalent access to copy the above + specified materials from the same place. + + d) Verify that the user has already received a copy of these + materials or that you have already sent this user a copy. + + For an executable, the required form of the "work that uses the +Library" must include any data and utility programs needed for +reproducing the executable from it. However, as a special exception, +the source code distributed need not include anything that is normally +distributed (in either source or binary form) with the major +components (compiler, kernel, and so on) of the operating system on +which the executable runs, unless that component itself accompanies +the executable. + + It may happen that this requirement contradicts the license +restrictions of other proprietary libraries that do not normally +accompany the operating system. Such a contradiction means you cannot +use both them and the Library together in an executable that you +distribute. + + 7. You may place library facilities that are a work based on the +Library side-by-side in a single library together with other library +facilities not covered by this License, and distribute such a combined +library, provided that the separate distribution of the work based on +the Library and of the other library facilities is otherwise +permitted, and provided that you do these two things: + + a) Accompany the combined library with a copy of the same work + based on the Library, uncombined with any other library + facilities. This must be distributed under the terms of the + Sections above. + + b) Give prominent notice with the combined library of the fact + that part of it is a work based on the Library, and explaining + where to find the accompanying uncombined form of the same work. + + 8. You may not copy, modify, sublicense, link with, or distribute +the Library except as expressly provided under this License. Any +attempt otherwise to copy, modify, sublicense, link with, or +distribute the Library is void, and will automatically terminate your +rights under this License. However, parties who have received copies, +or rights, from you under this License will not have their licenses +terminated so long as such parties remain in full compliance. + + 9. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Library or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Library (or any work based on the +Library), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Library or works based on it. + + 10. Each time you redistribute the Library (or any work based on the +Library), the recipient automatically receives a license from the +original licensor to copy, distribute, link with or modify the Library +subject to these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 11. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Library at all. For example, if a patent +license would not permit royalty-free redistribution of the Library by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Library. + +If any portion of this section is held invalid or unenforceable under any +particular circumstance, the balance of the section is intended to apply, +and the section as a whole is intended to apply in other circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 12. If the distribution and/or use of the Library is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Library under this License may add +an explicit geographical distribution limitation excluding those countries, +so that distribution is permitted only in or among countries not thus +excluded. In such case, this License incorporates the limitation as if +written in the body of this License. + + 13. The Free Software Foundation may publish revised and/or new +versions of the Library General Public License from time to time. +Such new versions will be similar in spirit to the present version, +but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Library +specifies a version number of this License which applies to it and +"any later version", you have the option of following the terms and +conditions either of that version or of any later version published by +the Free Software Foundation. If the Library does not specify a +license version number, you may choose any version ever published by +the Free Software Foundation. + + 14. If you wish to incorporate parts of the Library into other free +programs whose distribution conditions are incompatible with these, +write to the author to ask for permission. For software which is +copyrighted by the Free Software Foundation, write to the Free +Software Foundation; we sometimes make exceptions for this. Our +decision will be guided by the two goals of preserving the free status +of all derivatives of our free software and of promoting the sharing +and reuse of software generally. + + NO WARRANTY + + 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO +WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. +EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR +OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY +KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE +LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME +THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN +WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY +AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU +FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR +CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE +LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING +RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A +FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF +SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGES. + + END OF TERMS AND CONDITIONS + + Appendix: How to Apply These Terms to Your New Libraries + + If you develop a new library, and you want it to be of the greatest +possible use to the public, we recommend making it free software that +everyone can redistribute and change. You can do so by permitting +redistribution under these terms (or, alternatively, under the terms of the +ordinary General Public License). + + To apply these terms, attach the following notices to the library. It is +safest to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least the +"copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, + MA 02111-1307, USA + +Also add information on how to contact you by electronic and paper mail. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the library, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the + library `Frob' (a library for tweaking knobs) written by James Random Hacker. + + , 1 April 1990 + Ty Coon, President of Vice + +That's all there is to it! diff --git a/libircclient/Makefile b/libircclient/Makefile new file mode 100644 index 0000000..2dc117d --- /dev/null +++ b/libircclient/Makefile @@ -0,0 +1,26 @@ +# $Id: Makefile 84 2009-01-10 01:37:29Z chromerium $ + +SUBDIRS = src examples + +all: + for subdir in $(SUBDIRS); do \ + $(MAKE) -C $$subdir || exit 1; \ + done + +clean: + -for subdir in $(SUBDIRS); do \ + $(MAKE) -C $$subdir clean || exit 1; \ + done + -rm -f core + +distclean: + -for subdir in $(SUBDIRS); do \ + $(MAKE) -C $$subdir distclean || exit 1; \ + done + -rm -f include/config.h config.cache config.status config.log core + +distro: distclean + (cd .. && tar zcf libircclient-1.2.tar.gz libircclient-1.2) + +install: all + -cd src && make install diff --git a/libircclient/README b/libircclient/README new file mode 100644 index 0000000..2908ca5 --- /dev/null +++ b/libircclient/README @@ -0,0 +1,14 @@ +Building from source + +The library uses autoconf so it is build in a fairly typical way on most Unix systems: + +./configure +make +This will build both the library and various examples in the examples subdirectory. + +Configure script also accepts parameters, optional useful parameters accepted are –enable-openssl and –enable-ipv6 which correspondingly enable the SSL and IPv6 connectivity. Use –enable-shared to build a shared library. + +The same procedure is used to build the Win32 binary using the MinGW compiler. + +For the rest see the Doxygen documentation in the header files and http://www.ulduzsoft.com/libircclient/ + diff --git a/libircclient/THANKS b/libircclient/THANKS new file mode 100644 index 0000000..af2055c --- /dev/null +++ b/libircclient/THANKS @@ -0,0 +1,4 @@ +I'd like to thank those people, who greatly helped to develop libircclient: + +- olifozzy (olifozzy@users.sourceforge.net) for great bug reports. +- Lothar May for adding and testing IPv6 support. diff --git a/libircclient/build-release.sh b/libircclient/build-release.sh new file mode 100755 index 0000000..687bfaa --- /dev/null +++ b/libircclient/build-release.sh @@ -0,0 +1,73 @@ +#!/bin/sh + +# Export the source code + +PACKAGE=libircclient +BINARYFILE="libircclient.dll" + +FILE_VERSION="src/params.h" + +# Get current version +VERSION_MAJOR=`sed -n 's/^\#define\s\+LIBIRC_VERSION_HIGH\s\+\([0-9]\+\)/\1/p' $FILE_VERSION` +VERSION_MINOR=`sed -n 's/^\#define\s\+LIBIRC_VERSION_LOW\s\+\([0-9]\+\)/\1/p' $FILE_VERSION` +CURRENTVER="$VERSION_MAJOR.$VERSION_MINOR" + +BUILDDIR="build" +RELEASEDIR="release/$CURRENTVER" +PKGDIR="$PACKAGE-$CURRENTVER" + +if [ -d "$BUILDDIR" ]; then + rm -rf "$BUILDDIR" +fi + +if [ ! -d "$RELEASEDIR" ]; then + mkdir -p $RELEASEDIR +fi + +if [ -d "$PKGDIR" ]; then + rm -rf "$PKGDIR" +fi + +# Export the build directory to build the documentation +svn export . "$BUILDDIR/" || exit 1 + +# Build the documentation +(cd $BUILDDIR/doc && make singlehtml && make man) || exit 1 + +# Package the documentations +(cd $BUILDDIR/doc/_build/singlehtml && zip -r ../$PKGDIR-html.zip .) +mv $BUILDDIR/doc/_build/$PKGDIR-html.zip $RELEASEDIR/ || exit 1 + +# Source package +svn export . "$PKGDIR/" || exit 1 +mkdir $PKGDIR/man +cp $BUILDDIR/doc/_build/man/libircclient.1 $PKGDIR/man/ || exit 1 +tar zcf "$RELEASEDIR/$PKGDIR.tar.gz" $PKGDIR/ || exit 1 +rm -rf $PKGDIR/* + +# win32 +export PATH=$PATH:/usr/toolchains/windows-x86-complete/bin/ +(cd $BUILDDIR && ./configure --enable-shared --host=i686-w64-mingw32.static && make) || exit 1 + +BINDIR="$PKGDIR/bin" +mkdir -p $BINDIR +cp $BUILDDIR/src/libircclient.dll $BINDIR/ || exit 1 +cp $BUILDDIR/src/libircclient.lib $BINDIR/ || exit 1 +mkdir "$PKGDIR/include" +cp include/*.h "$PKGDIR/include" || exit 1 +mkdir "$PKGDIR/examples" +cp examples/*.c* $PKGDIR/examples || exit 1 +mkdir "$PKGDIR/doc" +cp $RELEASEDIR/$PKGDIR-html.zip "$PKGDIR/doc/" || exit 1 + +zip -r $RELEASEDIR/$PKGDIR-win32-dll.zip $PKGDIR || exit 1 + +# And the SSL version +(cd $BUILDDIR && make distclean && ./configure --enable-shared --host=i686-w64-mingw32.static --enable-openssl && make clean && make) || exit 1 +cp $BUILDDIR/src/libircclient.dll $BINDIR/ || exit 1 +cp $BUILDDIR/src/libircclient.lib $BINDIR/ || exit 1 + +zip -r $RELEASEDIR/$PKGDIR-win32-dll-openssl.zip $PKGDIR || exit 1 + +rm -rf "$BUILDDIR" "$PKGDIR" +echo "Done! Version $CURRENTVER released!" diff --git a/libircclient/cocoa/Classes/DDInvocationGrabber.h b/libircclient/cocoa/Classes/DDInvocationGrabber.h new file mode 100644 index 0000000..17e7504 --- /dev/null +++ b/libircclient/cocoa/Classes/DDInvocationGrabber.h @@ -0,0 +1,114 @@ +/* + * Copyright (c) 2007-2008 Dave Dribin + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, copy, + * modify, merge, publish, distribute, sublicense, and/or sell copies + * of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS + * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + + +/* + * This class is based on CInvocationGrabber: + * + * Copyright (c) 2007, Toxic Software + * All rights reserved. + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * * Neither the name of the Toxic Software nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF + * THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#import + +/* + * @class DDInvocationGrabber + * @discussion DDInvocationGrabber is a helper object that makes it very easy to construct instances of NSInvocation for later use. The object is inspired by NSUndoManager's prepareWithInvocationTarget method. To use a DDInvocationGrabber object, you set its target to some object, then send it a message as if it were the target object (the DDInvocationGrabber object acts as a proxy), if the target message understands the message the DDInvocationGrabber object stores the message invocation. + + DDInvocationGrabber *theGrabber = [DDInvocationGrabber invocationGrabber]; + [theGrabber setTarget:someObject] + [theGrabber doSomethingWithParameter:someParameter]; // Send messages to 'theGrabber' as if it were 'someObject' + NSInvocation *theInvocation = [theGrabber invocation]; + + A slightly more concise version (using the covenience category) follows: + + DDInvocationGrabber *theGrabber = [DDInvocationGrabber invocationGrabber]; + [[theGrabber prepareWithInvocationTarget:someObject] doSomethingWithParameter:someParameter]; + NSInvocation *theInvocation = [theGrabber invocation]; + + */ +@interface DDInvocationGrabber : NSProxy +{ + id _target; + NSInvocation * _invocation; + BOOL _forwardInvokesOnMainThread; + BOOL _waitUntilDone; +} + +/* + * @method invocationGrabber + * @abstract Returns a newly allocated, inited, autoreleased DDInvocationGrabber object. + */ ++ (id)invocationGrabber; + +- (id)target; +- (void)setTarget:(id)inTarget; + +- (NSInvocation *)invocation; +- (void)setInvocation:(NSInvocation *)inInvocation; + +- (BOOL)forwardInvokesOnMainThread; +- (void)setForwardInvokesOnMainThread:(BOOL)forwardInvokesOnMainThread; + +- (BOOL)waitUntilDone; +- (void)setWaitUntilDone:(BOOL)waitUntilDone; + +@end + +@interface DDInvocationGrabber (DDInvocationGrabber_Conveniences) + +/* + * @method prepareWithInvocationTarget: + * @abstract Sets the target object of the receiver and returns itself. The sender can then send a message to the + */ +- (id)prepareWithInvocationTarget:(id)inTarget; + +@end diff --git a/libircclient/cocoa/Classes/DDInvocationGrabber.m b/libircclient/cocoa/Classes/DDInvocationGrabber.m new file mode 100644 index 0000000..a6dbf37 --- /dev/null +++ b/libircclient/cocoa/Classes/DDInvocationGrabber.m @@ -0,0 +1,171 @@ +/* + * Copyright (c) 2007-2008 Dave Dribin + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, copy, + * modify, merge, publish, distribute, sublicense, and/or sell copies + * of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS + * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + + +/* + * This class is based on CInvocationGrabber: + * + * Copyright (c) 2007, Toxic Software + * All rights reserved. + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * * Neither the name of the Toxic Software nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF + * THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#import "DDInvocationGrabber.h" + + +@implementation DDInvocationGrabber + ++ (id)invocationGrabber +{ + return([[[self alloc] init] autorelease]); +} + +- (id)init +{ + _target = nil; + _invocation = nil; + _forwardInvokesOnMainThread = NO; + _waitUntilDone = NO; + + return self; +} + +- (void)dealloc +{ + [self setTarget:NULL]; + [self setInvocation:NULL]; + // + [super dealloc]; +} + +#pragma mark - + +- (id)target +{ + return _target; +} + +- (void)setTarget:(id)inTarget +{ + if (_target != inTarget) + { + [_target autorelease]; + _target = [inTarget retain]; + } +} + +- (NSInvocation *)invocation +{ + return _invocation; +} + +- (void)setInvocation:(NSInvocation *)inInvocation +{ + if (_invocation != inInvocation) + { + [_invocation autorelease]; + _invocation = [inInvocation retain]; + } +} + +- (BOOL)forwardInvokesOnMainThread; +{ + return _forwardInvokesOnMainThread; +} + +- (void)setForwardInvokesOnMainThread:(BOOL)forwardInvokesOnMainThread; +{ + _forwardInvokesOnMainThread = forwardInvokesOnMainThread; +} + +- (BOOL)waitUntilDone; +{ + return _waitUntilDone; +} + +- (void)setWaitUntilDone:(BOOL)waitUntilDone; +{ + _waitUntilDone = waitUntilDone; +} + +#pragma mark - + +- (NSMethodSignature *)methodSignatureForSelector:(SEL)selector +{ + return [[self target] methodSignatureForSelector:selector]; +} + +- (void)forwardInvocation:(NSInvocation *)ioInvocation +{ + [ioInvocation setTarget:[self target]]; + [self setInvocation:ioInvocation]; + if (_forwardInvokesOnMainThread) + { + if (!_waitUntilDone) + [_invocation retainArguments]; + [_invocation performSelectorOnMainThread:@selector(invoke) + withObject:nil + waitUntilDone:_waitUntilDone]; + } +} + +@end + +#pragma mark - + +@implementation DDInvocationGrabber (DDnvocationGrabber_Conveniences) + +- (id)prepareWithInvocationTarget:(id)inTarget +{ + [self setTarget:inTarget]; + return(self); +} + +@end diff --git a/libircclient/cocoa/Classes/IRCClientChannel.h b/libircclient/cocoa/Classes/IRCClientChannel.h new file mode 100644 index 0000000..b5a044b --- /dev/null +++ b/libircclient/cocoa/Classes/IRCClientChannel.h @@ -0,0 +1,153 @@ +/* + * Copyright (C) 2009 Nathan Ollerenshaw chrome@stupendous.net + * + * This library is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This library 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 Lesser General Public + * License for more details. + */ + +/** + * @file IRCClientChannel.h + * @author Nathan Ollerenshaw + * @version 1.0 + * @date 01.2009 + * @brief Represents a connected IRC Channel. + */ + +#import +#import + +/** \class IRCClientChannel + * @brief Represents a connected IRC Channel. + * + * IRCClientChannel objects are created by the IRCClientSession object + * for a given session when the client joins an IRC channel. At that time + * you are expected to register event handlers for each of the delegate + * methods described in the IRCClientChannelDelegate interface. + */ + +@class IRCClientSession; +@interface IRCClientChannel : NSObject { + id delegate; + NSString *name; + NSStringEncoding encoding; + IRCClientSession *session; + NSString *topic; + NSString *modes; + NSMutableArray *names; +} + +/** Delegate to send events to */ +@property (assign) id delegate; + +/** Name of the channel */ +@property (copy) NSString *name; + +/** Encoding used by this channel */ +@property (assign) NSStringEncoding encoding; + +/** Associated IRCClientSession object */ +@property (assign) IRCClientSession *session; + +/** Topic of the channel */ +@property (copy) NSString *topic; + +/** Mode of the channel */ +@property (copy) NSString *modes; + +/** An array of nicknames stored as NSStrings that list the connected users + for the channel */ +@property (assign, readonly) NSMutableArray *names; + +/** initWithName: + * + * Returns an initialised IRCClientChannel with a given channel name. You + * are not expected to initialise your own IRCClientChannel objects; if you + * wish to join a channel you should send a [IRCClientSession join:key:] message + * to your IRCClientSession object. + * + * @param aName Name of the channel. + */ + +- (id)initWithName:(NSString *)aName; + +/** Parts the channel. + */ + +- (int)part; + +/** Invites another IRC client to the channel. + * + * @param nick the nickname of the client to invite. + */ + +- (int)invite:(NSString *)nick; + +/** Sets the topic of the channel. + * + * Note that not all users on a channel have permission to change the topic; if you fail + * to set the topic, then you will not see an onTopic event on the IRCClientChannelDelegate. + * + * @param aTopic the topic the client wishes to set for the channel. + */ + +- (void)setTopic:(NSString *)aTopic; + +/** Sets the mode of the channel. + * + * Note that not all users on a channel have permission to change the mode; if you fail + * to set the mode, then you will not see an onMode event on the IRCClientChannelDelegate. + * + * @param mode the mode to set the channel to + * @param params paramaters for the mode, if it requires parameters. + */ + +- (int)setMode:(NSString *)mode params:(NSString *)params; + +/** Sends a public PRIVMSG to the channel. If you try to send more than can fit on an IRC + * buffer, it will be truncated. + * + * @param message the message to send to the channel. + */ + +- (int)message:(NSString *)message; + +/** Sends a public CTCP ACTION to the channel. + * + * @param action action to send to the channel. + */ + +- (int)action:(NSString *)action; + +/** Sends a public NOTICE to the channel. + * + * @param notice message to send to the channel. + */ + +- (int)notice:(NSString *)notice; + +/** Kicks someone from a channel. + * + * @param nick the IRC client to kick from the channel. + * @param reason the message to give to the channel and the IRC client for the kick. + */ + +- (int)kick:(NSString *)nick reason:(NSString *)reason; + +/** Sends a CTCP request to the channel. + * + * It is perfectly legal to send a CTCP request to an IRC channel, however many clients + * decline to respond to them, and often they are percieved as annoying. + * + * @param request the string of the request, in CTCP format. + */ + +- (int)ctcpRequest:(NSString *)request; + +@end diff --git a/libircclient/cocoa/Classes/IRCClientChannel.m b/libircclient/cocoa/Classes/IRCClientChannel.m new file mode 100644 index 0000000..3aab87c --- /dev/null +++ b/libircclient/cocoa/Classes/IRCClientChannel.m @@ -0,0 +1,157 @@ +/* + * Copyright (C) 2009 Nathan Ollerenshaw chrome@stupendous.net + * + * This library is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This library 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 Lesser General Public + * License for more details. + */ + +#import "IRCClientChannel.h" +#import "IRCClientSession.h" +#import "NSObject+DDExtensions.h" + +@implementation IRCClientChannel + +@synthesize delegate; +@synthesize name; +@synthesize encoding; +@synthesize session; +@synthesize topic; +@synthesize modes; +@synthesize names; + +-(id)init +{ + return [self initWithName:nil]; +} + +-(id)initWithName:(NSString *)aName +{ + if ((self = [super init])) { + [self setName:aName]; + topic = [[NSString alloc] init]; + encoding = NSASCIIStringEncoding; + } + + return self; +} + +-(void)dealloc +{ + [super dealloc]; +} + +- (int)part +{ + return irc_cmd_part([session session], [name cStringUsingEncoding:NSASCIIStringEncoding]); +} + +- (int)invite:(NSString *)nick +{ + return irc_cmd_invite([session session], [nick cStringUsingEncoding:NSASCIIStringEncoding], [name cStringUsingEncoding:NSASCIIStringEncoding]); +} + +- (int)refreshNames +{ + return irc_cmd_names([session session], [name cStringUsingEncoding:NSASCIIStringEncoding]); +} + +- (void)setTopic:(NSString *)aTopic +{ + irc_cmd_topic([session session], [name cStringUsingEncoding:NSASCIIStringEncoding], [topic cStringUsingEncoding:encoding]); +} + +- (int)setMode:(NSString *)mode params:(NSString *)params +{ + return irc_cmd_channel_mode([session session], [name cStringUsingEncoding:NSASCIIStringEncoding], [mode cStringUsingEncoding:NSASCIIStringEncoding]); +} + +- (int)message:(NSString *)message +{ + return irc_cmd_msg([session session], [name cStringUsingEncoding:NSASCIIStringEncoding], [message cStringUsingEncoding:encoding]); +} + +- (int)action:(NSString *)action +{ + return irc_cmd_me([session session], [name cStringUsingEncoding:NSASCIIStringEncoding], [action cStringUsingEncoding:encoding]); +} + +- (int)notice:(NSString *)notice +{ + return irc_cmd_notice([session session], [name cStringUsingEncoding:NSASCIIStringEncoding], [notice cStringUsingEncoding:encoding]); +} + +- (int)kick:(NSString *)nick reason:(NSString *)reason +{ + return irc_cmd_kick([session session], [nick cStringUsingEncoding:NSASCIIStringEncoding], [name cStringUsingEncoding:NSASCIIStringEncoding], [reason cStringUsingEncoding:encoding]); +} + +- (int)ctcpRequest:(NSString *)request +{ + return irc_cmd_ctcp_request([session session], [name cStringUsingEncoding:NSASCIIStringEncoding], [request cStringUsingEncoding:encoding]); +} + + +// event handlers +// +// These farm events out to the delegate on the main thread. + +- (void)onJoin:(NSString *)nick +{ + if ([delegate respondsToSelector:@selector(onJoin:)]) + [[delegate dd_invokeOnMainThread] onJoin:nick]; +} + +- (void)onPart:(NSString *)nick reason:(NSString *)reason +{ + if ([delegate respondsToSelector:@selector(onPart:reason:)]) + [[delegate dd_invokeOnMainThread] onPart:nick reason:reason]; +} + +- (void)onMode:(NSString *)mode params:(NSString *)params nick:(NSString *)nick +{ + if ([delegate respondsToSelector:@selector(onMode:params:nick:)]) + [[delegate dd_invokeOnMainThread] onMode:mode params:params nick:nick]; +} + +- (void)onTopic:(NSString *)aTopic nick:(NSString *)nick +{ + [topic release]; + topic = [NSString stringWithString:aTopic]; + + if ([delegate respondsToSelector:@selector(onTopic:nick:)]) + [[delegate dd_invokeOnMainThread] onTopic:aTopic nick:nick]; +} + +- (void)onKick:(NSString *)nick reason:(NSString *)reason byNick:(NSString *)byNick +{ + if ([delegate respondsToSelector:@selector(onKick:reason:byNick:)]) + [[delegate dd_invokeOnMainThread] onKick:nick reason:reason byNick:byNick]; +} + +- (void)onPrivmsg:(NSString *)message nick:(NSString *)nick +{ + if ([delegate respondsToSelector:@selector(onPrivmsg:nick:)]) + [[delegate dd_invokeOnMainThread] onPrivmsg:message nick:nick]; +} + +- (void)onNotice:(NSString *)notice nick:(NSString *)nick +{ + if ([delegate respondsToSelector:@selector(onNotice:nick:)]) + [[delegate dd_invokeOnMainThread] onNotice:notice nick:nick]; +} + +- (void)onAction:(NSString *)action nick:(NSString *)nick +{ + if ([delegate respondsToSelector:@selector(onAction:nick:)]) + [[delegate dd_invokeOnMainThread] onAction:action nick:nick]; +} + + +@end diff --git a/libircclient/cocoa/Classes/IRCClientChannelDelegate.h b/libircclient/cocoa/Classes/IRCClientChannelDelegate.h new file mode 100644 index 0000000..8b70493 --- /dev/null +++ b/libircclient/cocoa/Classes/IRCClientChannelDelegate.h @@ -0,0 +1,116 @@ +/* + * Copyright (C) 2009 Nathan Ollerenshaw chrome@stupendous.net + * + * This library is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This library 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 Lesser General Public + * License for more details. + */ + +/** + * @file IRCClientChannelDelegate.h + * @author Nathan Ollerenshaw + * @version 1.0 + * @date 01.2009 + * @brief Receives delegate messages from an IRCClientChannel. + * @protocol IRCClientChannelDelegate + */ + +#import + +/** @brief Receives delegate messages from an IRCClientChannel. + * + * Each IRCClientChannel object needs a delegate. Delegate methods are called + * for each event that occurs on an IRC channel that the client is current on. + * + * Note that for any given parameter, it may be optional, in which case a nil + * object may be supplied instead of the given parameter. + */ + +@interface NSObject (IRCClientChannelDelegate) + +/** When a client joins this channel, the onJoin event is fired. Note that + * the nickname is most likely in nick!user\@host format, but may simply be a + * nickname, depending on the server implementation. + * + * You should also expect to see this event when the client first joins a channel, + * with a parameter of the client's nickname. + * + * @param nick The nickname of the user that joined the channel. + */ + +- (void)onJoin:(NSString *)nick; + +/** When an IRC client parts a channel you are connect to, you will see + * an onPart event. You will also see this event when you part a channel. + * + * @param nick (required) The nickname of the user that left the channel. + * @param reason (optional) The reason, if any, that the user gave for leaving. + */ + +- (void)onPart:(NSString *)nick reason:(NSString *)reason; + +/** Received when an IRC client changes the channel mode. What modes are available + * for a given channel is an implementation detail for each server. + * + * @param mode the new channel mode. + * @param params any parameters with the mode (such as channel key). + * @param nick the nickname of the IRC client that changed the mode. + */ + +- (void)onMode:(NSString *)mode params:(NSString *)params nick:(NSString *)nick; + +/** Received when the topic is changed for the channel. + * + * @param aTopic The new topic of the channel. + * @param nick Nickname of the IRC client that changed the topic. + */ + +- (void)onTopic:(NSString *)aTopic nick:(NSString *)nick; + +/** Received when an IRC client is kicked from a channel. + * + * @param nick nickname of the client that was kicked + * @param reason reason message given for the kick + * @param byNick nickname of the client that performed the kick command + */ + +- (void)onKick:(NSString *)nick reason:(NSString *)reason byNick:(NSString *)byNick; + +/** Received when an IRC client sends a public PRIVMSG to the channel. Note that the + * user may not necessarily be required to be on the channel to send a message + * to it. + * + * @param message the message sent to the channel. + * @param nick the nickname of the IRC client that sent the message. + */ + +- (void)onPrivmsg:(NSString *)message nick:(NSString *)nick; + +/** Received when an IRC client sends a public NOTICE to the channel. Note that + * the user may not necessarily be required to be on the channel to send a notice to + * it. Furthermore, the RFC states that the only difference between PRIVMSG and + * NOTICE is that a NOTICE may never be responded to automatically. + * + * @param notice the notice sent to the channel. + * @param nick the nickname of the IRC client that sent the notice. + */ + +- (void)onNotice:(NSString *)notice nick:(NSString *)nick; + +/** Received when an IRC client sends a CTCP ACTION message to the channel. + * used by lamers with no life to pretend that they are playing some form of + * MMORPG. + * + * @param action the action message sent to the channel. + * @param nick the nickname of the IRC client that sent the message. + */ + +- (void)onAction:(NSString *)action nick:(NSString *)nick; + +@end diff --git a/libircclient/cocoa/Classes/IRCClientSession.h b/libircclient/cocoa/Classes/IRCClientSession.h new file mode 100644 index 0000000..035fdb2 --- /dev/null +++ b/libircclient/cocoa/Classes/IRCClientSession.h @@ -0,0 +1,264 @@ +/*! \mainpage IRCClient - a Cocoa IRC Framework to create IRC clients + * + * \section intro_sec Introduction + * + * IRCClient is a Cocoa Framework that uses the excellent libircclient library + * written by Georgy Yunaev. + * + * \section usage Basic Usage + * + * To use this framework, you will need to write an IRCClientSessionDelegate to + * handle all of the events generated by the server, and an IRCClientChannelDelegate + * to handle all of the events generated by channels on that server. + * + * You then create an IRCClientSession object in your code, assign the required + * properties, and call connect: to connect to the server and run: to create + * the new thread and start receiving events. For example: + * + * \code + * IRCClientSession *session = [[IRCClientSession alloc] init]; + * MyIRCClientSessionDelegate *controller = [[MyIRCClientSessionDelegate alloc] init]; + * + * [session setDelegate:controller]; + * [controller setSession:session]; + * + * [session setServer:@"irc.dal.net"]; + * [session setPort:@"6667"]; + * [session setNickname:@"test"]; + * [session setUsername:@"test"]; + * [session setRealname:@"test"]; + * [session connect]; + * + * [session run]; //starts the thread + * \endcode + * + * \section author Author, copyright, support. + * + * If you have any questions, bug reports, suggestions regarding libircclient + * or the IRCClient framework, please visit http://libircclient.sourceforge.net + * + *
+ * libircclient Copyright (C) 2004-2009 Georgy Yunaev gyunaev@ulduzsoft.com
+ * IRCClient Copyright (C) 2009 Nathan Ollerenshaw chrome@stupendous.net
+ *
+ * This library is free software; you can redistribute it and/or modify it 
+ * under the terms of the GNU Lesser General Public License as published by 
+ * the Free Software Foundation; either version 2 of the License, or (at your 
+ * option) any later version.
+ *
+ * This library 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 Lesser General Public 
+ * License for more details.
+ * 
+ */ + +/** + * @file IRCClientSession.h + * @author Nathan Ollerenshaw + * @version 1.0 + * @date 01.2009 + * @brief Represents a connected IRC Session. + */ + +#import +#import +#include + +/** @class IRCClientSession + * @brief Represents a connected IRC Session. + * + * IRCClientSession represents a single connection to an IRC server. On initialising + * the object, and setting the delegate, server, port, password, nickname, username and realname + * properties, you call the connect: and run: methods to connect to the IRC server + * and start a new thread. + * + * This thread then sends messages back to the main runloop to the IRC server delegate, + * or to the IRCClientChannel delegate as required. + */ + +@class IRCClientChannel; +@interface IRCClientSession : NSObject { + id delegate; + irc_callbacks_t callbacks; + irc_session_t *session; + NSThread *thread; + + NSString *version; + NSString *server; + NSString *port; + NSString *password; + + NSString *nickname; + NSString *username; + NSString *realname; + + NSMutableDictionary *channels; + NSMutableDictionary *nicks; + NSStringEncoding encoding; +} + +/** delegate to send events to. */ +@property (assign) id delegate; + +/** The underlying libircclient handle */ +@property (assign) irc_session_t *session; + +/** The version string for the client to send back on CTCP VERSION requests */ +@property (copy) NSString *version; + +/** IRC server to connect to */ +@property (copy) NSString *server; + +/** IRC port to connect to */ +@property (copy) NSString *port; + +/** Server password to provide on connect (may be left empty or nil) */ +@property (copy) NSString *password; + +/** Nickname of the connected client. Note that setting this after connection will + not result in the client renaming on IRC. You need to send a nick: message instead. + */ +@property (copy) NSString *nickname; + +/** Username of the connected client. Also known as the ident. + + Setting this after connection does nothing. + */ +@property (copy) NSString *username; + +/** Realname of the connected client. + + Setting this after connection does nothing. */ +@property (copy) NSString *realname; + +/** An NSMutableDictionary of channels that the client is currently connected to. + + You should not modify this. */ +@property (assign,readonly) NSMutableDictionary *channels; + +/** The default text encoding for messages on this server. + + This affects messages received via PRIVMSG and NOTICE, and TOPIC in a channel. + You may change this at any time. + */ + +@property (assign) NSStringEncoding encoding; + +/** Connect to the IRC server. + + Note that this performs the initial DNS lookup and the TCP connection, so if + there are any problems you will be notified via the return code of the message. + + Look at the libircclient documentation for the different return codes. */ + +- (int)connect; + +/** Disconnect from the IRC server. + + This always works, as it simply shuts down the socket. If you want to disconnect + in a friendly way, you should use the quit: message. */ + +- (void)disconnect; + +/** returns YES if the server is currently connected successfully, and NO if + it is not. */ + +- (bool)isConnected; + +/** Starts a new thread and starts the libircclient runloop, processing events and + firing messages back to the main runloop as required. Calling this again will + do nothing other than raise a warning in your logs. */ + +- (void)run; + +/** Sends a raw message to the IRC server. Please consult rfc1459 for the format + of IRC commands. */ + +- (int)sendRawWithFormat:(NSString *)format, ...; + +/** quits the IRC server with the given reason. On success, an onQuit event will be + sent to the IRCClientSessionDelegate with the nickname of the IRC client. + + The format is a standard NSString format string, followed by optional arguments. + */ + +- (int)quit:(NSString *)reason; + +/** Joins a channel with a given name and key + + @param channel the channel to join + @param key they key for the channel (may be nil) + */ + +- (int)join:(NSString *)channel key:(NSString *)key; + +/** lists channels on the IRC server. + + @param channel a channel name or string to pass to the LIST command. Implementation specific. + */ + +- (int)list:(NSString *)channel; + +/** sets the user mode for the IRC client + + @param mode string to set + */ + +- (int)userMode:(NSString *)mode; + +/** sets the IRC client nickname. On success, an onNick event will be sent to the delegate + + @param newnick new nickname to set. + */ + +- (int)nick:(NSString *)newnick; + +/** sends a WHOIS request to the IRC server + + @param nick nickname of the irc client to whois. +*/ + +- (int)whois:(NSString *)nick; + +/** send a PRIVMSG to another IRC client + + @param message message to send + @param target the other IRC client to send the message to. + */ + +- (int)message:(NSString *)message to:(NSString *)target; + +/** send a CTCP ACTION to another IRC client + + @param action the action message to send + @param target the nickname of the irc client to send the message to. + */ + +- (int)action:(NSString *)action to:(NSString *)target; + +/** send a NOTICE to another IRC client + + @param notice the message text to send + @param target the nickname of the irc client to send the notice to. + */ + +- (int)notice:(NSString *)notice to:(NSString *)target; + +/** send a CTCP request to another IRC client + + @param request the CTCP request string to send + @param target the nickname of the IRC client to send the request to. + */ + +- (int)ctcpRequest:(NSString *)request target:(NSString *)target; + +/** send a CTCP reply to another IRC client + + @param reply the CTCP reply string to send + @param target the nickname of the IRC client to send the reply to. + */ + +- (int)ctcpReply:(NSString *)reply target:(NSString *)target; + +@end diff --git a/libircclient/cocoa/Classes/IRCClientSession.m b/libircclient/cocoa/Classes/IRCClientSession.m new file mode 100644 index 0000000..89a1d9a --- /dev/null +++ b/libircclient/cocoa/Classes/IRCClientSession.m @@ -0,0 +1,744 @@ +/* + * Copyright (C) 2009 Nathan Ollerenshaw chrome@stupendous.net + * + * This library is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This library 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 Lesser General Public + * License for more details. + */ + +#define IRCCLIENTVERSION "1.0" + +#import "IRCClientSession.h" +#import "NSObject+DDExtensions.h" +#import "IRCClientChannel.h" +#include "string.h" + +static void onConnect(irc_session_t *session, const char *event, const char *origin, const char **params, unsigned int count); +static void onNick(irc_session_t *session, const char *event, const char *origin, const char **params, unsigned int count); +static void onQuit(irc_session_t *session, const char *event, const char *origin, const char **params, unsigned int count); +static void onJoinChannel(irc_session_t *session, const char *event, const char *origin, const char **params, unsigned int count); +static void onPartChannel(irc_session_t *session, const char *event, const char *origin, const char **params, unsigned int count); +static void onMode(irc_session_t *session, const char *event, const char *origin, const char **params, unsigned int count); +static void onUserMode(irc_session_t *session, const char *event, const char *origin, const char **params, unsigned int count); +static void onTopic(irc_session_t *session, const char *event, const char *origin, const char **params, unsigned int count); +static void onKick(irc_session_t *session, const char *event, const char *origin, const char **params, unsigned int count); +static void onChannelPrvmsg(irc_session_t *session, const char *event, const char *origin, const char **params, unsigned int count); +static void onPrivmsg(irc_session_t *session, const char *event, const char *origin, const char **params, unsigned int count); +static void onNotice(irc_session_t *session, const char *event, const char *origin, const char **params, unsigned int count); +static void onInvite(irc_session_t *session, const char *event, const char *origin, const char **params, unsigned int count); +static void onCtcpRequest(irc_session_t *session, const char *event, const char *origin, const char **params, unsigned int count); +static void onCtcpReply(irc_session_t *session, const char *event, const char *origin, const char **params, unsigned int count); +static void onCtcpAction(irc_session_t *session, const char *event, const char *origin, const char **params, unsigned int count); +static void onUnknownEvent(irc_session_t *session, const char *event, const char *origin, const char **params, unsigned int count); +static void onNumericEvent(irc_session_t * session, unsigned int event, const char * origin, const char ** params, unsigned int count); + +@implementation IRCClientSession + +@synthesize delegate; +@synthesize session; +@synthesize version; +@synthesize server; +@synthesize port; +@synthesize password; +@synthesize nickname; +@synthesize username; +@synthesize realname; +@synthesize channels; +@synthesize encoding; + +-(id)init +{ + if ((self = [super init])) { + callbacks.event_connect = onConnect; + callbacks.event_nick = onNick; + callbacks.event_quit = onQuit; + callbacks.event_join = onJoinChannel; + callbacks.event_part = onPartChannel; + callbacks.event_mode = onMode; + callbacks.event_umode = onUserMode; + callbacks.event_topic = onTopic; + callbacks.event_kick = onKick; + callbacks.event_channel = onChannelPrvmsg; + callbacks.event_privmsg = onPrivmsg; + callbacks.event_notice = onNotice; + callbacks.event_invite = onInvite; + callbacks.event_ctcp_req = onCtcpRequest; + callbacks.event_ctcp_rep = onCtcpReply; + callbacks.event_ctcp_action = onCtcpAction; + callbacks.event_unknown = onUnknownEvent; + callbacks.event_numeric = onNumericEvent; + callbacks.event_dcc_chat_req = NULL; + callbacks.event_dcc_send_req = NULL; + + session = irc_create_session(&callbacks); + + if (!session) { + NSLog(@"Could not create irc_session."); + return nil; + } + + irc_set_ctx(session, self); + + unsigned int high, low; + irc_get_version (&high, &low); + + [self setVersion:[NSString stringWithFormat:@"IRCClient Framework v%s (Nathan Ollerenshaw) - libirc v%d.%d (Georgy Yunaev)", IRCCLIENTVERSION, high, low]]; + + channels = [[[NSMutableDictionary alloc] init] retain]; + encoding = NSASCIIStringEncoding; + } + return self; +} + +-(void)dealloc +{ + if (irc_is_connected(session)) + NSLog(@"Warning: IRC Session is not disconnected on dealloc"); + + irc_destroy_session(session); + + [channels release]; + + [super dealloc]; +} + +- (int)connect; +{ + unsigned short sPort = [port intValue]; + + return irc_connect(session, [server cStringUsingEncoding:encoding], sPort, [password length] > 0 ? [password cStringUsingEncoding:encoding] : NULL , [nickname cStringUsingEncoding:encoding], [username cStringUsingEncoding:encoding], [realname cStringUsingEncoding:encoding]); +} + +- (void)disconnect +{ + irc_disconnect(session); +} + +- (bool)isConnected +{ + return irc_is_connected(session); +} + +- (void)startThread +{ + NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; + + irc_run(session); + + [pool drain]; +} + +- (void)run +{ + if (thread) { + NSLog(@"Thread already running!"); + return; + } + + thread = [[NSThread alloc] initWithTarget:self selector:@selector(startThread) object:nil]; + [thread retain]; + [thread start]; +} + +- (int)sendRawWithFormat:(NSString *)format, ... +{ + va_list ap; + + va_start(ap, format); + NSString *line = [[NSString alloc] initWithFormat:format arguments:ap]; + va_end(ap); + + return irc_send_raw(session, [line cStringUsingEncoding:encoding]); +} + +- (int)quit:(NSString *)reason +{ + return irc_cmd_quit(session, [reason cStringUsingEncoding:encoding]); +} + +- (int)join:(NSString *)channel key:(NSString *)key +{ + NSLog(@"Joining %@", channel); + + if (!key || ![key length] > 0) + return irc_cmd_join(session, [channel cStringUsingEncoding:encoding], NULL); + + return irc_cmd_join(session, [channel cStringUsingEncoding:encoding], [key cStringUsingEncoding:encoding]); +} + +- (int)list:(NSString *)channel +{ + return irc_cmd_list(session, [channel cStringUsingEncoding:encoding]); +} + +- (int)userMode:(NSString *)mode +{ + return irc_cmd_user_mode(session, [mode cStringUsingEncoding:encoding]); +} + +- (int)nick:(NSString *)newnick +{ + return irc_cmd_nick(session, [newnick cStringUsingEncoding:encoding]); +} + +- (int)whois:(NSString *)nick +{ + return irc_cmd_whois(session, [nick cStringUsingEncoding:encoding]); +} + +- (int)message:(NSString *)message to:(NSString *)target +{ + return irc_cmd_msg(session, [target cStringUsingEncoding:encoding], [message cStringUsingEncoding:encoding]); +} + +- (int)action:(NSString *)action to:(NSString *)target +{ + return irc_cmd_me(session, [target cStringUsingEncoding:encoding], [action cStringUsingEncoding:encoding]); +} + +- (int)notice:(NSString *)notice to:(NSString *)target +{ + return irc_cmd_notice(session, [target cStringUsingEncoding:encoding], [notice cStringUsingEncoding:encoding]); +} + +- (int)ctcpRequest:(NSString *)request target:(NSString *)target +{ + return irc_cmd_ctcp_request(session, [target cStringUsingEncoding:encoding], [request cStringUsingEncoding:encoding]); +} + +- (int)ctcpReply:(NSString *)reply target:(NSString *)target +{ + return irc_cmd_ctcp_reply(session, [target cStringUsingEncoding:encoding], [reply cStringUsingEncoding:encoding]); +} + + + +@end + +NSString * +getNickFromNickUserHost(NSString *nuh) +{ + NSArray *nuhArray = [nuh componentsSeparatedByCharactersInSet:[NSCharacterSet characterSetWithCharactersInString:@"!@"]]; + + if ([nuhArray count] == 3) + return [NSString stringWithString:[nuhArray objectAtIndex:0]]; + else + return [NSString stringWithString:nuh]; +} + +NSString * +getUserFromNickUserHost(NSString *nuh) +{ + NSArray *nuhArray = [nuh componentsSeparatedByCharactersInSet:[NSCharacterSet characterSetWithCharactersInString:@"!@"]]; + + if ([nuhArray count] == 3) + return [NSString stringWithString:[nuhArray objectAtIndex:1]]; + else + return nil; +} + +NSString * +getHostFromNickUserHost(NSString *nuh) +{ + NSArray *nuhArray = [nuh componentsSeparatedByCharactersInSet:[NSCharacterSet characterSetWithCharactersInString:@"!@"]]; + + if ([nuhArray count] == 3) + return [NSString stringWithString:[nuhArray objectAtIndex:2]]; + else + return nil; +} + +/*! + * The "on_connect" event is triggered when the client successfully + * connects to the server, and could send commands to the server. + * No extra params supplied; \a params is 0. + */ +static void onConnect(irc_session_t *session, const char *event, const char *origin, const char **params, unsigned int count) +{ + IRCClientSession *client = (IRCClientSession *) irc_get_ctx(session); + + if ([[client delegate] respondsToSelector:@selector(onConnect)]) + [[[client delegate] dd_invokeOnMainThread] onConnect]; +} + +/*! + * The "nick" event is triggered when the client receives a NICK message, + * meaning that someone (including you) on a channel with the client has + * changed their nickname. + * + * \param origin the person, who changes the nick. Note that it can be you! + * \param params[0] mandatory, contains the new nick. + */ +static void onNick(irc_session_t *session, const char *event, const char *origin, const char **params, unsigned int count) +{ + IRCClientSession *client = (IRCClientSession *) irc_get_ctx(session); + + NSString *nick = [NSString stringWithCString:params[0] encoding:NSASCIIStringEncoding]; + NSString *oldNick = [NSString stringWithCString:origin encoding:NSASCIIStringEncoding]; + + if ([[client nickname] compare:oldNick] == NSOrderedSame) { + [client setNickname:nick]; + } + + if ([[client delegate] respondsToSelector:@selector(onNick:oldNick:)]) + [[[client delegate] dd_invokeOnMainThread] onNick:nick oldNick:oldNick]; +} + +/*! + * The "quit" event is triggered upon receipt of a QUIT message, which + * means that someone on a channel with the client has disconnected. + * + * \param origin the person, who is disconnected + * \param params[0] optional, contains the reason message (user-specified). + */ +static void onQuit(irc_session_t *session, const char *event, const char *origin, const char **params, unsigned int count) +{ + IRCClientSession *client = (IRCClientSession *) irc_get_ctx(session); + + NSString *nick = [NSString stringWithCString:origin encoding:NSASCIIStringEncoding]; + NSString *reason = [NSString stringWithCString:params[0] encoding:[client encoding]]; + + if ([[client delegate] respondsToSelector:@selector(onQuit:reason:)]) + [[[client delegate] dd_invokeOnMainThread] onQuit:nick reason:reason]; +} + +/*! + * The "join" event is triggered upon receipt of a JOIN message, which + * means that someone has entered a channel that the client is on. + * + * \param origin the person, who joins the channel. By comparing it with + * your own nickname, you can check whether your JOIN + * command succeed. + * \param params[0] mandatory, contains the channel name. + */ +static void onJoinChannel(irc_session_t *session, const char *event, const char *origin, const char **params, unsigned int count) +{ + IRCClientSession *client = (IRCClientSession *) irc_get_ctx(session); + NSString *nick = [NSString stringWithCString:origin encoding:NSASCIIStringEncoding]; + NSString *channel = [NSString stringWithCString:params[0] encoding:NSASCIIStringEncoding]; + + NSString *nickOnly = getNickFromNickUserHost(nick); + + if ([[client nickname] compare:nickOnly] == NSOrderedSame) { + // We just joined a channel; allocate an IRCClientChannel object and send it + // to the main thread. + + IRCClientChannel *newChannel = [[IRCClientChannel alloc] initWithName:channel]; + [[client channels] setObject:newChannel forKey:channel]; + + if ([[client delegate] respondsToSelector:@selector(onJoinChannel:)]) + [[[client delegate] dd_invokeOnMainThread] onJoinChannel:newChannel]; + } else { + // Someone joined a channel we're on. + + IRCClientChannel *currentChannel = [[client channels] objectForKey:channel]; + [currentChannel onJoin:nick]; + } +} + +/*! + * The "part" event is triggered upon receipt of a PART message, which + * means that someone has left a channel that the client is on. + * + * \param origin the person, who leaves the channel. By comparing it with + * your own nickname, you can check whether your PART + * command succeed. + * \param params[0] mandatory, contains the channel name. + * \param params[1] optional, contains the reason message (user-defined). + */ +static void onPartChannel(irc_session_t *session, const char *event, const char *origin, const char **params, unsigned int count) +{ + IRCClientSession *client = (IRCClientSession *) irc_get_ctx(session); + + NSString *nick = [NSString stringWithCString:origin encoding:NSASCIIStringEncoding]; + NSString *channel = [NSString stringWithCString:params[0] encoding:NSASCIIStringEncoding]; + NSData *reason = nil; + IRCClientChannel *currentChannel = nil; + + if (count > 1) + reason = [NSData dataWithBytes:params[1] length:strlen(params[1])]; + + if ([[client nickname] compare:nick] == NSOrderedSame) { + // We just left a channel; remove it from the channels dict. + + currentChannel = [[client channels] objectForKey:channel]; + [[client channels] removeObjectForKey:channel]; + } else { + // Someone left a channel we're on. + + currentChannel = [[client channels] objectForKey:channel]; + } + + [currentChannel onPart:nick reason:[[NSString alloc] initWithData:reason encoding:[currentChannel encoding]]]; +} + +/*! + * The "mode" event is triggered upon receipt of a channel MODE message, + * which means that someone on a channel with the client has changed the + * channel's parameters. + * + * \param origin the person, who changed the channel mode. + * \param params[0] mandatory, contains the channel name. + * \param params[1] mandatory, contains the changed channel mode, like + * '+t', '-i' and so on. + * \param params[2] optional, contains the mode argument (for example, a + * key for +k mode, or user who got the channel operator status for + * +o mode) + */ +static void onMode(irc_session_t *session, const char *event, const char *origin, const char **params, unsigned int count) +{ + IRCClientSession *client = (IRCClientSession *) irc_get_ctx(session); + NSString *nick = [NSString stringWithCString:origin encoding:NSASCIIStringEncoding]; + NSString *channel = [NSString stringWithCString:params[0] encoding:NSASCIIStringEncoding]; + NSString *mode = [NSString stringWithCString:params[1] encoding:NSASCIIStringEncoding]; + NSString *modeParams = nil; + + if (count > 2) + modeParams = [NSString stringWithCString:params[2] encoding:NSASCIIStringEncoding]; + + IRCClientChannel *currentChannel = [[client channels] objectForKey:channel]; + + [currentChannel onMode:mode params:modeParams nick:nick]; +} + +/*! + * The "umode" event is triggered upon receipt of a user MODE message, + * which means that your user mode has been changed. + * + * \param origin the person, who changed the channel mode. + * \param params[0] mandatory, contains the user changed mode, like + * '+t', '-i' and so on. + */ +static void onUserMode(irc_session_t *session, const char *event, const char *origin, const char **params, unsigned int count) +{ + IRCClientSession *client = (IRCClientSession *) irc_get_ctx(session); + NSString *mode = [NSString stringWithCString:params[0] encoding:NSASCIIStringEncoding]; + + if ([[client delegate] respondsToSelector:@selector(onMode:)]) + [[[client delegate] dd_invokeOnMainThread] onMode:mode]; +} + +/*! + * The "topic" event is triggered upon receipt of a TOPIC message, which + * means that someone on a channel with the client has changed the + * channel's topic. + * + * \param origin the person, who changes the channel topic. + * \param params[0] mandatory, contains the channel name. + * \param params[1] optional, contains the new topic. + */ +static void onTopic(irc_session_t *session, const char *event, const char *origin, const char **params, unsigned int count) +{ + IRCClientSession *client = (IRCClientSession *) irc_get_ctx(session); + NSString *nick = [NSString stringWithCString:origin encoding:NSASCIIStringEncoding]; + NSString *channel = [NSString stringWithCString:params[0] encoding:NSASCIIStringEncoding]; + NSData *topic = nil; + + if (count > 1) + topic = [NSData dataWithBytes:params[1] length:strlen(params[1])]; + + IRCClientChannel *currentChannel = [[client channels] objectForKey:channel]; + + [currentChannel onTopic:[[NSString alloc] initWithData:topic encoding:[currentChannel encoding]] nick:nick]; +} + +/*! + * The "kick" event is triggered upon receipt of a KICK message, which + * means that someone on a channel with the client (or possibly the + * client itself!) has been forcibly ejected. + * + * \param origin the person, who kicked the poor. + * \param params[0] mandatory, contains the channel name. + * \param params[1] optional, contains the nick of kicked person. + * \param params[2] optional, contains the kick text + */ +static void onKick(irc_session_t *session, const char *event, const char *origin, const char **params, unsigned int count) +{ + IRCClientSession *client = (IRCClientSession *) irc_get_ctx(session); + NSString *byNick = [NSString stringWithCString:origin encoding:NSASCIIStringEncoding]; + NSString *channel = [NSString stringWithCString:params[0] encoding:NSASCIIStringEncoding]; + NSString *nick = nil; + NSData *reason = nil; + + if (count > 1) + nick = [NSString stringWithCString:params[1] encoding:NSASCIIStringEncoding]; + + if (count > 2) + reason = [NSData dataWithBytes:params[2] length:strlen(params[2])]; + + if (nick == nil) { + // we got kicked + IRCClientChannel *currentChannel = [[client channels] objectForKey:channel]; + [[client channels] removeObjectForKey:channel]; + + [currentChannel onKick:[client nickname] reason:[[NSString alloc] initWithData:reason encoding:[currentChannel encoding]] byNick:byNick]; + } else { + // someone else got booted + IRCClientChannel *currentChannel = [[client channels] objectForKey:channel]; + + [currentChannel onKick:nick reason:[[NSString alloc] initWithData:reason encoding:[currentChannel encoding]] byNick:byNick]; + } +} + +/*! + * The "channel" event is triggered upon receipt of a PRIVMSG message + * to an entire channel, which means that someone on a channel with + * the client has said something aloud. Your own messages don't trigger + * PRIVMSG event. + * + * \param origin the person, who generates the message. + * \param params[0] mandatory, contains the channel name. + * \param params[1] optional, contains the message text + */ +static void onChannelPrvmsg(irc_session_t *session, const char *event, const char *origin, const char **params, unsigned int count) +{ + IRCClientSession *client = (IRCClientSession *) irc_get_ctx(session); + NSString *nick = [NSString stringWithCString:origin encoding:NSASCIIStringEncoding]; + NSString *channel = [NSString stringWithCString:params[0] encoding:NSASCIIStringEncoding]; + NSData *message = nil; + + if (count > 1) { + message = [NSData dataWithBytes:params[1] length:strlen(params[1])]; + + IRCClientChannel *currentChannel = [[client channels] objectForKey:channel]; + + [currentChannel onPrivmsg:[[NSString alloc] initWithData:message encoding:[currentChannel encoding]] nick:nick]; + } +} + +/*! + * The "privmsg" event is triggered upon receipt of a PRIVMSG message + * which is addressed to one or more clients, which means that someone + * is sending the client a private message. + * + * \param origin the person, who generates the message. + * \param params[0] mandatory, contains your nick. + * \param params[1] optional, contains the message text + */ +static void onPrivmsg(irc_session_t *session, const char *event, const char *origin, const char **params, unsigned int count) +{ + IRCClientSession *client = (IRCClientSession *) irc_get_ctx(session); + NSString *nick = [NSString stringWithCString:origin encoding:NSASCIIStringEncoding]; + NSData *message = nil; + + if (count > 1) { + message = [NSData dataWithBytes:params[1] length:strlen(params[1])]; + + if ([[client delegate] respondsToSelector:@selector(onPrivmsg:nick:)]) + [[[client delegate] dd_invokeOnMainThread] onPrivmsg:message nick:nick]; + } + + // we eat privmsgs with no message +} + +/*! + * The "notice" event is triggered upon receipt of a NOTICE message + * which means that someone has sent the client a public or private + * notice. According to RFC 1459, the only difference between NOTICE + * and PRIVMSG is that you should NEVER automatically reply to NOTICE + * messages. Unfortunately, this rule is frequently violated by IRC + * servers itself - for example, NICKSERV messages require reply, and + * are NOTICEs. + * + * \param origin the person, who generates the message. + * \param params[0] mandatory, contains the channel name. + * \param params[1] optional, contains the message text + */ +static void onNotice(irc_session_t *session, const char *event, const char *origin, const char **params, unsigned int count) +{ + IRCClientSession *client = (IRCClientSession *) irc_get_ctx(session); + NSString *nick = [NSString stringWithCString:origin encoding:NSASCIIStringEncoding]; + NSString *target = [NSString stringWithCString:params[0] encoding:NSASCIIStringEncoding]; + NSData *notice = nil; + + IRCClientChannel *currentChannel = [[client channels] objectForKey:target]; + + if (count > 1) { + notice = [NSData dataWithBytes:params[1] length:strlen(params[1])]; + + if (currentChannel != nil) { + [currentChannel onNotice:[[NSString alloc] initWithData:notice encoding:[currentChannel encoding]] nick:nick]; + } else { + if ([[client delegate] respondsToSelector:@selector(onNotice:nick:)]) + [[[client delegate] dd_invokeOnMainThread] onNotice:notice nick:nick]; + } + } + + // we eat notices with no message +} + +/*! + * The "invite" event is triggered upon receipt of an INVITE message, + * which means that someone is permitting the client's entry into a +i + * channel. + * + * \param origin the person, who INVITEs you. + * \param params[0] mandatory, contains your nick. + * \param params[1] mandatory, contains the channel name you're invited into. + * + * \sa irc_cmd_invite irc_cmd_chanmode_invite + */ +static void onInvite(irc_session_t *session, const char *event, const char *origin, const char **params, unsigned int count) +{ + IRCClientSession *client = (IRCClientSession *) irc_get_ctx(session); + NSString *nick = [NSString stringWithCString:origin encoding:NSASCIIStringEncoding]; + NSString *channel = [NSString stringWithCString:params[1] encoding:NSASCIIStringEncoding]; + + if ([[client delegate] respondsToSelector:@selector(onInvite:nick:)]) + [[[client delegate] dd_invokeOnMainThread] onInvite:channel nick:nick]; +} + +/*! + * The "ctcp" event is triggered when the client receives the CTCP + * request. By default, the built-in CTCP request handler is used. The + * build-in handler automatically replies on most CTCP messages, so you + * will rarely need to override it. + * + * \param origin the person, who generates the message. + * \param params[0] mandatory, the complete CTCP message, including its + * arguments. + * + * Mirc generates PING, FINGER, VERSION, TIME and ACTION messages, + * check the source code of \c libirc_event_ctcp_internal function to + * see how to write your own CTCP request handler. Also you may find + * useful this question in FAQ: \ref faq4 + */ +static void onCtcpRequest(irc_session_t *session, const char *event, const char *origin, const char **params, unsigned int count) +{ + IRCClientSession *client = (IRCClientSession *) irc_get_ctx(session); + NSString *nick = [NSString stringWithCString:origin encoding:NSASCIIStringEncoding]; + + if ( origin ) + { + char nickbuf[128]; + irc_target_get_nick (origin, nickbuf, sizeof(nickbuf)); + + if ( strstr (params[0], "PING") == params[0] ) { + irc_cmd_ctcp_reply (session, nickbuf, params[0]); + } + else if ( !strcmp (params[0], "VERSION") ) + { + irc_cmd_ctcp_reply (session, nickbuf, [[NSString stringWithFormat:@"VERSION %@", [client version]] UTF8String]); + } + else if ( !strcmp (params[0], "FINGER") ) + { + irc_cmd_ctcp_reply (session, nickbuf, [[NSString stringWithFormat:@"FINGER %@ (%@) Idle 0 seconds", [client username], [client realname]] UTF8String]); + } + else if ( !strcmp (params[0], "TIME") ) + { + irc_cmd_ctcp_reply(session, nickbuf, [[[NSDate dateWithTimeIntervalSinceNow:0] descriptionWithCalendarFormat:@"TIME %a %b %e %H:%M:%S %Z %Y" timeZone:nil locale:[[NSUserDefaults standardUserDefaults] dictionaryRepresentation]] UTF8String]); + } else { + if ([[client delegate] respondsToSelector:@selector(onCtcpRequest:type:nick:)]) { + NSString *requestString = [[NSString alloc] initWithData:[NSData dataWithBytes:params[0] length:strlen(params[0])] encoding:[client encoding]]; + + NSRange firstSpace = [requestString rangeOfString:@" "]; + + NSString *type = [requestString substringToIndex:firstSpace.location]; + NSString *request = [requestString substringFromIndex:(firstSpace.location + 1)]; + + [[[client delegate] dd_invokeOnMainThread] onCtcpRequest:request type:type nick:nick]; + } + } + } +} + +/*! + * The "ctcp" event is triggered when the client receives the CTCP reply. + * + * \param origin the person, who generates the message. + * \param params[0] mandatory, the CTCP message itself with its arguments. + */ +static void onCtcpReply(irc_session_t *session, const char *event, const char *origin, const char **params, unsigned int count) +{ + IRCClientSession *client = (IRCClientSession *) irc_get_ctx(session); + + NSString *nick = [NSString stringWithCString:origin encoding:NSASCIIStringEncoding]; + NSData *reply = [NSData dataWithBytes:params[0] length:strlen(params[0])]; + + if ([[client delegate] respondsToSelector:@selector(onCtcpReply:nick:)]) + [[[client delegate] dd_invokeOnMainThread] onCtcpReply:reply nick:nick]; +} + +/*! + * The "action" event is triggered when the client receives the CTCP + * ACTION message. These messages usually looks like:\n + * \code + * [23:32:55] * Tim gonna sleep. + * \endcode + * + * \param origin the person, who generates the message. + * \param params[0] mandatory, the target of the message. + * \param params[1] mandatory, the ACTION message. + */ +static void onCtcpAction(irc_session_t *session, const char *event, const char *origin, const char **params, unsigned int count) +{ + IRCClientSession *client = (IRCClientSession *) irc_get_ctx(session); + + NSString *nick = [NSString stringWithCString:origin encoding:NSASCIIStringEncoding]; + NSString *target = [NSString stringWithCString:params[0] encoding:NSASCIIStringEncoding]; + NSData *action = [NSData dataWithBytes:params[1] length:strlen(params[1])]; + + IRCClientChannel *currentChannel = [[client channels] objectForKey:target]; + + if (currentChannel) { + // An action on a channel we're on + + [currentChannel onAction:[[NSString alloc] initWithData:action encoding:[currentChannel encoding]] nick:nick]; + } else { + // An action in a private message + + if ([[client delegate] respondsToSelector:@selector(onAction:nick:)]) + [[[client delegate] dd_invokeOnMainThread] onAction:action nick:nick]; + } +} + +/*! + * The "unknown" event is triggered upon receipt of any number of + * unclassifiable miscellaneous messages, which aren't handled by the + * library. + */ +static void onUnknownEvent(irc_session_t *session, const char *event, const char *origin, const char **params, unsigned int count) +{ + IRCClientSession *client = (IRCClientSession *) irc_get_ctx(session); + NSString *eventString = [NSString stringWithCString:event encoding:NSASCIIStringEncoding]; + NSString *sender = nil; + + if (origin != NULL) + sender = [NSString stringWithCString:origin encoding:NSASCIIStringEncoding]; + + NSMutableArray *paramsArray = [[NSMutableArray alloc] init]; + + for (unsigned int i = 0; i < count; i++) + [paramsArray addObject:[[NSString alloc] initWithData:[NSData dataWithBytes:params[i] length:strlen(params[i])] encoding:[client encoding]]]; + + if ([[client delegate] respondsToSelector:@selector(onUnknownEvent:origin:params:)]) + [[[client delegate] dd_invokeOnMainThread] onUnknownEvent:eventString origin:sender params:paramsArray]; +} + +/*! + * The "numeric" event is triggered upon receipt of any numeric response + * from the server. There is a lot of such responses, see the full list + * here: \ref rfcnumbers. + * + * See the params in ::irc_eventcode_callback_t specification. + */ +static void onNumericEvent(irc_session_t * session, unsigned int event, const char * origin, const char ** params, unsigned int count) +{ + IRCClientSession *client = (IRCClientSession *) irc_get_ctx(session); + NSUInteger eventNumber = event; + NSString *originString = [NSString stringWithCString:origin encoding:NSASCIIStringEncoding]; + + NSMutableArray *paramsArray = [[NSMutableArray alloc] init]; + + for (unsigned int i = 0; i < count; i++) + [paramsArray addObject:[[NSString alloc] initWithData:[NSData dataWithBytes:params[i] length:strlen(params[i])] encoding:[client encoding]]]; + + if ([[client delegate] respondsToSelector:@selector(onNumericEvent:origin:params:)]) + [[[client delegate] dd_invokeOnMainThread] onNumericEvent:eventNumber origin:originString params:paramsArray]; +} diff --git a/libircclient/cocoa/Classes/IRCClientSessionDelegate.h b/libircclient/cocoa/Classes/IRCClientSessionDelegate.h new file mode 100644 index 0000000..4efc13c --- /dev/null +++ b/libircclient/cocoa/Classes/IRCClientSessionDelegate.h @@ -0,0 +1,152 @@ +/* + * Copyright (C) 2009 Nathan Ollerenshaw chrome@stupendous.net + * + * This library is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This library 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 Lesser General Public + * License for more details. + */ + +#import +#include + +/** + * @file IRCClientChannelDelegate.h + * @author Nathan Ollerenshaw + * @version 1.0 + * @date 01.2009 + * @brief Receives delegate messages from an IRCClientSession. + * @protocol IRCClientSessionDelegate + */ + +@class IRCClientChannel; + +/** @brief Receives delegate messages from an IRCClientSession. + * + * Each IRCClientSession object needs a single delegate. Methods are called + * for each event that occurs on an IRC server that the client is connected to. + * + * Note that for any given parameter, it may be optional, in which case a nil + * object may be supplied instead of the given parameter. + */ + +@interface NSObject (IRCClientSessionDelegate) + +/** The client has successfully connected to the IRC server. */ + +- (void)onConnect; + +/** An IRC client on a channel that this client is connected to has changed nickname, + * or this IRC client has changed nicknames. + * + * @param nick the new nickname + * @param oldNick the old nickname + */ + +- (void)onNick:(NSString *)nick oldNick:(NSString *)oldNick; + +/** An IRC client on a channel that this client is connected to has quit IRC. + * + * @param nick the nickname of the client that quit. + * @param reason (optional) the quit message, if any. + */ + +- (void)onQuit:(NSString *)nick reason:(NSString *)reason; + +/** The IRC client has joined (connected) successfully to a new channel. This + * event creates an IRCClientChannel object, which you are expected to asign a + * delegate to, to handle events from the channel. + * + * For example, on receipt of this message, a graphical IRC client would most + * likely open a new window, create an IRCClientChannelDelegate for the window, + * set the new IRCClientChannel's delegate to the new delegate, and then hook + * it up so that new events sent to the IRCClientChannelDelegate are sent to + * the window. + * + * @param channel the IRCClientChannel object for the newly joined channel. + */ + +- (void)onJoinChannel:(IRCClientChannel *)channel; + +/** The client has changed it's user mode. + * + * @param mode the new mode. + */ + +- (void)onMode:(NSString *)mode; + +/** The client has received a private PRIVMSG from another IRC client. + * + * @param message the text of the message + * @param nick the other IRC Client that sent the message. + */ + +- (void)onPrivmsg:(NSData *)message nick:(NSString *)nick; + +/** The client has received a private NOTICE from another client. + * + * @param notice the text of the message + * @param nick the nickname of the other IRC client that sent the message. + */ + +- (void)onNotice:(NSData *)notice nick:(NSString *)nick; + +/** The IRC client has been invited to a channel. + * + * @param channel the channel for the invitation. + * @param nick the nickname of the user that sent the invitation. + */ + +- (void)onInvite:(NSString *)channel nick:(NSString *)nick; + +/** A private CTCP request was sent to the IRC client. + * + * @param request the CTCP request string (after the type) + * @param type the CTCP request type + * @param nick the nickname of the user that sent the request. + */ + +- (void)onCtcpRequest:(NSString *)request type:(NSString *)type nick:(NSString *)nick; + +/** A private CTCP reply was sent to the IRC client. + * + * @param reply an NSData containing the raw C string of the reply. + * @param nick the nickname of the user that sent the reply. + */ + +- (void)onCtcpReply:(NSData *)reply nick:(NSString *)nick; + +/** A private CTCP ACTION was sent to the IRC client. + * + * CTCP ACTION is not limited to channels; it may also be sent directly to other users. + * + * @param action the action message text. + * @param nick the nickname of the client that sent the action. + */ + +- (void)onAction:(NSData *)action nick:(NSString *)nick; + +/** An unhandled event was received from the IRC server. + * + * @param event the unknown event name + * @param origin the sender of the event + * @param params an NSArray of NSData objects that are the raw C strings of the event. + */ + +- (void)onUnknownEvent:(NSString *)event origin:(NSString *)origin params:(NSArray *)params; + +/** An unhandled numeric was received from the IRC server + * + * @param event the unknown event number + * @param origin the sender of the event + * @param params an NSArray of NSData objects that are the raw C strings of the event. + */ + +- (void)onNumericEvent:(NSUInteger)event origin:(NSString *)origin params:(NSArray *)params; + +@end diff --git a/libircclient/cocoa/Classes/NSObject+DDExtensions.h b/libircclient/cocoa/Classes/NSObject+DDExtensions.h new file mode 100644 index 0000000..975666c --- /dev/null +++ b/libircclient/cocoa/Classes/NSObject+DDExtensions.h @@ -0,0 +1,35 @@ +/* + * Copyright (c) 2007-2008 Dave Dribin + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, copy, + * modify, merge, publish, distribute, sublicense, and/or sell copies + * of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS + * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +#import + + +@interface NSObject (DDExtensions) + +- (id)dd_invokeOnMainThread; +- (id)dd_invokeOnMainThreadAndWaitUntilDone:(BOOL)waitUntilDone; + +@end + +#define ddsynthesize(_X_) @synthesize _X_ = _##_X_ diff --git a/libircclient/cocoa/Classes/NSObject+DDExtensions.m b/libircclient/cocoa/Classes/NSObject+DDExtensions.m new file mode 100644 index 0000000..e354970 --- /dev/null +++ b/libircclient/cocoa/Classes/NSObject+DDExtensions.m @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2007-2008 Dave Dribin + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, copy, + * modify, merge, publish, distribute, sublicense, and/or sell copies + * of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS + * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +#import "NSObject+DDExtensions.h" +#import "DDInvocationGrabber.h" + +@implementation NSObject (DDExtensions) + +- (id)dd_invokeOnMainThread; +{ + return [self dd_invokeOnMainThreadAndWaitUntilDone:NO]; +} + +- (id)dd_invokeOnMainThreadAndWaitUntilDone:(BOOL)waitUntilDone; +{ + DDInvocationGrabber * grabber = [DDInvocationGrabber invocationGrabber]; + [grabber setForwardInvokesOnMainThread:YES]; + [grabber setWaitUntilDone:waitUntilDone]; + return [grabber prepareWithInvocationTarget:self]; +} + +@end diff --git a/libircclient/cocoa/Doxyfile b/libircclient/cocoa/Doxyfile new file mode 100644 index 0000000..2cbd25a --- /dev/null +++ b/libircclient/cocoa/Doxyfile @@ -0,0 +1,293 @@ +# Doxyfile 1.5.7.1 + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- +DOXYFILE_ENCODING = UTF-8 +PROJECT_NAME = IRCClient +PROJECT_NUMBER = 1.0 +OUTPUT_DIRECTORY = doc +CREATE_SUBDIRS = NO +OUTPUT_LANGUAGE = English +BRIEF_MEMBER_DESC = YES +REPEAT_BRIEF = YES +ABBREVIATE_BRIEF = "The $name class" \ + "The $name widget" \ + "The $name file" \ + is \ + provides \ + specifies \ + contains \ + represents \ + a \ + an \ + the +ALWAYS_DETAILED_SEC = NO +INLINE_INHERITED_MEMB = NO +FULL_PATH_NAMES = NO +STRIP_FROM_PATH = /Extra/ +STRIP_FROM_INC_PATH = +SHORT_NAMES = NO +JAVADOC_AUTOBRIEF = NO +QT_AUTOBRIEF = NO +MULTILINE_CPP_IS_BRIEF = NO +INHERIT_DOCS = YES +SEPARATE_MEMBER_PAGES = NO +TAB_SIZE = 8 +ALIASES = +OPTIMIZE_OUTPUT_FOR_C = NO +OPTIMIZE_OUTPUT_JAVA = NO +OPTIMIZE_FOR_FORTRAN = NO +OPTIMIZE_OUTPUT_VHDL = NO +BUILTIN_STL_SUPPORT = NO +CPP_CLI_SUPPORT = NO +SIP_SUPPORT = NO +IDL_PROPERTY_SUPPORT = YES +DISTRIBUTE_GROUP_DOC = NO +SUBGROUPING = YES +TYPEDEF_HIDES_STRUCT = NO +SYMBOL_CACHE_SIZE = 0 +#--------------------------------------------------------------------------- +# Build related configuration options +#--------------------------------------------------------------------------- +EXTRACT_ALL = NO +EXTRACT_PRIVATE = NO +EXTRACT_STATIC = NO +EXTRACT_LOCAL_CLASSES = NO +EXTRACT_LOCAL_METHODS = NO +EXTRACT_ANON_NSPACES = NO +HIDE_UNDOC_MEMBERS = YES +HIDE_UNDOC_CLASSES = NO +HIDE_FRIEND_COMPOUNDS = NO +HIDE_IN_BODY_DOCS = NO +INTERNAL_DOCS = NO +CASE_SENSE_NAMES = NO +HIDE_SCOPE_NAMES = NO +SHOW_INCLUDE_FILES = YES +INLINE_INFO = YES +SORT_MEMBER_DOCS = YES +SORT_BRIEF_DOCS = NO +SORT_GROUP_NAMES = NO +SORT_BY_SCOPE_NAME = NO +GENERATE_TODOLIST = YES +GENERATE_TESTLIST = YES +GENERATE_BUGLIST = YES +GENERATE_DEPRECATEDLIST= YES +ENABLED_SECTIONS = +MAX_INITIALIZER_LINES = 30 +SHOW_USED_FILES = YES +SHOW_DIRECTORIES = NO +SHOW_FILES = YES +SHOW_NAMESPACES = YES +FILE_VERSION_FILTER = +LAYOUT_FILE = +#--------------------------------------------------------------------------- +# configuration options related to warning and progress messages +#--------------------------------------------------------------------------- +QUIET = NO +WARNINGS = YES +WARN_IF_UNDOCUMENTED = NO +WARN_IF_DOC_ERROR = YES +WARN_NO_PARAMDOC = NO +WARN_FORMAT = "$file:$line: $text" +WARN_LOGFILE = +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- +INPUT = Classes +INPUT_ENCODING = UTF-8 +FILE_PATTERNS = *.c \ + *.cc \ + *.cxx \ + *.cpp \ + *.c++ \ + *.d \ + *.java \ + *.ii \ + *.ixx \ + *.ipp \ + *.i++ \ + *.inl \ + *.h \ + *.hh \ + *.hxx \ + *.hpp \ + *.h++ \ + *.idl \ + *.odl \ + *.cs \ + *.php \ + *.php3 \ + *.inc \ + *.m \ + *.mm \ + *.dox \ + *.py \ + *.f90 \ + *.f \ + *.vhd \ + *.vhdl +RECURSIVE = NO +EXCLUDE = +EXCLUDE_SYMLINKS = NO +EXCLUDE_PATTERNS = +EXCLUDE_SYMBOLS = +EXAMPLE_PATH = +EXAMPLE_PATTERNS = * +EXAMPLE_RECURSIVE = NO +IMAGE_PATH = +INPUT_FILTER = +FILTER_PATTERNS = +FILTER_SOURCE_FILES = NO +#--------------------------------------------------------------------------- +# configuration options related to source browsing +#--------------------------------------------------------------------------- +SOURCE_BROWSER = NO +INLINE_SOURCES = NO +STRIP_CODE_COMMENTS = YES +REFERENCED_BY_RELATION = NO +REFERENCES_RELATION = NO +REFERENCES_LINK_SOURCE = YES +USE_HTAGS = NO +VERBATIM_HEADERS = YES +#--------------------------------------------------------------------------- +# configuration options related to the alphabetical class index +#--------------------------------------------------------------------------- +ALPHABETICAL_INDEX = NO +COLS_IN_ALPHA_INDEX = 5 +IGNORE_PREFIX = +#--------------------------------------------------------------------------- +# configuration options related to the HTML output +#--------------------------------------------------------------------------- +GENERATE_HTML = YES +HTML_OUTPUT = html +HTML_FILE_EXTENSION = .html +HTML_HEADER = +HTML_FOOTER = +HTML_STYLESHEET = +HTML_ALIGN_MEMBERS = YES +HTML_DYNAMIC_SECTIONS = NO +GENERATE_DOCSET = NO +DOCSET_FEEDNAME = "Doxygen generated docs" +DOCSET_BUNDLE_ID = org.doxygen.Project +GENERATE_HTMLHELP = NO +CHM_FILE = +HHC_LOCATION = +GENERATE_CHI = NO +CHM_INDEX_ENCODING = +BINARY_TOC = NO +TOC_EXPAND = NO +GENERATE_QHP = NO +QCH_FILE = +QHP_NAMESPACE = org.doxygen.Project +QHP_VIRTUAL_FOLDER = doc +QHG_LOCATION = +DISABLE_INDEX = NO +ENUM_VALUES_PER_LINE = 4 +GENERATE_TREEVIEW = NONE +TREEVIEW_WIDTH = 250 +FORMULA_FONTSIZE = 10 +#--------------------------------------------------------------------------- +# configuration options related to the LaTeX output +#--------------------------------------------------------------------------- +GENERATE_LATEX = NO +LATEX_OUTPUT = latex +LATEX_CMD_NAME = latex +MAKEINDEX_CMD_NAME = makeindex +COMPACT_LATEX = NO +PAPER_TYPE = a4wide +EXTRA_PACKAGES = +LATEX_HEADER = +PDF_HYPERLINKS = YES +USE_PDFLATEX = YES +LATEX_BATCHMODE = NO +LATEX_HIDE_INDICES = NO +#--------------------------------------------------------------------------- +# configuration options related to the RTF output +#--------------------------------------------------------------------------- +GENERATE_RTF = NO +RTF_OUTPUT = rtf +COMPACT_RTF = NO +RTF_HYPERLINKS = NO +RTF_STYLESHEET_FILE = +RTF_EXTENSIONS_FILE = +#--------------------------------------------------------------------------- +# configuration options related to the man page output +#--------------------------------------------------------------------------- +GENERATE_MAN = NO +MAN_OUTPUT = man +MAN_EXTENSION = .3 +MAN_LINKS = NO +#--------------------------------------------------------------------------- +# configuration options related to the XML output +#--------------------------------------------------------------------------- +GENERATE_XML = NO +XML_OUTPUT = xml +XML_SCHEMA = +XML_DTD = +XML_PROGRAMLISTING = YES +#--------------------------------------------------------------------------- +# configuration options for the AutoGen Definitions output +#--------------------------------------------------------------------------- +GENERATE_AUTOGEN_DEF = NO +#--------------------------------------------------------------------------- +# configuration options related to the Perl module output +#--------------------------------------------------------------------------- +GENERATE_PERLMOD = NO +PERLMOD_LATEX = NO +PERLMOD_PRETTY = YES +PERLMOD_MAKEVAR_PREFIX = +#--------------------------------------------------------------------------- +# Configuration options related to the preprocessor +#--------------------------------------------------------------------------- +ENABLE_PREPROCESSING = YES +MACRO_EXPANSION = NO +EXPAND_ONLY_PREDEF = NO +SEARCH_INCLUDES = YES +INCLUDE_PATH = +INCLUDE_FILE_PATTERNS = +PREDEFINED = +EXPAND_AS_DEFINED = +SKIP_FUNCTION_MACROS = YES +#--------------------------------------------------------------------------- +# Configuration::additions related to external references +#--------------------------------------------------------------------------- +TAGFILES = +GENERATE_TAGFILE = +ALLEXTERNALS = NO +EXTERNAL_GROUPS = YES +PERL_PATH = /usr/bin/perl +#--------------------------------------------------------------------------- +# Configuration options related to the dot tool +#--------------------------------------------------------------------------- +CLASS_DIAGRAMS = YES +MSCGEN_PATH = /Extra/Doxygen.app/Contents/Resources/ +HIDE_UNDOC_RELATIONS = YES +HAVE_DOT = NO +DOT_FONTNAME = FreeSans +DOT_FONTSIZE = 10 +DOT_FONTPATH = +CLASS_GRAPH = YES +COLLABORATION_GRAPH = YES +GROUP_GRAPHS = YES +UML_LOOK = NO +TEMPLATE_RELATIONS = NO +INCLUDE_GRAPH = YES +INCLUDED_BY_GRAPH = YES +CALL_GRAPH = NO +CALLER_GRAPH = NO +GRAPHICAL_HIERARCHY = YES +DIRECTORY_GRAPH = YES +DOT_IMAGE_FORMAT = png +DOT_PATH = /usr/local/bin +DOTFILE_DIRS = +DOT_GRAPH_MAX_NODES = 50 +MAX_DOT_GRAPH_DEPTH = 1000 +DOT_TRANSPARENT = NO +DOT_MULTI_TARGETS = NO +GENERATE_LEGEND = YES +DOT_CLEANUP = YES +#--------------------------------------------------------------------------- +# Configuration::additions related to the search engine +#--------------------------------------------------------------------------- +SEARCHENGINE = NO diff --git a/libircclient/cocoa/English.lproj/InfoPlist.strings b/libircclient/cocoa/English.lproj/InfoPlist.strings new file mode 100644 index 0000000000000000000000000000000000000000..5e45963c382ba690b781b953a00585212b898ac5 GIT binary patch literal 92 zcmW-XQ3`+{5C!MkQ~2$No+IcIkqMDxWCV8j>LCj|yTg2Mz+o9F%uHlf9u}h9EuK`F a!Y*1dX%G66ZqL#C$|bw0ZoP5@jOGW1ArT7z literal 0 HcmV?d00001 diff --git a/libircclient/cocoa/IRCClient.xcodeproj/TemplateIcon.icns b/libircclient/cocoa/IRCClient.xcodeproj/TemplateIcon.icns new file mode 100644 index 0000000000000000000000000000000000000000..62cb7015e09d6ea3e65d7f7949c4c07f9246a908 GIT binary patch literal 52318 zcmb50bzGIn_xP{wy6zgQu8NA?Et1mR-Q5iW(jf?!2I=l@kQAi5>lU|zOLqu%?em)p zy7BpZzJL69?aO=TIrlkd=FFUVX3o5ywJ~#Wfx*TMZCu#dV6eSqfmSd+I0X9>4((|O z2(SpJiu9MXVu4OY5LID-Nxf9{Kq*tqu7#dA;;v6LF70xbeNIu~srMvnj`2S}Hk_ zi&`MJ2n#x%Z0)4QQQ zCvAfO`}8!>JmhF)E=iH3Z)I_F z=gZfw^)13*?|;?57|zFIECRp&OMqBnV%N|X9NKHeC?5)xNlf%U;p$oyvr~?OT)6EY z!(e-Ug?<0~Y5)G;*^m4v!C=QVEcsz}%@4j`iHE=+1%imXG)Ao*7IGw0EnsItbeLW_1R`4uxGj zap9b#K;55RbuUU^VJ2rP-z`oC3cH3qIC1}us%*Qqpp=G9P)26h%WbGs_LzJ4!{aQf zN`msrqI{~>-mb|NBU!f$9B+p{JjudxKTJ{nh8QBAPmedIsh*mz<$c99+~T;WmehHT zkay5nK|{x8MJiOseqo+*nfunS9dz7#sHGPT&1)}z5VWBM$DQi4cW`jxg4s;It9((o zxQ3mqmMDiz8XAD8{oNx$|2rp&>$2kOQ@?HXt~hcRLB$Oa5Vfw)oDO<$xEzZ8tpoZ7 zy^oVo?)&hn0Sbyc9o@P>`uy1Q^jT>scmV_rK0B-B1XU?P4B2z&J+xh1r?3wuIfi~a zeV5zCdga3@We5t4W-8eJh#^7k-E^m0FqL>)2@%uWIds4QI1~_lDl!kkP7szFI-##^ zA!hm>aSc74*#U8f;gEmy>8MbMjv-SPI=dif0o_RWL4ZU+tT@jg?aBl3w;n5lD<4MH%ThjY3VP1Z0l~OBBu>6NmUaP78YQE=Aid@ zB9TTVe(Lb)X_y5dp6+EFA68mo{9MDeun(TeM_$j*nPcN*g>KACu+C3lX_KDYRT`5>%(pmhN%uIPY>JQMS5 z24pbEdu<*+);kH)9$t@1h+JIi$HncBhE(e6fT-;qm!R!ISY%RwSIU!5TeY*wdjj5P z)-gh(Wqp>}(Y8Z8SX$ix5!yKu!O5`rr9VRuA6=g9Ab zMg$0r_c=KaVX#XtS{BLskBHvwUOub;ghk3UAiXBVEeHtxqfSSLKvNTB%1TGom*w&H(u}0IaCc3c zYNtaxq0##d8Xw0X$wQTICtp1`mSnqdlE*c%PU`pF(CCGx(WBVuf#QZ$LS3|@mbjp# zX<&M(F#nIxs6dcLiu|M7X3@pLk2NGjAmzeyL41tgJU7$i`xz%!3gc zgod03Tx5K*tDdy5gk{8wXjU#RmW#WgG0g}KV!2++V7ZB^nTCXroMUQ)6ekxK`?Y_D zhHp>90@8x@+WDJmP96r*aISM4H$Z5NE`59bJv7EB+sozddU`^C%Ry*p`RsTzY)uVbhcS7SF z^RvJ1e|g_zCp2Eb?(4_>2#vG84EY|88#|#f(8hRnlqZ7Fz>x>q&qHC?PF%ezur~#& zN{@@k?xk$R{{UAtVFzI6QNG6?9rDO|mL4c)^pjBP+BcWaDZ^l{L?u|lCkh>5aqx;?S$P>0 zlz2L>eTfdqg8=yDghez2MN7giunqdkfapj(9SzouP_pN5U=fj3ghIgfuw6`Ug-L_x zh-E5%^BGHls-p9`V6Z=Q?(cyelZ($ZXGBNrspvuoKS9{8e!kcaSG&jjP}0aF!qdc& z5goCoW5S^s5FP7nF;hc@u>nurT^tQXHInoh(zw$De?mya1d2KmOX!KQlHj_@bmW%q z(=-ksg~y$V8GxoI5V+})s;uG0D0>Z24i-*1TX-DXJ%-pX5}K$+635CTvrAg5{4G?4 zIazts9K(Vh+&vFLuFi2=AB*cNs&lea`-@5nJ&Y9i*;obiJrdk5UN{CpE>B{iti+m< zw!Y^2H%(sIj(XBOtgI52zPVaguAG7(d)tv3cs~U-OlU4_rhA#X=tyuq7qAyH?2S>G4+jyPoJqcmXhuk{8?%eQO=dPWA7NHLWB9TfZzV8a@Yg!?h zT{(7$Nm$QZo(ITpFhS3%&>PTOI)Q@f9Yu^&-n_2y(9`GpTOL?*Roky*a2~8}1kfmR&LOEa(L*ulK~!Vd(SGGt5>D`5!=kVB>w$z^Xe|KBcfL zny~}hAUYIJo(*ZoZoOap7~TlrMM?i(gCqQg<0`Qil|hJ4QrrVhw%XQlb`Un|Y; z>#uzWjvYOI@$4y9A+bl7e>-q^&%f7Yu)T*)-Mo4A!Nv2Od@R4fU_bBu5BXoeKk*Cf zfw$3rNEt=(z~ZL5R2>-13#+9^82_I$tJ|9^?0TR-HN{-+oM>UZx4Gspk<1D&@k zPx>E1aOo+iJLCRy|62@6es9}y@{<2UF10Im{h#8c z$RB}`{Q7_V!0fx}osTmHspNnErv0Ddo$p7KqY!`p=D)-{7xu|SV0M1v^uOhds|QsR zwtuwy|NhngkHp56vD5Ot$++k58vgx_2<_jXqxxFgN0+yuLx0Yr2YPzCno8orvZgno z-#4)1#M!wi60)~G)4{lW3_A90or3IcZm23Nt$Nkkho!B&kA#lSplIuxYfDpv(T?hz z7zY8*LFmjIa(8J$fV;D+r-#=w-+)e$ zAK+wRpmyw8ITXGf3JFjvgKW)h>>k@#Sy?}JaCCNba(fmS92%EZQv0f*wk*ldJH8RD zMQGHmw{JFnsvkZcSCJH<)t;`H{w6%2&O)c%6 zTs=I!d;6lvEJ#ln)b9Zz1@(m7;j7dn%%E`{o%*rdPsc*>hi5`QX zjinhfX0Wv^HNaY5TY*d1*v{xwV?IM)EbNa122K99ChAH`YC0yCR@T-wHnwnk7CU=) zpTO|&=P~hV8CmJ+8EH9%rL`^Xd7;H~Ul+*}qaEcL{-(N`GMq|JeeI2}y5=&p#ls{o zSi!B70?F@##M3}T$r-!JR zl#-r_k)D>8j-jcUiGiM`x~8UvsuG6f$v<$!R*rl~lZ_s;h76 z7{;QiLsX>Hcn$Nz-5(q4YN;zSC8R(w*A$qn3C5IHTwYUGO+g-Llb4YYx~WjT0DWuG z;?yzH6kz99(FLA0G&7Qs*7Z!u&97@}XliTk8o?uKqEvZRv*J7*%yhLh)ub;CCPT2T z6qp<@$(cu7UPDVsMovjqN=jUm^`=RF`}9``+J4L{s}d1sz$UD3WMC|>oQnDKiM~iE zZ0T!m@9gRwA)#slWTR4_I$7#zYH2ESNqhz>bCO|l$HtR+MCCNK6l7%Oq$I@!cyBy- zUX|DO7Wxx{zUfF8boHVdt@#wqFGmFjpjzg_&Hk}fsRyH zz2ptrt&j{mojfGQC#|NbAT1{)CLzqtae+H~EXX8f@SQ(&Yh@@!S+D;S)NRdey8%sg zv=`KM&Osj1UHI)(4McylVI|E3$~mR${O;L(h{O# zJe;f-6>A%u>~$QfNTBWDzxt%6lA3ksO)Z_$UK^Mcn_q{8ra2XxsQrVZqewdKMVOVb zuDYtambQTMpP=Q)WEk(uMt%V~4Mj<5aS>52_J=o&>qkpW%&p;to!|-j?avQ{e#%Hk zL(|N+4_!}nO@qom&#!%gV%Suh>BDfuVeHayw!6BPvWljz!Hq=F^0*`zv&f1qhop*% zl$3<97zZos4TGGT!57hWFN!KD0noYkz^Kn zqYu&M>Z0|Olr{B@)c6*GM(ZTl+1ybvUIkSd2?=3Q&WCK5IDMk3+UsMo8tL=2ul~^8 zZ!_!t@wvg)(Ye(d&?a(pYKcsq{Q$)nsF+e{6W9sj`e=cRl!k$+1*dl^1QSh!oj*g3 zW)oMI7Y9}3e!z0`xS(HLS$1JgSqp`VCccM5cbD;N_%ZCu%I?lrsM)p6_4(P=)wNBi zU(Zb@bc0AFke6m_!`1XGtj#zlQlLHWm=j@g2CL?*GD=`TiVHrtckR-_3&zh%>dR`e z7%XODY@9ZaYU~)s&64pX>~wF-7-ec^c4m5dZuQS;Cl^QA=1mfXI=|JCY;E+|UfdqU z^!$5dj+eQk9aleSJ1z+(Ti-4$q$n*eA;I_H_NBv@;!vNy zEYHj?PLK5s^t9Dx4?@uAg`sic=4%?F=fx}X;_NIIL&Pn<%X0AW@>XwoKf5shmR1sI z>n3lT2JIcVd_Rz7?*r}|;UJ90ih0H4B_$<9IazKp?+f3~_9;XS_2A}ceT{W5(&|2a zSlh16$f@}XeQwLmor2zMLm%kli?n2CA5U+%?(@$J3-eox)uHyz+|@Ey=|y$j{x!+tGewUyL)Hv5)Xv2#yZd^&`uRRH z>He~`vh}(l(w@5?=uYP`4l>xMujNwRC=vp@ahsIHBPAyzE6Mec{r(^K%4_pt5^G%(<^F=5~%Dp@G3>)zI47)>cD|wB2sC zgAIPs*K#W@4B8V6yM7a&BO)a)Coj(Nkc0IEcTJ_gfrjU+zQSgbAaCg~A|9THsLUJk zhc15H`nc6pkx|m!+(lh=mo*L!d~6x$PzXp@4Y(#hj(-Q(2ZHK;(+%w7g=ACT%&4!z#~O3%^j+O2qq!LN*p zr`!3ZiU+}tKBqW{D648nGAe#evw7hg9Af`KZtaWU5pf@xoWYF@jrSw}+?;*4HAO;< zPR&fv-@ZxEFw|D|Df0`B^LPnuZ9~Wio4M4Tff8!)+jr%DX{>>;8^&{ylFDj&vJCB) zjix`WZfw8%@OBdE{76OIIX6FZY-4MYK%0j{=f12Cw4fK3K9XH!tPEAHi`>-IeS-#| zt*tN3w!ynK4>dTjs~qm05OXX5c992Pqb;v#qQVKZ-;nCT^`j=|W~a9?s{HC|lAOHx z0nktLvtPh*AoFZ5V)kvDv8t`1nxt}2Da~1qPKN3)pY4Ogq$P(3ebkMeG&xz>IUhZ`clq+o z+qWMG$|?xl4cVU0%PQZ3-n;>dTid{%n(Un9lOd@-@mTF=2wgySJ67Y{cFCpVw4sH6gi zNcGe>KHec12W?YUK0#!?(8?T3Gj~e^u#VHW4D(l(^9nDA-hTd&^Hg0{Ls4N4*l@Wk z9VT@|@_IeAwlu%+7J}vxMWs*SFiAILe~gKRk3J_mJJ%z=M_k zMYeu{)@Q*y79pgn<=|pzY-*@y;Nbo|QO_#o`5g2H>Vn&e32B}k@vKm&;3FZfD@bU5VR3$WZF6OH zeP#6nSl8P*4kOCows0>&PWDH<0s?$|f+GBy8IQf6IH$+FA`CQPK7+}}Nmfr^&(O@= z+{WGKX_%aCo^Q^#571hYyS<`>jO>k4V8h`ETPUj@=YAh(ZFv>6Vr_nIb!~NHePQig zl35jcqyX+1;l{(s$-^%!C?F^-#$)NA=irr5J%GTEbc}=jZiAARmbRg>iMhR3cRC${a{fKBGBc^T z;4wF+h=`~d*xQIp8E7jiXc&N9tD}RZnVpM=ho`T9P*7-y8@v}R(Yr(J9*1S6dx}fT z@hiUr4x_M3g~;j4UoC)UXXmG<$WsIq9*rW>=VmCA^UEtaUd=ri+S=E}w!*CP#yA}g zPEk=22{{!NC3RgxV{=Q}C(aHIE}q^#o^D=#fp90c!X*&?MNh4r;_{MHY(c+VjRhX_ zhcO4AF*pn3{`7i!aba$fP8`Q$ktnb_#L#A@XXmQD>iZ|AmNvegMU?>Gss!)-@X(4bL_{x3~66&r3^*(-o1DygLY7X2lz< zXs9I3)(=h3FHF%ViDPJxO{Nh@SUd(#qfE9xeKCZc-(25(|9Nq^uA*VME9J2`3!A6{ z*t{8-T3XxMfrD8mXBQ{1>kp`$1k-R!qO+w#NOpEcdSgDEI;YyfOUz+wIru8}GI!hnik?U?!T9Ty>-cg(T(G zbPNnlOpFcn^b8%sD==Utz}3XMSUvWN&jefJjO?dk;!+Q7fYVY=2n7mA2#TE5{`14! z>>Qm&#iDT}Dw#?nVTd&PG=)m1gr^_~^V{#=Zmh1XtS^y9I+{Dsvoq+nlEe@nR|k71 zXU~9`+$hN=(kk$<4@oEG#K?+XJ{w_E69*qub~H=!ItH=cmYc z{5YP3C(KTwh~&v>Di%+k!AHg-iNMbLH=8R9)AUIaqOYx`tq)CK+1yxOn44W(THF2% zL0^`}UuFh7TbNon21ZB6B&O%&=Vm79i%3h~jsbof+IKPNiqU0Q3N$k_J4wV*h$I?m z0`w0U-7_>2kxD0^)1t;nj0U}VvpzRPnHV4LZGBl;UQzq1wQB%@#o;GV!=3ddX<;5V zMmpMtwq78G5|xmalV6aV^;}t8M&|kpU?}3UT%e4x!c9|Xb8%sY4zlh@3=U78o*+;$ zWI7oP1p<~@{(OiuzxClANE^-3N$8QD=9hcx&4{X3A_nV%w|hdLWx7Znx~5|dHZ)HAVl z@(zlKOUcYDEGo##auSx1lDu65Op(O&0}W2=@wGs6ODhXAlO#<42nIDtK;Y0=3Yp+f zypEfmY>#Lq&uzW~?%S9LjT-8xFUwAN9^mcfU~QtOp)4mYA?7d6EG4I;u4nGx;U6BG zl%7*iRFt2QY9=TtCB`uU429lR3{VhNx|<3uEG{j~%+LrZBx-B~J%mP#Vo_KW0z)Pu zv8eW_ddlp^+qZAF)^|*G)|cfZguy)>ZOsg{)s$o<#r;Lkib=_1kkOLP`ec zsp7)y%n(^okfeAx3XBcO+WOl_*qSTiq2;yZr6oF*JdQyOjE$pk!$<-FIXEzm8SDd1 z9Ze{qfVK3S?akF$(0I^Y6?w_g!Oz?rEP)eMjpDJ0{$b=;f6vHBKXyE+ zfHb|b{bp-pWrl)7473AlDY2n`o{lyQM=C4G`pcbFR@XDJaef-`JT5ssE3dG)I6ou9 zPC!yhN|cKn3yv(sdHp5Cr58nzo@C=(C_*KNb}i<)x<> z3BaZHN?%Qhh4yq^@dx`?kqaHr()#++{0w~pj0!LofiqEvvC+XXBzAlN)!Q}H)?b)0 zF}1h}9Jxd%Vurh$tBW%eqeA>VogP~l>uIVf`zxJO(aed34g2Up`!)VmN$oN>_7;=0NgX|w5r)sqvg?`Z5ATLQzO45@uq8I9pd;TQOSWQRUg+Tc6%X zn_YXowlqhsyBe|72y|}hAKLvuZ z^VN%j^n^&zd0;~MXXjZvF~T4vJv+asq@*w>Jw{zPPG4 zy4e4#^X%O~AS9(_D|tI z;^`kAw>vf&otNPtAQ33Jms|N$1oZ2sIIooSeeFNrz!!vPM~Lk%LA{8I(>1nn0>QxW zX92^XIjKp8LP4^7`7}O6KyqXJnpzsXwGdd~&QHx!mQV(AzTS~-xCt`8!t1e1NqQs^ zTBN^jaT_K0B)+Coh7yXg1hC@5j&`@a-08jm;7==K{qM1-sb>nNF%S&t-~E}D7Ah|u zB)jLKBXDPqn7M^?Aha?+x4eca@$n3eim%0zaM%VvcaNk_6rnG{&bRsfW%sa5^$KooUEYlZF*aV_+Zg5)u#g|Oi1mK8fSab422~)( zF=)hKN5hMv?BrB4z$%( zmI1vd$xR2nSI282r@8#@<6?wU zSFu7Cy*b*^JHBZWtc=oae0#PRr@%^o{N+%UTJvm6@Y?JYZgjLZFr}-zzrVY+rZhJt z4g{b36Kk-|`yPCHW_E7AAv^vA3x~Y)vq_|i4Rt|9H)X6h2Yl!HqVV+g#^&9 zh_y7<*Hlx1D=~rC(>4M#*={K0<>zIkq&Z5d1*`8><)4gzc=C>1yt?*2#iOAvwWzS6 z6Hr$RMEd+B9Z$hy2o&<$#cU_{_N~>|kpb_ar{1JQ&+xAG+0n-5-Wl-XBL%ssaZ$lO zZeSZ@q^qF@9-mB#D(X5Wwk{wRlF~DCa&t11Q=iI8g0Zq!p2aj0;tf-i?}TR7!4iIb zc4mr3ot&MdP7@|3NHhX&iZ(I7v^A3-nD~m|{j{;(Ji4x}EA5$g>qf?+yM;7;rL7q|&B{Apa*|G=;wR{I6q$^fTc69~c5SwG+n5D&K@UAozM-W)%g)^0*AEW&c5``R zYih)J!ul(n1RZD0cm##VBqYQ~CndV+=v(RRn7h&)30X$mYKGQU*VpH1vs4^q0?b^L zxykuS%JdY4Iz^$+lkt0v?McQ$aF< zJUcr{nIvK1giDK5+$2~|3@8Q^>1%m+ykB0MGHu*IE|NQ1vmDel%q-!izZe^WQ$uCN z0Qr-ODq2QX4sKrFe$SKRf*lR5ER4RJV>C}85Vi!ZEH5q2OjE&LbOKGL(7^~9$KfU? zDP$srf}xXfbP{=NxLB(wL$5sWiFemWhqw<^DuG5BZ!ClxsHo|K6}z&MqMWR>q`%Zj z83k2sLvuUNu*8HQ%V&{>mOJ(WcA6IjDayw)HX)1CR4Sf817n0h#NtRq!UP`VTrhb0 z42?{fB!W#h$o#!)(H(tDj}OprdV|H_h(sJ}tgAZNSwlfdO;b%lN=#TtP!KM3QdCMw z*V4r=INZ;{$~5$!1{n=J-oQxa&CQUBL_7+I0rM}8M1oH|A`oa)8V*Dsj)bF5Qt`N{ zEw{w4jZerkl#dh2$q~S75a>}|^j*e~~PA0bY zE*8NN-<#v~*2tA| z7aE;1J3K{dD0@kpq*19DBzmm1wlLPqR8?9`L|9N%TwFp*R)SZ+#^JGxx$_g}e_OoL z9R*ouH7|a6yEF-Q#lwTcgQH`^z*lG_BONmamYrDaB%KbPsVMT>#GudfJ-&EwYDS~r zCJ}vT)C8k{Cx?2v>R;q1hk4o?s!2r9xSL(ag| z+6ve|j*a1lhmeEgBZJ)|$Z;eVY$dTIDu{h>0=M8%wLaPUl(slSBH_t|sW}R0Itr|9 zFnDB7Z(~(KZekeR$KA=n{)w~6A(&{;|FU?cI|j021x({vG5gd`(mZ_<1Gqp0vcIcm z1c4bFLSis@!X$-=!(yg;y=G<>>Yoxpj)MjgE0YuoX?l`Op<)RWXd-H?r?sX4OkZ&^ zk+Bh>;7x?{{!jj+iC~w)Vh{`cw0a133=Wg~?Xs|4d?RXknFeAXJuwcps)MLe97qC? zDU(zZ)-7hbYre|5eTX!HC1Gh)JV;WFV~HdZc?5|@;>O3jTVB;yloS^iBq_mRO#AJ< z{@dP_?l|Z|H|*CVM-MUqT$#K@5$KjSUWujr8~R4p#Xb+Vk6f7;m8Szk86;x&-JzDeTu{ zhnW93&V1qk9Hw_p&?NN5=rj#z!{bIVcnl6XK7k&oH*{$7HLN4z2^1Z2e}nyU zno~2NxSzH-IlD-sqEG}P`ei37#xK0Bp>v#0CDJDe1T1-ih(nAFjDxKja%dPaG=|4u zNDH%FR%TQ~iZAq5WDVMePMmX4mjc<$68Kun!@pyHm^Lz-Qh znx^B41VDAtK}HQv0_hwuOo$}(7--4R0Ai>gYzWavu*n|A(>6xqm|y|F{sBAW{^YL^ zFfrr3>oAf6DXjkvJO2+e%%_-`t{ndvw(rz!N&A?FiK)5e8E{mNq@WQbJb3A10-RA# zpm78&b^Bz(PN`SV-sT_JurksV(5!2 z-5$U03p#vw-+pUf2WN}W5GhIhFjN*K8xK2t@-I*QP=DbPGt=+K02F!r9JjV#;SgnM zZHA1*AdnLTGze=94vWSjP-xWH*a!$I5_M@T`!?)g@PPv`_CPxeIom+*x`kXw#s&7r z|5SbS)Wu_Gu7Kw5J$_%oHM4`bxI9gvlTZW-4o?`vjH7XgF*Fv8WgLB(_|g#e%fX-n zzaHEVyY1BHAWEu(8k>EM~TK%b%z!Ps10Y4hFxYtUgZ%1>8RLHp4`K^pQGE*%Mg zaUM8$`1sk&|E=r5kz+@X9X)*T&@YE>id%-2^^q4>*O$TR#oLjR`>=q0`+fnZaVDGf z(4n`lk?m zy237F8Jv%)RXu;``0*1bVX%{7!_a}v&7RJzP;;dRXZHa&?KyaaVG!JN=HfMGrn48% zpSXPOmbftNmy72w?uT6r*~UP>eSM8+PYpJdIDaY-cKYX^PcmJ)#(etH&Ff58&m1`e z+k581&#X|#2Pn_MeZ%4cU9e6v_UKbXi%y<3L zet+1$qc9kA;O1-Szy`G=J<>|{Dzo3_Cuq+GNPRQ@DtABr<6i(ou9F9ws%m=|-#`ba zhni}uUlb+ycqGsP54k$hIf%iG_qSH(h3lyn0Uq+tRpMw%-HXDUoT93RPBdlZ1K=U4 z{V4h*1wY>3RGt;(Yslin;34rX*&!|#CZ?8_)^-lgt{%?{x#%3+*#H3?6bI-NQ&r$H>ao!P(#Sh^K$(^O)3(%=Dzlu&~4`1`qiahgw(y zNov$!TTOmkfQy;7s?0B*-+4%KvAY&H)z#KiSJTkeH!w0VG=1#s;_e@nR#;w^pC07s z82JkD*m%s+GRSgZL8iVaA;`@fU|6D@u;zdAkmyuvH8o`!2{ADV8AUZ+BNGb?D?2C9 z2(TkcOioYF%+5^@v~w<7TmXsM*-1R2uNfR^xSD7xN&RX(Yi{f4;qLhi_$v|~b}U9^=IL|7yqKQYocBDq5m!>zRF#*NlLw@hzCOsU zI)g(wKRES(II^bTt%ii~ZmsZwMAY z9&tW0Dn7HKv85n5tGzPm zxub%NyzqSuPb)o571@U@fANrpwWfFPvGPbN$VrHZipwe~%S(#!^9cwF@N)BuNy%yG z8<~NHc~Ww0RAgjqLULwlV`pPrSWK9+qLif21H(`!GaXe0$t#LKct~l>I+Yvu*af6z z#rXM!B&0?7`B_dMIm61!$HU9d%f~MW&^d5;sAle$lo=ltmz0*4Ro2wonHBO_LQ-1n zfl;EjwLUmFkT}WUuXcDyt45h?_c=tQ#Q3>+g@qnHymRZ+J!>cF6Bh(QH6O8YJQ5NI zM5ib}FORsPcWg4)yXO|YXzK4O^pz5jVbe(VeQctk1gOWuvEO+}gFc1JK%s;n7bhA@|Bxsj!K1<5&;mnsdD-rhsQJFgXh4x zxyYRdfde1j;pb2>d9}r5FDk2=hP#Wrgaf0VSm`Ot$;(OI6a2wL9_&}G>m#_TJd_)Wpyk6$26#V9nc^`Zsfr7x=6QSB)K z!EV-u8gjC7vQj7AzVncAE%&an2?~RER@kqdyKwQ`zAMjLEqQ%jZ37;1zQyMjN5ea) zLF$OyGDNJZe4bfFfo$0;x+|-yYrw&5ZM3Vkv8JL79AtW!d%yFL2YIMk=kD_gbFr|q zT!Nn$IJN&#c9xVFt9%Ob%MK5j^RzT31H9;%hsRXrT0V6N$ry%+7laB2tLqvXS`g#8 zeui3rAeE6*V3+>RL&{Z_UA@L3^oWJ+!G&|o%%^^r%505)^hnG&tQr6h-~N0%`V!Gn zkyk|i@U~8qL&QAs6K(z-Qumjscaawg_G4=FUQb%uqHm*pYL zrSoS_pFSeupV64)n2`_`hYo=5y&Y=|N=h>E$&JaLL)!6LbbK8ir$M9lxFu^x8(W*3 zM=-^~s^XGzDyotXzw?lCnH_hpaPhO(Cdl0 zm#!gJ;*LSl6lkrd6;B%-BW**DEW8^1gYE6DJ*2iY8-6(z4egt*yFjG;8NBbAd%Rrt z9^Aah%*6D^&o}g3V*Enjk$J--ZM}2bTbm>OGyToI8Hq1SQyV8{7w3pL`t9omDx-#`Eyry{qR=oH+VBY(KY7SaMi=ds}B~dqZ7E zPib0dLoar?Z?Kn8k@IQ@tWK~PG=Ay}UPe-mr-azs59p`bXhRhPBQA>{Kx72s(FHEf z`z*IEoIVaz!uVtBdxwWRYpd!T8fuGT+{@>wJwub&k;cBQSFu$s10(%lgE5BrjF6I% z=e8t_j0_`Yx{{x0ni}5f`3^+Z)ZDu9=;8ebH_n~-GZ0o&2q-$Pt}CL%AVEL1WzjzrQCSzh{<0w#d!`X>;1bTIYG zJt#5F6~0^ZD(_VX_R-F1#ev9GFo+lFiW zy=}aD2a4m->HJnD;5D0G<6(eARAHe{<1R{q`l?b&GGf{zL==)jDG4waVpRGE5czBj z0FivR@j>Swva_(>K6~=i@x4cb8%tBtlQJ^eUbGfD=^MmN_t+@whnqYHtPwN`-kbl@ zlirk{PJen+RZ~_JE_YD8dTs(uqLl`k-0s=M+;)IS=jvCY0EoOf5qjkz2OHb1Gbc}< zgfYh^1v`bg<-82%HB%ij*7qikduS`CeVEfb}cbRpNmB;qcSwF|L(QuSItj! z16$$(>p_j7cgtI=1@Z8hs-h~?yv9XVc>`TZMe*1TJdQ@m_hTK|t@jQQ=?aKQM?geM zGxZd*vv6^7GPIxm=|N1a+qDC%Mg}InrHA>O8lQVOJGHkq_I&=jjYChb%_KPaS5M91 z=GNIRXqpS(;M0?hS|t+bxC}#|-J0(Zk*;Ow*0~HKvb0U?E;kSN&C@{leoo)4g5c1^ zXe+~rm?JDDEou2fC53g3V{f-75&h$sv9^-(7R0M5DDo_?KD(NniM3?hDw#Yp8n4u` zTk#zt66m(`O94crRPcoUZSeTJ%c%HoTv_YUlFE`;=~LJ4upYh`j(fu(BDcn{Q*(<;LxcFB`;VkKZr$UQF%eeQTBpVQgNSs)#0&Gw%H9K>VLtQQANPb5)Rl!Up167U)-icZg)2Bc z_y`^=a~)I)W$In8(F0N8d$(EG_*5QSYueZ*zXtG2vSQ-@O+*TGw%hPXY4V?AI(>$j z`HzDK4jnpp^y001XMTRXN(l>yTZdl1e*Y(wA4gr&!pP`S-~;tcay=F?}+p1pA8#=RrwGA7!G zT_j9~pbhl=2WW!b__?2mh=wR9I|~aNkGi2So1#+CCS{5i?I0^GCoVP%Fdyf;;ZjE= zuKgzvdDv>8?U|IkiRk%LrS;E-1l z<>dz}9dSuDQvo?M@R~k(vBJfKm;J#pEkG>o0FhVz1|pZ2Hoxuyk-V8>r4F(>W^8Af zPM}7cbh0eJE3ysVGht&IlLoNUua&>JNhkR{j)ZU+Aqikt-^DGndx$_s!ojZS-`H>fo zs)W3^LsoxHPUq`4U!hORS2zI4C@3T-s-PrkE+%az;l4UEHxX=WD#j-y#9RQ3IQ-7w zAvu2W20Y}-4i5?N!5tp*LyT&6e`lhNmXq#P=2Oh)FI_kf)@P@M`0t2n_{3K=^}H;q z$E|%$yz`LdAvfSLC6x3vK_b{x)|9q7MU1hrH5cR+;Jz~n7^M%K7a2U{8NfpV?jG=v z3xJ1Q0H@I#+uJqTv1Q1XSO*hNJ&?mWd-2l63l}b(y6P7gkd@!sP}GARYAnn37UpGV zV+G)+n3ArEp}vm3q#kaQj*qoA_BQ7f5WJ(f!$YzH9#W6NLoTfV9&%>pZys`e#56en z6|Onf!xnCS>+Ct^OP7G5E5CD;Ap3?#y4%VVeXUi5xkb4-**SPYOSJS2jSRI#%t>#i zQBjtL&f%);y!^-gfxo)#UTMWhTXv- z7b$}EKgr&Le+}PNHEEkE3C(d5FbnWg#Hg--Put5_PV&wTH!8<;ZVvoc@u3V zFo5u*FX9`slQOG|;aU$*pSpbe-u(w`Ts*vBlLZ$#FDN3y!^W%gy#LeZvEm>LeN)fq zn8>J@r=om-qTK{TdBMmj*wui+LoNay7T|#sfDrq^LxRZ_Kj zRn*j+<7+JO@am;&w;q5tfyX)<%L8@^vxrwS-`2Y_{jKy3ANxlxNZWP zv%^E~+vOqQbLXdMv|S#O@;47T=@;DDhn`)YA;2d%iP(Wx`Fp%a$LMKzksmtnbdgbC%{8$1!$URi|T@7|K&x-Niqp+ERd6UG5{h8 zyFldRT!TmLAbJwCYL0Fk14f%;;)Jl}yxIteo{I)R!bBEdN!g+d^ah$Q?By~C$$ z2t`|*pPQkfh5_SQoEaDD3!oHpLv1zi9+rq89}f?lmsvm<;KrJU0I2W_j)+M}NlA>3 z)aKw9;JJ-vAd$Bf0_4RMZ>M}mB0*veg&rTp45JZaAjAFt+B@@jsP;epPuhfRks`{z zkA2^>MnX!3Qr0Zlvad6?>`M_!i%KGeL|Rp3AH!J2z7?WWw|na@-|zR%?|o*FN~O~8 z_s{Pkf+J!QQjVX@I+>Olq@kn+ODr2es%{%Fin`8rb427oUrT#SEv}^v zV8!n4*1B4JNBt8>DL(FaBOVrRj|}y;)IGXWT5v8S0UHG6bzqKvN7 zh9*cB`iDow!V9C!EGRB_1tnEgIdnIfh&+sS(st1~J3~bFbv3oMH8uivS>H_T#Md^q zw$xQOHPv+zl9C(nT_ewi2fA@jswzwJ&t@bdT$U4pux^LtmsrhBTIBbJcCJt}qT`d& z(zCKMl2c%zteTpFNH>{?R01MW54~rGh#Y`LdrkFC0Gv0}0i;;{1US#S`o^k8TyAl| zW#leE7(~Y*`Ivn&H6=hp1*<`&&V~Dkhy3^XG=+z3>hEmr?5M}VoD?3w(*E9dVsrBm zN2j{hYcUnggg(egLhb!q2rrlz73L4DCtxV1#@qBjj)ES$`2N-08_N?iWc$2jE6SI;L0 zranU*n5*nZ_SJn;miUXj9|e_@X9!S6_E~OZDv=KzgReMj#~z7>c7fQB4uK5MFx7!mP2DP+8zkeXKCfP5 z4-WJ5JN!OB`8RCT%Yoi=m(9}UXfh3{@vN!)zE5;Dz9=&}KK0J<&>Rgp(l-`bGM$k0w4?1ta8WJL zbU@CQ0J5eug_+VbG}*l$ngZBF zP-u0h&e%qA#Y*rT?!wPVaTgBx8l4b$uMNdEr1~hihMF2+`f0GqB!qNMhY}M zGNn6Pcx>7_+qRpLn?l4)L(fP}h&EJ!)M;>5A~2-d_MPHsWEj#@ZFkAjK?H{Miak?+ zO_&EmW@K9d4C#l!koc-}-@;pEWjBj2olcL3+5%jutu?GQFr>6}J(#w#vOnS*8b!{| ztdqwRQk><~q4bo+24-Q%sds-pPxOA6zvJxiofNMSfFa)k4CxX+3q#(lFWv<(WXuaP z3|a0Me(hSx^}!CsWtz#?kqw{G< zuRt;l`FGBd(U&Qv$x-)S0u5Q6z+c<$U-dSo6(Dr85Lb2!Id{1QphZ12(Xanj@pJEi;0fJf~gq{WM_+RogNgO&0$Z3 z;7dwLNs3GKFf@u$ha19ONZTw6`2yAv5<9-gLWX$i+MNn8qOgz|2n%_^)!HjCFgVc9 z^9Ufiz_5~UuPm?x25#ow!I+r1_=MQlc(?6)&D5Y$YVqz)ByBI_H=?kRgTO-e4G%%T z^*IYU_VVdjW#2oley>Im7IHY(xcqMUc~=WNaGLROaj-jNz1y79MYC+%4s8G#fgJJorELmvL=ar`}*glws}6lr5@umf%cdOF%$ zHPta{Yyi=1g~d|)4!Q+LNBZscjWM?-3r3LBmqc>fo;HUrfX{H;NctOd1(K>@Td=hmTu!UMSbq20(+m%65w z4kyai)85tUBSj23jdLjE$n*;sLpS5P8XH>cTbk-0H{x4h5mo0r6f&?FP{?2eg@nbW z^HE45ppcaa3K@qD@%Q#P;)$S;>VXR=LKdvgPV zLUzxgkWT@H3|aBKAz^;5 zV+MunY{fS;wlv~CK_L~w=Qjp3EV z6tWKAP}|bhPH1fg6p}a(g><)@YXW;L(VLy>7K1`gJ?$UpXhl#+B6tUNASfhY-<_Qu z_~trXb7N~;8=;+yLYC;vppXjgj+C~2V5f|hPt9Ub$cCpcpN>Bz^mXH#o1i(sdsld_ z>m=Zs8d~55OKp8aYwJ7|a@Fen-gbwr!o!r6%rLk`p^#yh8u}-vpZ2x3L$f9l+JH~( z>V(SCMrgw|H+6Kk_x4ZDp^y@O2Q4)Y1$$i^TO&oYx&tfg&ZI=Rs;ivF zkr<~4)x~*d;SEvdg{!xkx+nhz6!PKuO7iRJE7=L5o(}pO9S{_FBf)j7ajp6Qge8Zy~xj;g?*qG|6E6E9? zD(170&9TN((h@>ETek2Bipi*GYU}G8nC#xQ$MV2oui!8&HZtlM=I|cJD-Bg6y+i`8 zrsDF+Xg{|DCVCo*;sWS3GIK2Cb?}D7#~DgX@@-;g+sG{@r=kI)5nXK^0}~4?#CFoh z*T>7l16G(OB=}h!xi$T~tF5-;N_K33>wY6`4Fy5*t=lwFWiu?KF3tXYOL-A?7M6|N zqS7#FDley?1Vcw99Yb@geU=C9-8{V9TwI)B{1}s#f%Q1v`m6zQW(aWKZ=j_vC#YZ! zJPNh*EDO2L&`gqro`GcxT25YCR7hA9Eu*NcsH~xHx@Z3(8yj1&p0u-daz5hb;uV>m zli?eXf4?x}n7^x~zLvVIpoXO>u!-!-b1bA%iZ$zMTE7&lJWBc7otXU-=F#H2&q_Gzf7$?|PIV5Sdq3_Se5&w4}d&eB@3 zl9q*6RG60wX4r+r#Y98|1jQvJ(PEMcsv6sN>@eAF<>>9}>E;GrBtF3jXY$TPga3fF zhLWN*pRp$dsHLXJqC3Yz9>_+cR?=-05Zb(9{YFkGTz<|q%h&RwCB(&%|D=`GR29{< zbWLo%{XE<}d;$VO6VDV}P6^m8r=%pyV+s|>Xsd>@{A#CJ7SiS%KWZiYCVp-A zp0TmhY(D6sNzE)RDGel}poom3f`YQVjI@M|w#DJ20YNa~lyvs$<>TH;;>vvbQEpK4 z0qs;kB~VyMUW;qOsFg4e&khdG>zJ8Y*w!x-%jzNhr$AzrjG`C}g7_t5FjBnoQY`Bg zog#c3{i3i@v9U>K3NIY@SL9Z~`t09jpaD|}QZ$ceSV-ABY7pWkE|#?nO!RaNEbR0v z)FLi+0Soz3kA{=a?Wi=077g)Z=L&fA?p@FGdhej*nAn7b#O!OA(_N*HhT7~g(o%(t z;gp$WAsH&1P*e<@oJ_Q9>1o$6tlzkt#x(_d=?%g{{v)Qo!$)=S*~`(H8( z*{pdiJvJdRF7e#Wi!n$29QK;%ssethxYB)wg^azl5=G0-$+(7=W;G2H>pB!0=Eflf z|8ig<*+(iu1!cn27FwdN`s29~ub@e>(3ni2*lS}ER;rvvhmPEC-0JKfrT?VLm4(de8y z5`k4d>U>i2@zj&WC5fJ<23pV>R8+U9KrF!;(&*B06pCRJGxeHPt7z#N=~k+y7RSlS zYVM0HM!ci`eOpu9P@aG0LeHDm~y|98^;SgDZ87 zRk0Kla=Qva0kw*4{hHOQR?)3pOSekaE2%K?a7tX*vD*K>{~LhS$0cE@sRshiL>(V! zbys$*`sYy%@qdpuqSaC^p2$c`%`Z#w*O8TnSw)#G;}9m8LmH(QE=Mu4(XLzpLDH>V z&T3$DEGya02fjIUd+6oF>-PgsdJEh!wpvI01M5f=4=Ql@2aj7{kZd_54bGm2>8PB_ z3$a#!k!ou*yUf6l8=CA<%UKy$E?)sb!ulT${X?N%0Y^hqZ{Ex=YKFysr8nCvuT`Wa zT*wSPUq$Hd0FMho=OC$oLkVqPl#`Qvy0rYbm!hhUo)&A%EDUMUC5fV2N3&u%4LvOl zH8_!P);JR46@2N^<%^ecvM*eU3D3+euBy0EUWPj!d9M6nbxqBqhjpF5H!H{}NgXRb zb2jH{)v53us``f9duCzCs0Yj_CWckZVNC=%NLlRV^4k^pX^B~z>pZWM7fNmxm*2j1yZZHGIe7)KUDqyMx^U%TevFN#k-@qLGcaU9&N3A9niVV8 zGSE=3UdH5m>-D>lo}K~RDQv>AFt^=#K-NBcP>p{+LAZO))$dk2uKIFrX;F2L8(L98 zRW7z7zu?Nf8woCYI|R%D=&IwBjFMWWA_V4;j8ze^eqr^BHH;9~tR+! z?&(o4wynByVi;*!*_7K?3rZnu6D9=BJELhIWxMjwe!sH2+A*kY0*xLh+O^a)>*#5q znlT4O_}RO~CqMm20;S|)BEnfubK*zQ)BGHdjHufAuXh$ry?hb zsV;^|_*6e3B(EXf(YC7&?GLzG5R1T&e6_(;H1ss|ENf|KX;2$OLd+yZj1o@=q?K~B z`Cce+G!HC{3C#cJpBHal!n&+8Ng?qC=L>Nodi0y540kHX$@o1fxmI>7!F@|DCF0Sx zt0C}fIgvgH49R*sjh>o;mXQ@gr$ur52H0(0Bf4v+g;&OE(NpI`+?*T=uUss9^Ln7J zp=X4c}wt#=cY99z8*XrrT)n8#28KkItQ8eqtCSGkun)2~}k z4x9fFHr3w`6S&tbICv#jY)({i@$uwSXDTO$o2u_VuB|FPlUwq*u$>gPMtGNyn#xWy zDZfWIN-GOPRPRtC9%D<5MEtBr#3?<1Awz4_P|Qs0H>_QQL_DftaC8t?emW|BKQ)7D zOm5-1#H5oknY~R-Py4HHU%y&YTlTQK%Yjpni_^q+rsaz$s^{pd+rj=hUO( z8(010N+}VKwWUSEKI0x4924h<*h5mEzOBD{11A?NEfnc;9&N+@9zmE8SE;q^n|YV9 zMH7Dmv)wJPD!}Ht8CQJ$z9*-UBJX;3UTFgvKA~M+MU}<3Gxiz3fzWd_>|+nn9X#N6 zCVii`f1FRqX~Z7#aBVRAIxcPwdTQFWw5Syu1f&$?g&CHzp$d|PTjqG{cB6hZU)N5XOWgq!}66_m$mNZ7~H_U^WHwTdv0M@ zVo)>^rPmD^xCD9Dt)a!xDN|EXEnl%>H4{7M8q|UD?x@g&DGCjF+`Xa(cV1mkLu%tX zPJUsDoqN=`?^ZuuQ*tNskkG03e@_1aq)(}~ORSTn^Dehn(Dwc_P@nA?eQY1lkTfwh zSmE`;A{_Lq>5x0vT6(5+ENq-8x>S7SBM)t>$E4SU@xMrIn+-h=%gO3W@$qtU@}o73 zl?0Szooa8~EcM!>B&{YVI}DJIFFMYUVVlq`5_l6$Ldu`FUbz|y_K+sGiVkt|NDHvg z&_MWWDH1D%x`*=`%gps`ProHS?R`%o+0*ceYG_FdiwN=aOUh_&0~PhW>XO@W*2ZGI zoG3#`#S3+y^o*qgn~HDe9NeQUjFwpA1c|uK z6}Qz=S)d(e%O{_|c=g-#tJl-WYP5G2+JzNSdIAax91PTS^o)%3^o;B1_?=}9HFP~- z<IZ5O}uV$26Gv1^9);(c)4{>WUU>O1i?9HMc4YoOhYYh)PIOpN3R;Fv=d2u~MK8 zBfSC_g{c>>o=;4JgWl`O>3`!Cqe`y_>xgM7Y-CuomWhdxo`H#l8Z9rVYU~klI`7)~ z6X))=^o4HPvYA^*L_}OxRaaY0LD>kcf9qlSb#L=M=4es05PKg2L&|SHCc!VoE<637 z=g%j`#wI78J%90h;>FbK-~TM$>X&pU-*20of$~O18hR!SqYM-C8YTyKuh_&3XHu?I zUdu^}vX>F%<>3|(5|vQaf!P8LO%aWfnj2TWcN)9w)LrUW_d(vlXH z6XNIP6%>^OGD%NgM_ow2thVg3r-{)aKTUoyG!?k%Q3b72j!|S*UhhSE{T%Gm28Rd0 z6>xBLcm(sDdGe{PWlF-O+Jc}1M!Ss#nVHtoW0^OyQf+jK!5rDAFDJk)AgQ7*%uRkg zQczZfkABGu?7vrk63YrV>!f|k&11A~cFuYeC7<>L~ z{P}M|CTVF|MGa+w@NU|~D=ICoqOL5;FD{9Z+9!kvv=+`NLqqSDf0!e|*;S!sZh;S*6JHU({W zPWf4E+vy&3G+;ZwIDA79G7O92h-PQpgi`tE_h(=&F*4eNCxRgXrh^aO`HwuEEHI7F zJXcs)TvMMPam4wkhq*K>9Rnj1>qgEkTX^|}u)-*DtOSQ7T0~4_i|D>nE%mt(w#M7` z9S!pF^;Q!?i_;@+nl5TFJ5`P3>q*ZhCP%^NvW3vz29_|r@Ny1F$dP*%*qn3a_pe^R zQ-AkVi09Gpzyn%*40J3TfQaVe;pZ0+6v7B|3JDAIvU6*=oo{Zs5an!UU}Edz@8=if zBqb)nFZv2HYyxP)paa37`>rA`8RH<-(M~}j5mXh*iP&g+H1`6STVF3Kt$JL1GTbjX zE>KC>#}=|PzG-w%K8@&Fmo9Z2G{QVu&%nIGWBLbPVZ)A_Z-P zIhdc2#-P0n^blKME`s=U2wc!-tRV;e4(46CQP+a2t1K$Gbm7v)(`oTBQE_RfF6QUw zUChnRyIfdOS@j6kA!0lZ!c(^nOaa+Bx*ZJ+4GHqo5JXGRhC#+5C?xN4Zqz9fW^C_B zUpHcx&VXwpCe9 zN>W;0P1gvF0BsL@_yvcD2Zz~+q9vtPr2-21kIi2ME*AdPQsZ)|VH!5eNuYX_iOo$ZfZ zu-8iNfl}SW>zB`ECPf8$I3BPt+YYZ?R1^XB6$dF1c5x|LMRi@{-3J_8J$)fjn9v|E zW#pC4Mg&iMXRH}vtYf0M^UZ%=yc`<^?3;iG%K~CcJIv03X9=#Mt+A@9y_?_@aJ}R< z7#=>Ux|Vk?D>*vY3;BG5$u=ELRnU?Y7lUMRh)c@CvQ{IQLUwkCWQAcd!68l(B51TI zYYm7snt5V9v^`yR^^#tKo9g87U_Z>$)Z<$T-A!#^K+;eTHj#C0gqE%#uj?h1b&a*v z_lqu`%>-XaA6Hvza?;dQ6lJ9)F=$Q+2@q4!f(3atj;`=>CnOv!i$bjhMa9JhHg~3x zmSvkp9MSeLyhwWU8XT8_@oXj#nwuNy@QpYCzUrF^tqo6bxCUYm_QAWku%et8AMC_6;~JV_VzsG((Ax5(wvB*qXu>^i#y6%o7Z%^FuCK1TU2q=U z+pvM&WD6-%_=<*xs*=1cMutrmUI3_R8SL0?ZRdQ%+dl|iP=*EuY~{zGsU%j$0Sx(A z2y39bO_%2p=>=jA`*freZW_%n58YZ1mI^Ik!9r|p1gy0AQR|t*mx{|C);+p^EB{Pp z%CT^NvisLA6OhwX1ppW;yB=QYsc+q8x(8|qB_A;%L7s}jSjlA@bRlgilDjbGI=iJ( zNblcHzWi-spbut4Iso%*fMtQTEriy_PC|WS|9Pjdy1sLV&lZWMCH6Sdc&Ss2^t}LI>Gt!G!FKeHS z{LzlD@SqSY0THYil{l3@!a_1gU?kT|tjQz2n3{gs^$=H(|6&r~ z(MuTUBlKZ9M0=lB+_-fER~}Io+0byuEA?9Ook#a7N-t!lK`#RE7eZaa^t&ch6hw|( zZYF@SQgSjPA{43#uV{oA6_?O-63H-E-g4hQOWni&{Q2_Lo2kjcH0OwvhUqC7THuLY z{bSRuC5H~A9ldlup)#}?_wZ;!@%8ficWz!kpOFkswm`4~b_pd1;IWcIq%14+R@#OD zL(XO;HZ&kWhc6OMB}tV9BxHmo#!c77lt_C0$MnSb$Z_BMm1%wn&BOg2{bQqTH%^}l zcMllqiQ8XP9^Bql>lIa8eB%y$#o{c|8T+_7BG4t$ZG9-XnHDgUlbDb|FC{_vG=>;s z8A3vu?b*NokYWVsd2Q$Ke?E&!8tSNcP?qJJ&@+L*dMYg`<@UY%nA>&1M;b3-hC5q) zgG!3wrg<$tI~5!Z5z{>&zl@P4_o3kQcYw>bi^tJ`kgy1(o*b4Gfy9ZiHUJ5ky#^zu z$00KG?_^tLb8}kW_{hk3{S#tMSX^#gY-SnwLbhDoZ+s#?VInf+N=xSXhEI0UO7eS_yDi$N^z7kQ3a}4yg+e(9zM~lt7xCem7m~ zZdv!o=7hLi z&a`lHJ(<1F9Cr8igIXC0B^R=jPaNd9l>S0oA@$U^8A)1^-eaC?jN^MBg(cPCOV4B+ zKY4!`9JjB<1{^P{?jP=d8h!J{i4!9o9XAdn7F@Yfkay-p0@feUCEjCn6#&D9}Y( z6y%t#5tQ!2HfI;(WAN3ii5D;1uSH{1)3a}O^mesZ#$m9hAGdacgT}GDZ(kN9j1VJB zU-k8koVLh1ckcZ8tT=2~0Kmrx_%*-ml+>UZK#y{SoS6}rQ2&r!{1TCpR8rJIPO_SY{>7>`cPd^CW zZd(rH#*W*uA*mOy#iiA~8tdsEnZ{SvSDrrSRM=k^)-VASWOcH6LUvkm3Y46ev(t>R z^IWS_P|?&wnt>~&w*+UdkUattkd>mF`arH+!@=aKohs8{SV33=$j8nmQ%ML}5ex+?*Zu!`hP%CC3VQ6f)d`ksaK>!!Th% zeu4VJ@=UrWZ0s#DJvidt>#@GU z_ZR$!U!2^Zk@R44Vx+S^UjIl$2$YGNqrJ`EUGqu~p7k|gAY@I>%aG8}AirR9ag}IQ zDkbh-q*gL=^G*MKKJsp5?$xW6k4Hua=J`SP_x?7X7ZU#P_2jGc_&21esGidiY1LDs zjSs{1oc+9k5Og?r06r;(@JZww9V>j4LK6lj2OJ?Q1A~Ku{DQ0{#F3noVK#T#^WA6tU8?$ce(nCqt?y?*88ES04DLK(2fc6@{{4-?vDPE;e`pvsnLrDVfTD7FGeR{5S|R>TUFkx z$aB%s+qrx9F0&ngr)$Ad9;9oAQiD7AZW#U_@$hi>^W6oH9h!)m)N%mux2K}-kzP+v zzZx5OHb5MJN5O^6AfJ!Co^lN>+n+$10yD^epB%h3P<_2H*GorD4@?BN>FaLQK)Nnj ztPCp*y^scHb;$9sqopkbU3< z39IqI3sPjp3$orizR=k&>e25LFNfUkPPdKsJ-nCeZ=#IM7lVf&GW3#(kYWrgMlcZ@FDL)+`l)YHL1V$TquLESx_V8`2ym_hcmcY*IP#SF6lkG$x&4;-7`4rC|T z2EXZShcC9n!@{HD>|je>n6HFaK)uFOmF zIj~(zNmfb%BZdN-Z&oSAt>6K)YnPsxh4pstSw$FLLiquVnB4{M@g|1*dwSa&8=9Me z73v{^!(JDW*pJ|k{atv96XcuPqxk37LSUWk)288`+r_sA$@pU{0e7z~FD=x0pAkHp z!lbaIl(d2@THI`(g^kgk-IgCILK;Ew{QZ~z`)7J=bf6R8jBjpjZRrPJLIR;3R)G-a zO@t0G6dmdVR+upIBm%w$cPo+zPLP9r0|SHoeLbUy6J%#MtY#(P zs_&QPoy*BSk(PWsF&6MgcIQt8B_*L0DflBZ;sm)x^GN!g&ew0oz{|3`8`!TWO&$2| z-d?bs9UAEA3_m$sJ$B=0RU_nhZzniG0z!!Egx~v`px}uu_{aBdS6nYFEXd0=MVuh_ z*nE;&1@(bEM~ zA}l$D)rC#1P5AE4&i<*1$Fok5l1B{ZH3n@Fnl>YXAa)K3cf?P&-(0oqEz=)IHsydS- z{{<(=6>LI!?rD|8F(|vCk?!`v&Nj%h&R(bwV9EpK)3vUxr2!9ShwbehT^&%KePy~c z_@k7y1-Wf&n`rY$9exP-W9`CDkQ`t(xJFRTF0lkR0SgBw;9XZctlxu%2j6Q4xsDcG zBfbmYQs2}JJ;3PHbWI@H33AnH#>6}`I z8-6wY?8Vq9v7?g+X2HbK(N`U%-*AHbG`M+AklIcuH*g~_rocXQbf9l^eC*|`D$LiM zAbGy-1gY&9SNNoV3g(a|r>6eI6@2alxmf&>>;!o%ucq(Se@WBz?%(MIxryQg=@fIZ zqs)BqPLS;1?F9J?@kbxUBd#cvCNNH4QCHLozbJWEA|51zb`&ws5kp zXWOs=W>4j`G!(!*0p8ZCDJm*S^Kag~o`IH{8jNUQZj_dK<#H-2pyGdYqgt_Q73jkh zCzd76Jc9h(oB8=T*}-5$ zNLp20QE98TnyP}dxQK`-Kj(TzdRkgK1_lOt&_@dY$Mu&%1XiwE19NvQtZW-OHfF8)Ep@sPQ1O<7vu&-mFLuw2I1MTXcO#iZFPy<$j zJ~O0!(`H^UOWX|e=^_FG0^$;4JZx(j*aSp{#iRf;RhJdz=i%n%<=Mi)%ESQbj0|gO zSFiZF@+a#<{R6AmjqEU?$S)uSHC#}LhgTE^@Pb^->p8i2#U#+;q7t$If%5UdY#T#6`Hdg$1|pi34&f%+Joj$^YYVW${QNvyxWFEY3tGp9bpT6JuR%poyc%C}4djkBjf2#k7F2gVBQIZ-IO4Jg$81x^V^{apQ94#?By;I0Kio_A>K zye`D?!Mr0McBN52)&5W@vFsUZ>knZru=j9V<^o6IPzwt66YU?xc5>lh7k^Y1sXRZr z9Rbt3pWJ}q{?Tpoy`R)ZF0c7fb(9$}Za=>@{HT85&ub$gRQ;fS($dJ2vVKfId5Ppn z4nL&tzf|%hz8}#ySTgyZACYHTOqaK~C`SK?{_Vwuy_mCvf1vx-TTH-Q+uorXI36THZ+b`#00$$`foIjv{WRYPn z;moz{_GxHJ^1oAG|JwmC?u_!;k@xrIzt-YH|MpqjvkCt`eaUZ!yr?rS%ys+U zr_Tn=!%}P-v&oI--)US5b<%s7>6zKSFa4<8CDAXMRfj%kZg){T;Y*^gH>>r% z@~B-)q5u4Y{P#wHXDJ@L62C{E-REZ3*4YbCsQM+y0Q5|7$o=nI!<{{qM>CO&`hiUvSi(_~^)w{GmBN{j>XD_!qu` z@W}?NbboI9edVmyw~OEK=cE?A`sS?sBF0}+3x@D>2fb$Xzg_)fe@-t-Mkv!@8JbiNiyKw#Q{#E+Ei_%Z~Rq`Z-PxKd@|5>u9yw8&HcJAI!zWG8OTp<5f z{`|bkXTmcF?#?Bjq7VQ7aAbDx`j@W$`Qt&e8t^Zr^Zi`^7j=B($ZLJ9k3?eL5%TUT z@H+Ta+kfB#xgRz}`*VG;u=!j&|fz0dR&f0;N0oco#nXV3p5zf#}*oBDpgQl6yo znf@pF&-6>>|NBw(Bgf?v{a@JhA!UTmlK)Blm;a^7U$FXp)c$*Zt-jwk(r@=`9uQtA-P9l}fseag*r_b}%i;}5cPd-L>bmq6lc zK}^hv&fEE*Z}zoom*O|ed9ri6bNb8PEQQ8b!swjSoWC=t|Ent>iGRNA-2SY-#8+az zBtIRVll*9BR)26wM7|sdz-|j}Gy2#sU%4c|oL^8J4pQ{_mqg^tfuwy&en$V7J#JB= zi%hZ-Cv*(A?@onLmGnS!rv)blg zx+MF++%9q>_kTRrC-F<7I}^wk?llWVX>Rz-~{9 z@GOl!ITR6_O#J`8FA@pgB|mfj|JpU1%n}|he$H`jcIj(D&iid<{59{$Lc2_Q;dd8T zDfJh+{42*6r;h|czZG-mo6iXI-fw2@ zXB1oWB?>L_)8N1P_xI}~L2finYFePPe)&zg&rbL;eIyvJeJ2T@6vd9ug8$}$AJ<2M z7C4yO_aP3=-&FhjgrCz#!jm{sG)ay_GQySF9LM^w2N zIpF&whD)aZNw|ysbHV%XVlQ5T^Zvj75@g~}1o8ho|B(n#CW06IKP71k{xs8czVO?E WhsmLR^b3` +#endif diff --git a/libircclient/cocoa/Info.plist b/libircclient/cocoa/Info.plist new file mode 100644 index 0000000..2f3b68c --- /dev/null +++ b/libircclient/cocoa/Info.plist @@ -0,0 +1,26 @@ + + + + + CFBundleDevelopmentRegion + English + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIconFile + + CFBundleIdentifier + net.stupendous.${PRODUCT_NAME:identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + FMWK + CFBundleSignature + ???? + CFBundleVersion + 1.0 + NSPrincipalClass + + + diff --git a/libircclient/cocoa/LICENSE b/libircclient/cocoa/LICENSE new file mode 100644 index 0000000..161a3d1 --- /dev/null +++ b/libircclient/cocoa/LICENSE @@ -0,0 +1,482 @@ + GNU LIBRARY GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1991 Free Software Foundation, Inc. + 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + +[This is the first released version of the library GPL. It is + numbered 2 because it goes with version 2 of the ordinary GPL.] + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +Licenses are intended to guarantee your freedom to share and change +free software--to make sure the software is free for all its users. + + This license, the Library General Public License, applies to some +specially designated Free Software Foundation software, and to any +other libraries whose authors decide to use it. You can use it for +your libraries, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if +you distribute copies of the library, or if you modify it. + + For example, if you distribute copies of the library, whether gratis +or for a fee, you must give the recipients all the rights that we gave +you. You must make sure that they, too, receive or can get the source +code. If you link a program with the library, you must provide +complete object files to the recipients so that they can relink them +with the library, after making changes to the library and recompiling +it. And you must show them these terms so they know their rights. + + Our method of protecting your rights has two steps: (1) copyright +the library, and (2) offer you this license which gives you legal +permission to copy, distribute and/or modify the library. + + Also, for each distributor's protection, we want to make certain +that everyone understands that there is no warranty for this free +library. If the library is modified by someone else and passed on, we +want its recipients to know that what they have is not the original +version, so that any problems introduced by others will not reflect on +the original authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that companies distributing free +software will individually obtain patent licenses, thus in effect +transforming the program into proprietary software. To prevent this, +we have made it clear that any patent must be licensed for everyone's +free use or not licensed at all. + + Most GNU software, including some libraries, is covered by the ordinary +GNU General Public License, which was designed for utility programs. This +license, the GNU Library General Public License, applies to certain +designated libraries. This license is quite different from the ordinary +one; be sure to read it in full, and don't assume that anything in it is +the same as in the ordinary license. + + The reason we have a separate public license for some libraries is that +they blur the distinction we usually make between modifying or adding to a +program and simply using it. Linking a program with a library, without +changing the library, is in some sense simply using the library, and is +analogous to running a utility program or application program. However, in +a textual and legal sense, the linked executable is a combined work, a +derivative of the original library, and the ordinary General Public License +treats it as such. + + Because of this blurred distinction, using the ordinary General +Public License for libraries did not effectively promote software +sharing, because most developers did not use the libraries. We +concluded that weaker conditions might promote sharing better. + + However, unrestricted linking of non-free programs would deprive the +users of those programs of all benefit from the free status of the +libraries themselves. This Library General Public License is intended to +permit developers of non-free programs to use free libraries, while +preserving your freedom as a user of such programs to change the free +libraries that are incorporated in them. (We have not seen how to achieve +this as regards changes in header files, but we have achieved it as regards +changes in the actual functions of the Library.) The hope is that this +will lead to faster development of free libraries. + + The precise terms and conditions for copying, distribution and +modification follow. Pay close attention to the difference between a +"work based on the library" and a "work that uses the library". The +former contains code derived from the library, while the latter only +works together with the library. + + Note that it is possible for a library to be covered by the ordinary +General Public License rather than by this special one. + + GNU LIBRARY GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License Agreement applies to any software library which +contains a notice placed by the copyright holder or other authorized +party saying it may be distributed under the terms of this Library +General Public License (also called "this License"). Each licensee is +addressed as "you". + + A "library" means a collection of software functions and/or data +prepared so as to be conveniently linked with application programs +(which use some of those functions and data) to form executables. + + The "Library", below, refers to any such software library or work +which has been distributed under these terms. A "work based on the +Library" means either the Library or any derivative work under +copyright law: that is to say, a work containing the Library or a +portion of it, either verbatim or with modifications and/or translated +straightforwardly into another language. (Hereinafter, translation is +included without limitation in the term "modification".) + + "Source code" for a work means the preferred form of the work for +making modifications to it. For a library, complete source code means +all the source code for all modules it contains, plus any associated +interface definition files, plus the scripts used to control compilation +and installation of the library. + + Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running a program using the Library is not restricted, and output from +such a program is covered only if its contents constitute a work based +on the Library (independent of the use of the Library in a tool for +writing it). Whether that is true depends on what the Library does +and what the program that uses the Library does. + + 1. You may copy and distribute verbatim copies of the Library's +complete source code as you receive it, in any medium, provided that +you conspicuously and appropriately publish on each copy an +appropriate copyright notice and disclaimer of warranty; keep intact +all the notices that refer to this License and to the absence of any +warranty; and distribute a copy of this License along with the +Library. + + You may charge a fee for the physical act of transferring a copy, +and you may at your option offer warranty protection in exchange for a +fee. + + 2. You may modify your copy or copies of the Library or any portion +of it, thus forming a work based on the Library, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) The modified work must itself be a software library. + + b) You must cause the files modified to carry prominent notices + stating that you changed the files and the date of any change. + + c) You must cause the whole of the work to be licensed at no + charge to all third parties under the terms of this License. + + d) If a facility in the modified Library refers to a function or a + table of data to be supplied by an application program that uses + the facility, other than as an argument passed when the facility + is invoked, then you must make a good faith effort to ensure that, + in the event an application does not supply such function or + table, the facility still operates, and performs whatever part of + its purpose remains meaningful. + + (For example, a function in a library to compute square roots has + a purpose that is entirely well-defined independent of the + application. Therefore, Subsection 2d requires that any + application-supplied function or table used by this function must + be optional: if the application does not supply it, the square + root function must still compute square roots.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Library, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Library, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote +it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Library. + +In addition, mere aggregation of another work not based on the Library +with the Library (or with a work based on the Library) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may opt to apply the terms of the ordinary GNU General Public +License instead of this License to a given copy of the Library. To do +this, you must alter all the notices that refer to this License, so +that they refer to the ordinary GNU General Public License, version 2, +instead of to this License. (If a newer version than version 2 of the +ordinary GNU General Public License has appeared, then you can specify +that version instead if you wish.) Do not make any other change in +these notices. + + Once this change is made in a given copy, it is irreversible for +that copy, so the ordinary GNU General Public License applies to all +subsequent copies and derivative works made from that copy. + + This option is useful when you wish to copy part of the code of +the Library into a program that is not a library. + + 4. You may copy and distribute the Library (or a portion or +derivative of it, under Section 2) in object code or executable form +under the terms of Sections 1 and 2 above provided that you accompany +it with the complete corresponding machine-readable source code, which +must be distributed under the terms of Sections 1 and 2 above on a +medium customarily used for software interchange. + + If distribution of object code is made by offering access to copy +from a designated place, then offering equivalent access to copy the +source code from the same place satisfies the requirement to +distribute the source code, even though third parties are not +compelled to copy the source along with the object code. + + 5. A program that contains no derivative of any portion of the +Library, but is designed to work with the Library by being compiled or +linked with it, is called a "work that uses the Library". Such a +work, in isolation, is not a derivative work of the Library, and +therefore falls outside the scope of this License. + + However, linking a "work that uses the Library" with the Library +creates an executable that is a derivative of the Library (because it +contains portions of the Library), rather than a "work that uses the +library". The executable is therefore covered by this License. +Section 6 states terms for distribution of such executables. + + When a "work that uses the Library" uses material from a header file +that is part of the Library, the object code for the work may be a +derivative work of the Library even though the source code is not. +Whether this is true is especially significant if the work can be +linked without the Library, or if the work is itself a library. The +threshold for this to be true is not precisely defined by law. + + If such an object file uses only numerical parameters, data +structure layouts and accessors, and small macros and small inline +functions (ten lines or less in length), then the use of the object +file is unrestricted, regardless of whether it is legally a derivative +work. (Executables containing this object code plus portions of the +Library will still fall under Section 6.) + + Otherwise, if the work is a derivative of the Library, you may +distribute the object code for the work under the terms of Section 6. +Any executables containing that work also fall under Section 6, +whether or not they are linked directly with the Library itself. + + 6. As an exception to the Sections above, you may also compile or +link a "work that uses the Library" with the Library to produce a +work containing portions of the Library, and distribute that work +under terms of your choice, provided that the terms permit +modification of the work for the customer's own use and reverse +engineering for debugging such modifications. + + You must give prominent notice with each copy of the work that the +Library is used in it and that the Library and its use are covered by +this License. You must supply a copy of this License. If the work +during execution displays copyright notices, you must include the +copyright notice for the Library among them, as well as a reference +directing the user to the copy of this License. Also, you must do one +of these things: + + a) Accompany the work with the complete corresponding + machine-readable source code for the Library including whatever + changes were used in the work (which must be distributed under + Sections 1 and 2 above); and, if the work is an executable linked + with the Library, with the complete machine-readable "work that + uses the Library", as object code and/or source code, so that the + user can modify the Library and then relink to produce a modified + executable containing the modified Library. (It is understood + that the user who changes the contents of definitions files in the + Library will not necessarily be able to recompile the application + to use the modified definitions.) + + b) Accompany the work with a written offer, valid for at + least three years, to give the same user the materials + specified in Subsection 6a, above, for a charge no more + than the cost of performing this distribution. + + c) If distribution of the work is made by offering access to copy + from a designated place, offer equivalent access to copy the above + specified materials from the same place. + + d) Verify that the user has already received a copy of these + materials or that you have already sent this user a copy. + + For an executable, the required form of the "work that uses the +Library" must include any data and utility programs needed for +reproducing the executable from it. However, as a special exception, +the source code distributed need not include anything that is normally +distributed (in either source or binary form) with the major +components (compiler, kernel, and so on) of the operating system on +which the executable runs, unless that component itself accompanies +the executable. + + It may happen that this requirement contradicts the license +restrictions of other proprietary libraries that do not normally +accompany the operating system. Such a contradiction means you cannot +use both them and the Library together in an executable that you +distribute. + + 7. You may place library facilities that are a work based on the +Library side-by-side in a single library together with other library +facilities not covered by this License, and distribute such a combined +library, provided that the separate distribution of the work based on +the Library and of the other library facilities is otherwise +permitted, and provided that you do these two things: + + a) Accompany the combined library with a copy of the same work + based on the Library, uncombined with any other library + facilities. This must be distributed under the terms of the + Sections above. + + b) Give prominent notice with the combined library of the fact + that part of it is a work based on the Library, and explaining + where to find the accompanying uncombined form of the same work. + + 8. You may not copy, modify, sublicense, link with, or distribute +the Library except as expressly provided under this License. Any +attempt otherwise to copy, modify, sublicense, link with, or +distribute the Library is void, and will automatically terminate your +rights under this License. However, parties who have received copies, +or rights, from you under this License will not have their licenses +terminated so long as such parties remain in full compliance. + + 9. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Library or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Library (or any work based on the +Library), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Library or works based on it. + + 10. Each time you redistribute the Library (or any work based on the +Library), the recipient automatically receives a license from the +original licensor to copy, distribute, link with or modify the Library +subject to these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 11. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Library at all. For example, if a patent +license would not permit royalty-free redistribution of the Library by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Library. + +If any portion of this section is held invalid or unenforceable under any +particular circumstance, the balance of the section is intended to apply, +and the section as a whole is intended to apply in other circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 12. If the distribution and/or use of the Library is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Library under this License may add +an explicit geographical distribution limitation excluding those countries, +so that distribution is permitted only in or among countries not thus +excluded. In such case, this License incorporates the limitation as if +written in the body of this License. + + 13. The Free Software Foundation may publish revised and/or new +versions of the Library General Public License from time to time. +Such new versions will be similar in spirit to the present version, +but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Library +specifies a version number of this License which applies to it and +"any later version", you have the option of following the terms and +conditions either of that version or of any later version published by +the Free Software Foundation. If the Library does not specify a +license version number, you may choose any version ever published by +the Free Software Foundation. + + 14. If you wish to incorporate parts of the Library into other free +programs whose distribution conditions are incompatible with these, +write to the author to ask for permission. For software which is +copyrighted by the Free Software Foundation, write to the Free +Software Foundation; we sometimes make exceptions for this. Our +decision will be guided by the two goals of preserving the free status +of all derivatives of our free software and of promoting the sharing +and reuse of software generally. + + NO WARRANTY + + 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO +WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. +EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR +OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY +KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE +LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME +THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN +WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY +AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU +FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR +CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE +LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING +RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A +FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF +SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGES. + + END OF TERMS AND CONDITIONS + + Appendix: How to Apply These Terms to Your New Libraries + + If you develop a new library, and you want it to be of the greatest +possible use to the public, we recommend making it free software that +everyone can redistribute and change. You can do so by permitting +redistribution under these terms (or, alternatively, under the terms of the +ordinary General Public License). + + To apply these terms, attach the following notices to the library. It is +safest to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least the +"copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, + MA 02111-1307, USA + +Also add information on how to contact you by electronic and paper mail. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the library, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the + library `Frob' (a library for tweaking knobs) written by James Random Hacker. + + , 1 April 1990 + Ty Coon, President of Vice + +That's all there is to it! diff --git a/libircclient/cocoa/README b/libircclient/cocoa/README new file mode 100644 index 0000000..73b3419 --- /dev/null +++ b/libircclient/cocoa/README @@ -0,0 +1,21 @@ +IRCClient.framework 1.0 by Nathan Ollerenshaw (chrome@stupendous.net) + +This is a Cocoa framework wrapper around Georgy Yunaev's (gyunaev@ulduzsoft.com) +excellent libircclient library. + +While Georgy's library is portable, obviously this Cocoa framework is specific +to Mac OS X systems. Though you might be able to get it working under +cocotron or GNUstep, those implementations of Cocoa are not supported. + +To build the framework, you will need to configure libircclient library first. +From the Terminal, run the following command in the distribution directory: + + ./configure --enable-thread --enable-ipv6 + +The Xcode project is configured to include the libircclient.c source. + +The framework is configured to build with a relative path of ../Frameworks/ so +it can be easily embedded in your application. + +For documentation, examine the header files or read the Doxygen documentations +in 'doc'. diff --git a/libircclient/cocoa/doc/html/_d_d_invocation_grabber_8h-source.html b/libircclient/cocoa/doc/html/_d_d_invocation_grabber_8h-source.html new file mode 100644 index 0000000..89e4d9b --- /dev/null +++ b/libircclient/cocoa/doc/html/_d_d_invocation_grabber_8h-source.html @@ -0,0 +1,140 @@ + + +IRCClient: DDInvocationGrabber.h Source File + + + + + +
Generated on Sat Jan 10 18:10:37 2009 for IRCClient by  + +doxygen 1.5.7.1
+ + diff --git a/libircclient/cocoa/doc/html/_i_r_c_client_channel_8h-source.html b/libircclient/cocoa/doc/html/_i_r_c_client_channel_8h-source.html new file mode 100644 index 0000000..2fcd78a --- /dev/null +++ b/libircclient/cocoa/doc/html/_i_r_c_client_channel_8h-source.html @@ -0,0 +1,89 @@ + + +IRCClient: IRCClientChannel.h Source File + + + + + +
Generated on Sat Jan 10 18:10:37 2009 for IRCClient by  + +doxygen 1.5.7.1
+ + diff --git a/libircclient/cocoa/doc/html/_i_r_c_client_channel_8h.html b/libircclient/cocoa/doc/html/_i_r_c_client_channel_8h.html new file mode 100644 index 0000000..deed46e --- /dev/null +++ b/libircclient/cocoa/doc/html/_i_r_c_client_channel_8h.html @@ -0,0 +1,48 @@ + + +IRCClient: IRCClientChannel.h File Reference + + + + + +
+

IRCClientChannel.h File Reference

Represents a connected IRC Channel. +More... +

+#import <Cocoa/Cocoa.h>
+#import "IRCClientChannelDelegate.h"
+ +

+Go to the source code of this file. + + + + + +

Classes

class  IRCClientChannel
 Represents a connected IRC Channel. More...
+


Detailed Description

+Represents a connected IRC Channel. +

+

Author:
Nathan Ollerenshaw
+
Version:
1.0
+
Date:
01.2009
+
+
Generated on Sat Jan 10 18:10:37 2009 for IRCClient by  + +doxygen 1.5.7.1
+ + diff --git a/libircclient/cocoa/doc/html/_i_r_c_client_channel_delegate_8h-source.html b/libircclient/cocoa/doc/html/_i_r_c_client_channel_delegate_8h-source.html new file mode 100644 index 0000000..84d9a6e --- /dev/null +++ b/libircclient/cocoa/doc/html/_i_r_c_client_channel_delegate_8h-source.html @@ -0,0 +1,61 @@ + + +IRCClient: IRCClientChannelDelegate.h Source File + + + + + +
Generated on Sat Jan 10 18:10:37 2009 for IRCClient by  + +doxygen 1.5.7.1
+ + diff --git a/libircclient/cocoa/doc/html/_i_r_c_client_channel_delegate_8h.html b/libircclient/cocoa/doc/html/_i_r_c_client_channel_delegate_8h.html new file mode 100644 index 0000000..3201b56 --- /dev/null +++ b/libircclient/cocoa/doc/html/_i_r_c_client_channel_delegate_8h.html @@ -0,0 +1,51 @@ + + +IRCClient: IRCClientChannelDelegate.h File Reference + + + + + +
+

IRCClientChannelDelegate.h File Reference

Receives delegate messages from an IRCClientChannel. +More... +

+#import <Cocoa/Cocoa.h>
+ +

+Go to the source code of this file. + + + + + +

Classes

class  NSObject(IRCClientChannelDelegate)
 Receives delegate messages from an IRCClientChannel. More...
+


Detailed Description

+Receives delegate messages from an IRCClientChannel. +

+Receives delegate messages from an IRCClientSession.

+

Author:
Nathan Ollerenshaw
+
Version:
1.0
+
Date:
01.2009
+
Author:
Nathan Ollerenshaw
+
Version:
1.0
+
Date:
01.2009
+
+
Generated on Sat Jan 10 18:10:37 2009 for IRCClient by  + +doxygen 1.5.7.1
+ + diff --git a/libircclient/cocoa/doc/html/_i_r_c_client_session_8h-source.html b/libircclient/cocoa/doc/html/_i_r_c_client_session_8h-source.html new file mode 100644 index 0000000..08fb446 --- /dev/null +++ b/libircclient/cocoa/doc/html/_i_r_c_client_session_8h-source.html @@ -0,0 +1,107 @@ + + +IRCClient: IRCClientSession.h Source File + + + + + +
Generated on Sat Jan 10 18:10:37 2009 for IRCClient by  + +doxygen 1.5.7.1
+ + diff --git a/libircclient/cocoa/doc/html/_i_r_c_client_session_8h.html b/libircclient/cocoa/doc/html/_i_r_c_client_session_8h.html new file mode 100644 index 0000000..e1c326d --- /dev/null +++ b/libircclient/cocoa/doc/html/_i_r_c_client_session_8h.html @@ -0,0 +1,49 @@ + + +IRCClient: IRCClientSession.h File Reference + + + + + +
+

IRCClientSession.h File Reference

Represents a connected IRC Session. +More... +

+#import <Cocoa/Cocoa.h>
+#import "IRCClientSessionDelegate.h"
+#include "libircclient.h"
+ +

+Go to the source code of this file. + + + + + +

Classes

class  IRCClientSession
 Represents a connected IRC Session. More...
+


Detailed Description

+Represents a connected IRC Session. +

+

Author:
Nathan Ollerenshaw
+
Version:
1.0
+
Date:
01.2009
+
+
Generated on Sat Jan 10 18:10:37 2009 for IRCClient by  + +doxygen 1.5.7.1
+ + diff --git a/libircclient/cocoa/doc/html/_i_r_c_client_session_delegate_8h-source.html b/libircclient/cocoa/doc/html/_i_r_c_client_session_delegate_8h-source.html new file mode 100644 index 0000000..3956a00 --- /dev/null +++ b/libircclient/cocoa/doc/html/_i_r_c_client_session_delegate_8h-source.html @@ -0,0 +1,74 @@ + + +IRCClient: IRCClientSessionDelegate.h Source File + + + + + +
Generated on Sat Jan 10 18:10:37 2009 for IRCClient by  + +doxygen 1.5.7.1
+ + diff --git a/libircclient/cocoa/doc/html/_n_s_object_09_d_d_extensions_8h-source.html b/libircclient/cocoa/doc/html/_n_s_object_09_d_d_extensions_8h-source.html new file mode 100644 index 0000000..2298efe --- /dev/null +++ b/libircclient/cocoa/doc/html/_n_s_object_09_d_d_extensions_8h-source.html @@ -0,0 +1,61 @@ + + +IRCClient: NSObject+DDExtensions.h Source File + + + + + +
Generated on Sat Jan 10 18:10:37 2009 for IRCClient by  + +doxygen 1.5.7.1
+ + diff --git a/libircclient/cocoa/doc/html/annotated.html b/libircclient/cocoa/doc/html/annotated.html new file mode 100644 index 0000000..24fb098 --- /dev/null +++ b/libircclient/cocoa/doc/html/annotated.html @@ -0,0 +1,36 @@ + + +IRCClient: Class List + + + + + +
+

Class List

Here are the classes, structs, unions and interfaces with brief descriptions: + + + + +
IRCClientChannelRepresents a connected IRC Channel
IRCClientSessionRepresents a connected IRC Session
NSObject(IRCClientChannelDelegate)Receives delegate messages from an IRCClientChannel
NSObject(IRCClientSessionDelegate)Receives delegate messages from an IRCClientSession
+
+
Generated on Sat Jan 10 18:10:37 2009 for IRCClient by  + +doxygen 1.5.7.1
+ + diff --git a/libircclient/cocoa/doc/html/class_i_r_c_client_channel-members.html b/libircclient/cocoa/doc/html/class_i_r_c_client_channel-members.html new file mode 100644 index 0000000..3c68fef --- /dev/null +++ b/libircclient/cocoa/doc/html/class_i_r_c_client_channel-members.html @@ -0,0 +1,55 @@ + + +IRCClient: Member List + + + + + + +
Generated on Sat Jan 10 18:10:37 2009 for IRCClient by  + +doxygen 1.5.7.1
+ + diff --git a/libircclient/cocoa/doc/html/class_i_r_c_client_session-members.html b/libircclient/cocoa/doc/html/class_i_r_c_client_session-members.html new file mode 100644 index 0000000..6c49a3a --- /dev/null +++ b/libircclient/cocoa/doc/html/class_i_r_c_client_session-members.html @@ -0,0 +1,69 @@ + + +IRCClient: Member List + + + + + + +
Generated on Sat Jan 10 18:10:37 2009 for IRCClient by  + +doxygen 1.5.7.1
+ + diff --git a/libircclient/cocoa/doc/html/class_n_s_object_07_i_r_c_client_channel_delegate_08-members.html b/libircclient/cocoa/doc/html/class_n_s_object_07_i_r_c_client_channel_delegate_08-members.html new file mode 100644 index 0000000..79f881f --- /dev/null +++ b/libircclient/cocoa/doc/html/class_n_s_object_07_i_r_c_client_channel_delegate_08-members.html @@ -0,0 +1,39 @@ + + +IRCClient: Member List + + + + + + +
Generated on Sat Jan 10 18:10:37 2009 for IRCClient by  + +doxygen 1.5.7.1
+ + diff --git a/libircclient/cocoa/doc/html/class_n_s_object_07_i_r_c_client_session_delegate_08-members.html b/libircclient/cocoa/doc/html/class_n_s_object_07_i_r_c_client_session_delegate_08-members.html new file mode 100644 index 0000000..3c9df4e --- /dev/null +++ b/libircclient/cocoa/doc/html/class_n_s_object_07_i_r_c_client_session_delegate_08-members.html @@ -0,0 +1,44 @@ + + +IRCClient: Member List + + + + + + +
Generated on Sat Jan 10 18:10:37 2009 for IRCClient by  + +doxygen 1.5.7.1
+ + diff --git a/libircclient/cocoa/doc/html/classes.html b/libircclient/cocoa/doc/html/classes.html new file mode 100644 index 0000000..480253e --- /dev/null +++ b/libircclient/cocoa/doc/html/classes.html @@ -0,0 +1,35 @@ + + +IRCClient: Alphabetical List + + + + + +
+

Class Index

I | N

+ +
  I  
+
IRCClientSession   
  N  
+
NSObject(IRCClientChannelDelegate)   NSObject(IRCClientSessionDelegate)   
IRCClientChannel   

I | N

+

+
Generated on Sat Jan 10 18:10:37 2009 for IRCClient by  + +doxygen 1.5.7.1
+ + diff --git a/libircclient/cocoa/doc/html/doxygen.css b/libircclient/cocoa/doc/html/doxygen.css new file mode 100644 index 0000000..9c847c6 --- /dev/null +++ b/libircclient/cocoa/doc/html/doxygen.css @@ -0,0 +1,441 @@ +body, table, div, p, dl { + font-family: Lucida Grande, Verdana, Geneva, Arial, sans-serif; + font-size: 12px; +} + +/* @group Heading Levels */ + +h1 { + text-align: center; + font-size: 150%; +} + +h2 { + font-size: 120%; +} + +h3 { + font-size: 100%; +} + +/* @end */ + +caption { + font-weight: bold; +} + +div.qindex, div.navpath, div.navtab{ + background-color: #e8eef2; + border: 1px solid #84b0c7; + text-align: center; + margin: 2px; + padding: 2px; +} + +div.qindex, div.navpath { + width: 100%; + line-height: 140%; +} + +div.navtab { + margin-right: 15px; +} + +/* @group Link Styling */ + +a { + color: #153788; + font-weight: normal; + text-decoration: none; +} + +.contents a:visited { + color: #1b77c5; +} + +a:hover { + text-decoration: underline; +} + +a.qindex { + font-weight: bold; +} + +a.qindexHL { + font-weight: bold; + background-color: #6666cc; + color: #ffffff; + border: 1px double #9295C2; +} + +a.el { + font-weight: bold; +} + +a.elRef { +} + +a.code { +} + +a.codeRef { +} + +/* @end */ + +dl.el { + margin-left: -1cm; +} + +.fragment { + font-family: monospace, fixed; + font-size: 105%; +} + +pre.fragment { + border: 1px solid #CCCCCC; + background-color: #f5f5f5; + padding: 4px 6px; + margin: 4px 8px 4px 2px; +} + +div.ah { + background-color: black; + font-weight: bold; + color: #ffffff; + margin-bottom: 3px; + margin-top: 3px +} + +div.groupHeader { + margin-left: 16px; + margin-top: 12px; + margin-bottom: 6px; + font-weight: bold; +} + +div.groupText { + margin-left: 16px; + font-style: italic; +} + +body { + background: white; + color: black; + margin-right: 20px; + margin-left: 20px; +} + +td.indexkey { + background-color: #e8eef2; + font-weight: bold; + border: 1px solid #CCCCCC; + margin: 2px 0px 2px 0; + padding: 2px 10px; +} + +td.indexvalue { + background-color: #e8eef2; + border: 1px solid #CCCCCC; + padding: 2px 10px; + margin: 2px 0px; +} + +tr.memlist { + background-color: #f0f0f0; +} + +p.formulaDsp { + text-align: center; +} + +img.formulaDsp { + +} + +img.formulaInl { + vertical-align: middle; +} + +/* @group Code Colorization */ + +span.keyword { + color: #008000 +} + +span.keywordtype { + color: #604020 +} + +span.keywordflow { + color: #e08000 +} + +span.comment { + color: #800000 +} + +span.preprocessor { + color: #806020 +} + +span.stringliteral { + color: #002080 +} + +span.charliteral { + color: #008080 +} + +span.vhdldigit { + color: #ff00ff +} + +span.vhdlchar { + color: #000000 +} + +span.vhdlkeyword { + color: #700070 +} + +span.vhdllogic { + color: #ff0000 +} + +/* @end */ + +.search { + color: #003399; + font-weight: bold; +} + +form.search { + margin-bottom: 0px; + margin-top: 0px; +} + +input.search { + font-size: 75%; + color: #000080; + font-weight: normal; + background-color: #e8eef2; +} + +td.tiny { + font-size: 75%; +} + +.dirtab { + padding: 4px; + border-collapse: collapse; + border: 1px solid #84b0c7; +} + +th.dirtab { + background: #e8eef2; + font-weight: bold; +} + +hr { + height: 0; + border: none; + border-top: 1px solid #666; +} + +/* @group Member Descriptions */ + +.mdescLeft, .mdescRight, +.memItemLeft, .memItemRight, +.memTemplItemLeft, .memTemplItemRight, .memTemplParams { + background-color: #FAFAFA; + border: none; + margin: 4px; + padding: 1px 0 0 8px; +} + +.mdescLeft, .mdescRight { + padding: 0px 8px 4px 8px; + color: #555; +} + +.memItemLeft, .memItemRight, .memTemplParams { + border-top: 1px solid #ccc; +} + +.memTemplParams { + color: #606060; +} + +/* @end */ + +/* @group Member Details */ + +/* Styles for detailed member documentation */ + +.memtemplate { + font-size: 80%; + color: #606060; + font-weight: normal; + margin-left: 3px; +} + +.memnav { + background-color: #e8eef2; + border: 1px solid #84b0c7; + text-align: center; + margin: 2px; + margin-right: 15px; + padding: 2px; +} + +.memitem { + padding: 0; +} + +.memname { + white-space: nowrap; + font-weight: bold; +} + +.memproto, .memdoc { + border: 1px solid #84b0c7; +} + +.memproto { + padding: 0; + background-color: #d5e1e8; + font-weight: bold; + -webkit-border-top-left-radius: 8px; + -webkit-border-top-right-radius: 8px; + -moz-border-radius-topleft: 8px; + -moz-border-radius-topright: 8px; +} + +.memdoc { + padding: 2px 5px; + background-color: #eef3f5; + border-top-width: 0; + -webkit-border-bottom-left-radius: 8px; + -webkit-border-bottom-right-radius: 8px; + -moz-border-radius-bottomleft: 8px; + -moz-border-radius-bottomright: 8px; +} + +.memdoc p, .memdoc dl, .memdoc ul { + margin: 6px 0; +} + +.paramkey { + text-align: right; +} + +.paramtype { + white-space: nowrap; +} + +.paramname { + color: #602020; + white-space: nowrap; +} +.paramname em { + font-style: normal; +} + +/* @end */ + +/* @group Directory (tree) */ + +/* for the tree view */ + +.ftvtree { + font-family: sans-serif; + margin: 0.5em; +} + +/* these are for tree view when used as main index */ + +.directory { + font-size: 9pt; + font-weight: bold; +} + +.directory h3 { + margin: 0px; + margin-top: 1em; + font-size: 11pt; +} + +/* +The following two styles can be used to replace the root node title +with an image of your choice. Simply uncomment the next two styles, +specify the name of your image and be sure to set 'height' to the +proper pixel height of your image. +*/ + +/* +.directory h3.swap { + height: 61px; + background-repeat: no-repeat; + background-image: url("yourimage.gif"); +} +.directory h3.swap span { + display: none; +} +*/ + +.directory > h3 { + margin-top: 0; +} + +.directory p { + margin: 0px; + white-space: nowrap; +} + +.directory div { + display: none; + margin: 0px; +} + +.directory img { + vertical-align: -30%; +} + +/* these are for tree view when not used as main index */ + +.directory-alt { + font-size: 100%; + font-weight: bold; +} + +.directory-alt h3 { + margin: 0px; + margin-top: 1em; + font-size: 11pt; +} + +.directory-alt > h3 { + margin-top: 0; +} + +.directory-alt p { + margin: 0px; + white-space: nowrap; +} + +.directory-alt div { + display: none; + margin: 0px; +} + +.directory-alt img { + vertical-align: -30%; +} + +/* @end */ + +address { + font-style: normal; + color: #333; +} diff --git a/libircclient/cocoa/doc/html/doxygen.png b/libircclient/cocoa/doc/html/doxygen.png new file mode 100644 index 0000000000000000000000000000000000000000..f0a274bbaffdd67f6d784c894d9cf28729db0e14 GIT binary patch literal 1281 zcmaJ>ZA?>F7(Vx-ms?uoS`b@hdRtpo6o^%HU>M$hfGrBvQnk$LE?p^P!kn&ikhyq! zX~V@&tPF5Qt@V?oTL96Bi%aRiwbe1)9DWQI#?)=HxS7QSw`J`5fAJ*eJbB;uNuKA& zdERDo*{Y<(If(#(B$Lr#;nB(8Y#ia=ZCeW?JfPLuQY`=@cW$k}Rivq|vbxGrRq1Tl9;+(gNt?}UtVKM2`T5t1jLzuL@0UIs`S#vlhl4)^ zLgSYrPj@$+`|j?eSbXTmiHGkWxV8V}BzNR?pl9k_s4pDu9vd5a_UzZEPk)}Ad{AV_ zzddrjrh4=Imr`E06;LY{)YYt?o}L~H@7C}F^WB!Ra=v`Q0bj{>5&$66CWF>mf6vjP z2N>RRY6ZYa=K`76>+|_)Xdwko+7wv}7cN|btOhWb(*{sta~6b?S8Omrxw}!4`NhGr zZVpNqpu1@BE`QGWNTpEpcJVW5izu~2B^GlM?1(OPg)zwW;QcP@Ltcclm>XbJL9C|j z=9!2?ua=uIlf0%AndzHsRC}IyTL$EhAee(fdKB`?27KeS^2M8M_7b~PiCFO&r5LC7 z7gl1*a<8;SjNaw#h=843_AV9iZbWQOAp5YOC^&_F*9K0> zB|6%IDb?aM#3viTxkLU4aXg&@+CkNTOnQ1iMP*^?b|^lJy$4C)Zk4isV!|RZ*XhXh zw8q3$=*0LeGC!XI_Wc?dkT~3+*Gu%%yIqP+Wr3H$=&ROMQU6q}Ag^P~>c5vAEO;a- z_dK-3PPeKar%)6$j~vI2#*-YH!1h6HYVtwCX5_wM`iF#UKz&&@9Oo5w3%XGYrX zW>dY~)SG-((Yim%`InwgTvyRC?e=Wh^8KCao!R6Eg&TpVWUY1sN~4G}V?nFnEGo-; zHZ_$eW9-GnC%^WS9b z@p;-$oH#MtC0v>Q$HX%4^JdFdO$0cbv-W)Q TtK}Eh@>>I#ipmV1>S*>q-hkC} literal 0 HcmV?d00001 diff --git a/libircclient/cocoa/doc/html/files.html b/libircclient/cocoa/doc/html/files.html new file mode 100644 index 0000000..f9495a0 --- /dev/null +++ b/libircclient/cocoa/doc/html/files.html @@ -0,0 +1,36 @@ + + +IRCClient: File Index + + + + + +
+

File List

Here is a list of all documented files with brief descriptions: + + + + + + +
DDInvocationGrabber.h [code]
IRCClientChannel.h [code]Represents a connected IRC Channel
IRCClientChannelDelegate.h [code]Receives delegate messages from an IRCClientChannel
IRCClientSession.h [code]Represents a connected IRC Session
IRCClientSessionDelegate.h [code]
NSObject+DDExtensions.h [code]
+
+
Generated on Sat Jan 10 18:10:37 2009 for IRCClient by  + +doxygen 1.5.7.1
+ + diff --git a/libircclient/cocoa/doc/html/functions.html b/libircclient/cocoa/doc/html/functions.html new file mode 100644 index 0000000..c37c0f5 --- /dev/null +++ b/libircclient/cocoa/doc/html/functions.html @@ -0,0 +1,224 @@ + + +IRCClient: Class Members + + + + + +
+Here is a list of all documented class members with links to the class documentation for each member: +

+

- a -

+

- c -

+

- d -

+

- e -

+

- i -

+

- j -

+

- k -

+

- l -

+

- m -

+

- n -

+

- o -

+

- p -

+

- q -

+

- r -

+

- s -

+

- t -

+

- u -

+

- v -

+

- w -

+
+
Generated on Sat Jan 10 18:10:37 2009 for IRCClient by  + +doxygen 1.5.7.1
+ + diff --git a/libircclient/cocoa/doc/html/functions_func.html b/libircclient/cocoa/doc/html/functions_func.html new file mode 100644 index 0000000..3a900c5 --- /dev/null +++ b/libircclient/cocoa/doc/html/functions_func.html @@ -0,0 +1,182 @@ + + +IRCClient: Class Members - Functions + + + + + +
+  +

+

- a -

+

- c -

+

- d -

+

- i -

+

- j -

+

- k -

+

- l -

+

- m -

+

- n -

+

- o -

+

- p -

+

- q -

+

- r -

+

- s -

+

- u -

+

- w -

+
+
Generated on Sat Jan 10 18:10:37 2009 for IRCClient by  + +doxygen 1.5.7.1
+ + diff --git a/libircclient/cocoa/doc/html/functions_prop.html b/libircclient/cocoa/doc/html/functions_prop.html new file mode 100644 index 0000000..22ac5b8 --- /dev/null +++ b/libircclient/cocoa/doc/html/functions_prop.html @@ -0,0 +1,74 @@ + + +IRCClient: Class Members - Properties + + + + + +
+  +

+

+
+
Generated on Sat Jan 10 18:10:37 2009 for IRCClient by  + +doxygen 1.5.7.1
+ + diff --git a/libircclient/cocoa/doc/html/hierarchy.html b/libircclient/cocoa/doc/html/hierarchy.html new file mode 100644 index 0000000..1ee86b6 --- /dev/null +++ b/libircclient/cocoa/doc/html/hierarchy.html @@ -0,0 +1,38 @@ + + +IRCClient: Hierarchical Index + + + + + +
+

Class Hierarchy

This inheritance list is sorted roughly, but not completely, alphabetically: +
+
Generated on Sat Jan 10 18:10:37 2009 for IRCClient by  + +doxygen 1.5.7.1
+ + diff --git a/libircclient/cocoa/doc/html/index.html b/libircclient/cocoa/doc/html/index.html new file mode 100644 index 0000000..1839e0b --- /dev/null +++ b/libircclient/cocoa/doc/html/index.html @@ -0,0 +1,59 @@ + + +IRCClient: IRCClient - a Cocoa IRC Framework to create IRC clients + + + + + +
+

IRCClient - a Cocoa IRC Framework to create IRC clients

+

+

1.0

+Introduction

+IRCClient is a Cocoa Framework that uses the excellent libircclient library written by Georgy Yunaev.

+Basic Usage

+To use this framework, you will need to write an IRCClientSessionDelegate to handle all of the events generated by the server, and an IRCClientChannelDelegate to handle all of the events generated by channels on that server.

+You then create an IRCClientSession object in your code, assign the required properties, and call connect: to connect to the server and run: to create the new thread and start receiving events. For example:

+

 IRCClientSession *session = [[IRCClientSession alloc] init];
+ MyIRCClientSessionDelegate *controller = [[MyIRCClientSessionDelegate alloc] init];
+ 
+ [session setDelegate:controller];
+ [controller setSession:session];
+ 
+ [session setServer:@"irc.dal.net"];
+ [session setPort:@"6667"];
+ [session setNickname:@"test"];
+ [session setUsername:@"test"];
+ [session setRealname:@"test"];
+ [session connect];
+ 
+ [session run]; //starts the thread
+

+Author, copyright, support.

+If you have any questions, bug reports, suggestions regarding libircclient or the IRCClient framework, please visit http://libircclient.sourceforge.net

+

+ libircclient Copyright (C) 2004-2009 Georgy Yunaev gyunaev@ulduzsoft.com
+ IRCClient Copyright (C) 2009 Nathan Ollerenshaw chrome@stupendous.net

+

 This library is free software; you can redistribute it and/or modify it 
+ under the terms of the GNU Lesser General Public License as published by 
+ the Free Software Foundation; either version 2 of the License, or (at your 
+ option) any later version.

+

 This library 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 Lesser General Public 
+ License for more details.
+ 
+
Generated on Sat Jan 10 18:10:37 2009 for IRCClient by  + +doxygen 1.5.7.1
+ + diff --git a/libircclient/cocoa/doc/html/interface_i_r_c_client_channel.html b/libircclient/cocoa/doc/html/interface_i_r_c_client_channel.html new file mode 100644 index 0000000..5b1efb4 --- /dev/null +++ b/libircclient/cocoa/doc/html/interface_i_r_c_client_channel.html @@ -0,0 +1,473 @@ + + +IRCClient: IRCClientChannel Class Reference + + + + + +
+

IRCClientChannel Class Reference

Represents a connected IRC Channel. +More... +

+#import <IRCClientChannel.h> +

+

+Inheritance diagram for IRCClientChannel:
+
+ +

+ + +
+ +

+List of all members. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Public Member Functions

(id) - initWithName:
(int) - part
(int) - invite:
(void) - setTopic:
(int) - setMode:params:
(int) - message:
(int) - action:
(int) - notice:
(int) - kick:reason:
(int) - ctcpRequest:

Properties

id delegate
NSString * name
NSStringEncoding encoding
IRCClientSessionsession
NSString * topic
NSString * modes
NSMutableArray * names
+


Detailed Description

+Represents a connected IRC Channel. +

+IRCClientChannel objects are created by the IRCClientSession object for a given session when the client joins an IRC channel. At that time you are expected to register event handlers for each of the delegate methods described in the IRCClientChannelDelegate interface.


Member Function Documentation

+ +
+
+ + + + + + + + + +
- (int) action: (NSString *)  action  
+
+
+ +

+Sends a public CTCP ACTION to the channel.

+

Parameters:
+ + +
action action to send to the channel.
+
+ +
+

+ +

+
+ + + + + + + + + +
- (int) ctcpRequest: (NSString *)  request  
+
+
+ +

+Sends a CTCP request to the channel.

+It is perfectly legal to send a CTCP request to an IRC channel, however many clients decline to respond to them, and often they are percieved as annoying.

+

Parameters:
+ + +
request the string of the request, in CTCP format.
+
+ +
+

+ +

+
+ + + + + + + + + +
- (id) initWithName: (NSString *)  aName  
+
+
+ +

+initWithName:

+Returns an initialised IRCClientChannel with a given channel name. You are not expected to initialise your own IRCClientChannel objects; if you wish to join a channel you should send a [IRCClientSession join:key:] message to your IRCClientSession object.

+

Parameters:
+ + +
aName Name of the channel.
+
+ +
+

+ +

+
+ + + + + + + + + +
- (int) invite: (NSString *)  nick  
+
+
+ +

+Invites another IRC client to the channel.

+

Parameters:
+ + +
nick the nickname of the client to invite.
+
+ +
+

+ +

+
+ + + + + + + + + + + + + + + + + + +
- (int) kick: (NSString *)  nick
reason:(NSString *)  reason 
+
+
+ +

+Kicks someone from a channel.

+

Parameters:
+ + + +
nick the IRC client to kick from the channel.
reason the message to give to the channel and the IRC client for the kick.
+
+ +
+

+ +

+
+ + + + + + + + + +
- (int) message: (NSString *)  message  
+
+
+ +

+Sends a public PRIVMSG to the channel. If you try to send more than can fit on an IRC buffer, it will be truncated.

+

Parameters:
+ + +
message the message to send to the channel.
+
+ +
+

+ +

+
+ + + + + + + + + +
- (int) notice: (NSString *)  notice  
+
+
+ +

+Sends a public NOTICE to the channel.

+

Parameters:
+ + +
notice message to send to the channel.
+
+ +
+

+ +

+
+ + + + + + + + +
- (int) part  
+
+
+ +

+Parts the channel. +

+

+ +

+
+ + + + + + + + + + + + + + + + + + +
- (int) setMode: (NSString *)  mode
params:(NSString *)  params 
+
+
+ +

+Sets the mode of the channel.

+Note that not all users on a channel have permission to change the mode; if you fail to set the mode, then you will not see an onMode event on the IRCClientChannelDelegate.

+

Parameters:
+ + + +
mode the mode to set the channel to
params paramaters for the mode, if it requires parameters.
+
+ +
+

+ +

+
+ + + + + + + + + +
- (void) setTopic: (NSString *)  aTopic  
+
+
+ +

+Sets the topic of the channel.

+Note that not all users on a channel have permission to change the topic; if you fail to set the topic, then you will not see an onTopic event on the IRCClientChannelDelegate.

+

Parameters:
+ + +
aTopic the topic the client wishes to set for the channel.
+
+ +
+

+


Property Documentation

+ +
+
+ + + + +
- (id) delegate [read, write, assign]
+
+
+ +

+Delegate to send events to +

+

+ +

+
+ + + + +
- (NSStringEncoding) encoding [read, write, assign]
+
+
+ +

+Encoding used by this channel +

+

+ +

+
+ + + + +
- (NSString *) modes [read, write, copy]
+
+
+ +

+Mode of the channel +

+

+ +

+
+ + + + +
- (NSString *) name [read, write, copy]
+
+
+ +

+Name of the channel +

+

+ +

+
+ + + + +
- (NSMutableArray *) names [read, assign]
+
+
+ +

+An array of nicknames stored as NSStrings that list the connected users for the channel +

+

+ +

+
+ + + + +
- (IRCClientSession *) session [read, write, assign]
+
+
+ +

+Associated IRCClientSession object +

+

+ +

+
+ + + + +
- (NSString *) topic [read, write, copy]
+
+
+ +

+Topic of the channel +

+

+


The documentation for this class was generated from the following files: +
+
Generated on Sat Jan 10 18:10:37 2009 for IRCClient by  + +doxygen 1.5.7.1
+ + diff --git a/libircclient/cocoa/doc/html/interface_i_r_c_client_channel.png b/libircclient/cocoa/doc/html/interface_i_r_c_client_channel.png new file mode 100644 index 0000000000000000000000000000000000000000..bb19cb1c4d7d06338c32294a66c92d23f9dca617 GIT binary patch literal 400 zcmV;B0dM|^P)O-wUf(28OIiWt&el80wYDUDN%+xLhhyd)#UcAgFvt;*orp1#I+E=Q z96;i!at4`N#(H2-Fc%}#`dpsmvkP+B1Y#sfLuwg_T4GupZ8+L02zXC4zlfm1voD5!|>I5e^ z!3j=q033d?HeaoE`x_9P{{2AYTagR4D7=ynHjrn?(CdviX`u`H?2?Lr4!{GZF?S+` z)u*94DE-Ps$Ed0Fl0$Zld(f@mGkNkE&^rrqA`7x`8PrgtRcAmbE7nyl+uHSbY!%Et us&t}9+DC5H`wW(<4u5kd_&ea} + +IRCClient: IRCClientSession Class Reference + + + + + +
+

IRCClientSession Class Reference

Represents a connected IRC Session. +More... +

+#import <IRCClientSession.h> +

+

+Inheritance diagram for IRCClientSession:
+
+ +

+ + +
+ +

+List of all members. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Public Member Functions

(int) - connect
(void) - disconnect
(bool) - isConnected
(void) - run
(int) - sendRawWithFormat:
(int) - quit:
(int) - join:key:
(int) - list:
(int) - userMode:
(int) - nick:
(int) - whois:
(int) - message:to:
(int) - action:to:
(int) - notice:to:
(int) - ctcpRequest:target:
(int) - ctcpReply:target:

Properties

id delegate
irc_session_t * session
NSString * version
NSString * server
NSString * port
NSString * password
NSString * nickname
NSString * username
NSString * realname
NSMutableDictionary * channels
NSStringEncoding encoding
+


Detailed Description

+Represents a connected IRC Session. +

+IRCClientSession represents a single connection to an IRC server. On initialising the object, and setting the delegate, server, port, password, nickname, username and realname properties, you call the connect: and run: methods to connect to the IRC server and start a new thread.

+This thread then sends messages back to the main runloop to the IRC server delegate, or to the IRCClientChannel delegate as required.


Member Function Documentation

+ +
+
+ + + + + + + + + + + + + + + + + + +
- (int) action: (NSString *)  action
to:(NSString *)  target 
+
+
+ +

+send a CTCP ACTION to another IRC client

+

Parameters:
+ + + +
action the action message to send
target the nickname of the irc client to send the message to.
+
+ +
+

+ +

+
+ + + + + + + + +
- (int) connect  
+
+
+ +

+Connect to the IRC server.

+Note that this performs the initial DNS lookup and the TCP connection, so if there are any problems you will be notified via the return code of the message.

+Look at the libircclient documentation for the different return codes. +

+

+ +

+
+ + + + + + + + + + + + + + + + + + +
- (int) ctcpReply: (NSString *)  reply
target:(NSString *)  target 
+
+
+ +

+send a CTCP reply to another IRC client

+

Parameters:
+ + + +
reply the CTCP reply string to send
target the nickname of the IRC client to send the reply to.
+
+ +
+

+ +

+
+ + + + + + + + + + + + + + + + + + +
- (int) ctcpRequest: (NSString *)  request
target:(NSString *)  target 
+
+
+ +

+send a CTCP request to another IRC client

+

Parameters:
+ + + +
request the CTCP request string to send
target the nickname of the IRC client to send the request to.
+
+ +
+

+ +

+
+ + + + + + + + +
- (void) disconnect  
+
+
+ +

+Disconnect from the IRC server.

+This always works, as it simply shuts down the socket. If you want to disconnect in a friendly way, you should use the quit: message. +

+

+ +

+
+ + + + + + + + +
- (bool) isConnected  
+
+
+ +

+returns YES if the server is currently connected successfully, and NO if it is not. +

+

+ +

+
+ + + + + + + + + + + + + + + + + + +
- (int) join: (NSString *)  channel
key:(NSString *)  key 
+
+
+ +

+Joins a channel with a given name and key

+

Parameters:
+ + + +
channel the channel to join
key they key for the channel (may be nil)
+
+ +
+

+ +

+
+ + + + + + + + + +
- (int) list: (NSString *)  channel  
+
+
+ +

+lists channels on the IRC server.

+

Parameters:
+ + +
channel a channel name or string to pass to the LIST command. Implementation specific.
+
+ +
+

+ +

+
+ + + + + + + + + + + + + + + + + + +
- (int) message: (NSString *)  message
to:(NSString *)  target 
+
+
+ +

+send a PRIVMSG to another IRC client

+

Parameters:
+ + + +
message message to send
target the other IRC client to send the message to.
+
+ +
+

+ +

+
+ + + + + + + + + +
- (int) nick: (NSString *)  newnick  
+
+
+ +

+sets the IRC client nickname. On success, an onNick event will be sent to the delegate

+

Parameters:
+ + +
newnick new nickname to set.
+
+ +
+

+ +

+
+ + + + + + + + + + + + + + + + + + +
- (int) notice: (NSString *)  notice
to:(NSString *)  target 
+
+
+ +

+send a NOTICE to another IRC client

+

Parameters:
+ + + +
notice the message text to send
target the nickname of the irc client to send the notice to.
+
+ +
+

+ +

+
+ + + + + + + + + +
- (int) quit: (NSString *)  reason  
+
+
+ +

+quits the IRC server with the given reason. On success, an onQuit event will be sent to the IRCClientSessionDelegate with the nickname of the IRC client.

+The format is a standard NSString format string, followed by optional arguments. +

+

+ +

+
+ + + + + + + + +
- (void) run  
+
+
+ +

+Starts a new thread and starts the libircclient runloop, processing events and firing messages back to the main runloop as required. Calling this again will do nothing other than raise a warning in your logs. +

+

+ +

+
+ + + + + + + + + + + + + + + + + + +
- (int) sendRawWithFormat: (NSString *)  format
,  ... 
+
+
+ +

+Sends a raw message to the IRC server. Please consult rfc1459 for the format of IRC commands. +

+

+ +

+
+ + + + + + + + + +
- (int) userMode: (NSString *)  mode  
+
+
+ +

+sets the user mode for the IRC client

+

Parameters:
+ + +
mode string to set
+
+ +
+

+ +

+
+ + + + + + + + + +
- (int) whois: (NSString *)  nick  
+
+
+ +

+sends a WHOIS request to the IRC server

+

Parameters:
+ + +
nick nickname of the irc client to whois.
+
+ +
+

+


Property Documentation

+ +
+
+ + + + +
- (NSMutableDictionary *) channels [read, assign]
+
+
+ +

+An NSMutableDictionary of channels that the client is currently connected to.

+You should not modify this. +

+

+ +

+
+ + + + +
- (id) delegate [read, write, assign]
+
+
+ +

+delegate to send events to. +

+

+ +

+
+ + + + +
- (NSStringEncoding) encoding [read, write, assign]
+
+
+ +

+The default text encoding for messages on this server.

+This affects messages received via PRIVMSG and NOTICE, and TOPIC in a channel. You may change this at any time. +

+

+ +

+
+ + + + +
- (NSString *) nickname [read, write, copy]
+
+
+ +

+Nickname of the connected client. Note that setting this after connection will not result in the client renaming on IRC. You need to send a nick: message instead. +

+

+ +

+
+ + + + +
- (NSString *) password [read, write, copy]
+
+
+ +

+Server password to provide on connect (may be left empty or nil) +

+

+ +

+
+ + + + +
- (NSString *) port [read, write, copy]
+
+
+ +

+IRC port to connect to +

+

+ +

+
+ + + + +
- (NSString *) realname [read, write, copy]
+
+
+ +

+Realname of the connected client.

+Setting this after connection does nothing. +

+

+ +

+
+ + + + +
- (NSString *) server [read, write, copy]
+
+
+ +

+IRC server to connect to +

+

+ +

+
+ + + + +
- (irc_session_t *) session [read, write, assign]
+
+
+ +

+The underlying libircclient handle +

+

+ +

+
+ + + + +
- (NSString *) username [read, write, copy]
+
+
+ +

+Username of the connected client. Also known as the ident.

+Setting this after connection does nothing. +

+

+ +

+
+ + + + +
- (NSString *) version [read, write, copy]
+
+
+ +

+The version string for the client to send back on CTCP VERSION requests +

+

+


The documentation for this class was generated from the following files: +
+
Generated on Sat Jan 10 18:10:37 2009 for IRCClient by  + +doxygen 1.5.7.1
+ + diff --git a/libircclient/cocoa/doc/html/interface_i_r_c_client_session.png b/libircclient/cocoa/doc/html/interface_i_r_c_client_session.png new file mode 100644 index 0000000000000000000000000000000000000000..4bfd3d4bc1b007ca1349d48afe11cff677c17808 GIT binary patch literal 401 zcmV;C0dD?@P)R9J=Wmc0_f zFbIHQafT_c=hU64uP=n8CbdnyoYqsrMJ2!&ep;)*T>@e55cwl4*kV=(hgsa1G5{R6^gzahyjN;aVkpYpA<6aBExX4uE zeatG2A6B>d^3r}Xk$PKW?qf&_LAFtmt;Y126s*A2ZTj<(e#7p(Ix8Q3SWz6ah7L~ti8%82(*00000NkvXXu0mjf-6XJI literal 0 HcmV?d00001 diff --git a/libircclient/cocoa/doc/html/interface_n_s_object_07_i_r_c_client_channel_delegate_08.html b/libircclient/cocoa/doc/html/interface_n_s_object_07_i_r_c_client_channel_delegate_08.html new file mode 100644 index 0000000..53782fc --- /dev/null +++ b/libircclient/cocoa/doc/html/interface_n_s_object_07_i_r_c_client_channel_delegate_08.html @@ -0,0 +1,357 @@ + + +IRCClient: NSObject(IRCClientChannelDelegate) Class Reference + + + + + +
+

NSObject(IRCClientChannelDelegate) Class Reference

Receives delegate messages from an IRCClientChannel. +More... +

+#import <IRCClientChannelDelegate.h> +

+ +

+List of all members. + + + + + + + + + + + + + + + + + + +

Public Member Functions

(void) - onJoin:
(void) - onPart:reason:
(void) - onMode:params:nick:
(void) - onTopic:nick:
(void) - onKick:reason:byNick:
(void) - onPrivmsg:nick:
(void) - onNotice:nick:
(void) - onAction:nick:
+


Detailed Description

+Receives delegate messages from an IRCClientChannel. +

+Each IRCClientChannel object needs a delegate. Delegate methods are called for each event that occurs on an IRC channel that the client is current on.

+Note that for any given parameter, it may be optional, in which case a nil object may be supplied instead of the given parameter.


Member Function Documentation

+ +
+
+ + + + + + + + + + + + + + + + + + +
- (void) onAction: (NSString *)  action
nick:(NSString *)  nick 
+
+
+ +

+Received when an IRC client sends a CTCP ACTION message to the channel. used by lamers with no life to pretend that they are playing some form of MMORPG.

+

Parameters:
+ + + +
action the action message sent to the channel.
nick the nickname of the IRC client that sent the message.
+
+ +
+

+ +

+
+ + + + + + + + + +
- (void) onJoin: (NSString *)  nick  
+
+
+ +

+When a client joins this channel, the onJoin event is fired. Note that the nickname is most likely in nick!user@host format, but may simply be a nickname, depending on the server implementation.

+You should also expect to see this event when the client first joins a channel, with a parameter of the client's nickname.

+

Parameters:
+ + +
nick The nickname of the user that joined the channel.
+
+ +
+

+ +

+
+ + + + + + + + + + + + + + + + + + + + + + + + +
- (void) onKick: (NSString *)  nick
reason:(NSString *)  reason
byNick:(NSString *)  byNick 
+
+
+ +

+Received when an IRC client is kicked from a channel.

+

Parameters:
+ + + + +
nick nickname of the client that was kicked
reason reason message given for the kick
byNick nickname of the client that performed the kick command
+
+ +
+

+ +

+
+ + + + + + + + + + + + + + + + + + + + + + + + +
- (void) onMode: (NSString *)  mode
params:(NSString *)  params
nick:(NSString *)  nick 
+
+
+ +

+Received when an IRC client changes the channel mode. What modes are available for a given channel is an implementation detail for each server.

+

Parameters:
+ + + + +
mode the new channel mode.
params any parameters with the mode (such as channel key).
nick the nickname of the IRC client that changed the mode.
+
+ +
+

+ +

+
+ + + + + + + + + + + + + + + + + + +
- (void) onNotice: (NSString *)  notice
nick:(NSString *)  nick 
+
+
+ +

+Received when an IRC client sends a public NOTICE to the channel. Note that the user may not necessarily be required to be on the channel to send a notice to it. Furthermore, the RFC states that the only difference between PRIVMSG and NOTICE is that a NOTICE may never be responded to automatically.

+

Parameters:
+ + + +
notice the notice sent to the channel.
nick the nickname of the IRC client that sent the notice.
+
+ +
+

+ +

+
+ + + + + + + + + + + + + + + + + + +
- (void) onPart: (NSString *)  nick
reason:(NSString *)  reason 
+
+
+ +

+When an IRC client parts a channel you are connect to, you will see an onPart event. You will also see this event when you part a channel.

+

Parameters:
+ + + +
nick (required) The nickname of the user that left the channel.
reason (optional) The reason, if any, that the user gave for leaving.
+
+ +
+

+ +

+
+ + + + + + + + + + + + + + + + + + +
- (void) onPrivmsg: (NSString *)  message
nick:(NSString *)  nick 
+
+
+ +

+Received when an IRC client sends a public PRIVMSG to the channel. Note that the user may not necessarily be required to be on the channel to send a message to it.

+

Parameters:
+ + + +
message the message sent to the channel.
nick the nickname of the IRC client that sent the message.
+
+ +
+

+ +

+
+ + + + + + + + + + + + + + + + + + +
- (void) onTopic: (NSString *)  aTopic
nick:(NSString *)  nick 
+
+
+ +

+Received when the topic is changed for the channel.

+

Parameters:
+ + + +
aTopic The new topic of the channel.
nick Nickname of the IRC client that changed the topic.
+
+ +
+

+


The documentation for this class was generated from the following file: +
+
Generated on Sat Jan 10 18:10:37 2009 for IRCClient by  + +doxygen 1.5.7.1
+ + diff --git a/libircclient/cocoa/doc/html/interface_n_s_object_07_i_r_c_client_session_delegate_08.html b/libircclient/cocoa/doc/html/interface_n_s_object_07_i_r_c_client_session_delegate_08.html new file mode 100644 index 0000000..c8ab506 --- /dev/null +++ b/libircclient/cocoa/doc/html/interface_n_s_object_07_i_r_c_client_session_delegate_08.html @@ -0,0 +1,528 @@ + + +IRCClient: NSObject(IRCClientSessionDelegate) Class Reference + + + + + +
+

NSObject(IRCClientSessionDelegate) Class Reference

Receives delegate messages from an IRCClientSession. +More... +

+#import <IRCClientSessionDelegate.h> +

+ +

+List of all members. + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Public Member Functions

(void) - onConnect
(void) - onNick:oldNick:
(void) - onQuit:reason:
(void) - onJoinChannel:
(void) - onMode:
(void) - onPrivmsg:nick:
(void) - onNotice:nick:
(void) - onInvite:nick:
(void) - onCtcpRequest:type:nick:
(void) - onCtcpReply:nick:
(void) - onAction:nick:
(void) - onUnknownEvent:origin:params:
(void) - onNumericEvent:origin:params:
+


Detailed Description

+Receives delegate messages from an IRCClientSession. +

+Each IRCClientSession object needs a single delegate. Methods are called for each event that occurs on an IRC server that the client is connected to.

+Note that for any given parameter, it may be optional, in which case a nil object may be supplied instead of the given parameter.


Member Function Documentation

+ +
+
+ + + + + + + + + + + + + + + + + + +
- (void) onAction: (NSData *)  action
nick:(NSString *)  nick 
+
+
+ +

+A private CTCP ACTION was sent to the IRC client.

+CTCP ACTION is not limited to channels; it may also be sent directly to other users.

+

Parameters:
+ + + +
action the action message text.
nick the nickname of the client that sent the action.
+
+ +
+

+ +

+
+ + + + + + + + +
- (void) onConnect  
+
+
+ +

+The client has successfully connected to the IRC server. +

+

+ +

+
+ + + + + + + + + + + + + + + + + + +
- (void) onCtcpReply: (NSData *)  reply
nick:(NSString *)  nick 
+
+
+ +

+A private CTCP reply was sent to the IRC client.

+

Parameters:
+ + + +
reply an NSData containing the raw C string of the reply.
nick the nickname of the user that sent the reply.
+
+ +
+

+ +

+
+ + + + + + + + + + + + + + + + + + + + + + + + +
- (void) onCtcpRequest: (NSString *)  request
type:(NSString *)  type
nick:(NSString *)  nick 
+
+
+ +

+A private CTCP request was sent to the IRC client.

+

Parameters:
+ + + + +
request the CTCP request string (after the type)
type the CTCP request type
nick the nickname of the user that sent the request.
+
+ +
+

+ +

+
+ + + + + + + + + + + + + + + + + + +
- (void) onInvite: (NSString *)  channel
nick:(NSString *)  nick 
+
+
+ +

+The IRC client has been invited to a channel.

+

Parameters:
+ + + +
channel the channel for the invitation.
nick the nickname of the user that sent the invitation.
+
+ +
+

+ +

+
+ + + + + + + + + +
- (void) onJoinChannel: (IRCClientChannel *)  channel  
+
+
+ +

+The IRC client has joined (connected) successfully to a new channel. This event creates an IRCClientChannel object, which you are expected to asign a delegate to, to handle events from the channel.

+For example, on receipt of this message, a graphical IRC client would most likely open a new window, create an IRCClientChannelDelegate for the window, set the new IRCClientChannel's delegate to the new delegate, and then hook it up so that new events sent to the IRCClientChannelDelegate are sent to the window.

+

Parameters:
+ + +
channel the IRCClientChannel object for the newly joined channel.
+
+ +
+

+ +

+
+ + + + + + + + + +
- (void) onMode: (NSString *)  mode  
+
+
+ +

+The client has changed it's user mode.

+

Parameters:
+ + +
mode the new mode.
+
+ +
+

+ +

+
+ + + + + + + + + + + + + + + + + + +
- (void) onNick: (NSString *)  nick
oldNick:(NSString *)  oldNick 
+
+
+ +

+An IRC client on a channel that this client is connected to has changed nickname, or this IRC client has changed nicknames.

+

Parameters:
+ + + +
nick the new nickname
oldNick the old nickname
+
+ +
+

+ +

+
+ + + + + + + + + + + + + + + + + + +
- (void) onNotice: (NSData *)  notice
nick:(NSString *)  nick 
+
+
+ +

+The client has received a private NOTICE from another client.

+

Parameters:
+ + + +
notice the text of the message
nick the nickname of the other IRC client that sent the message.
+
+ +
+

+ +

+
+ + + + + + + + + + + + + + + + + + + + + + + + +
- (void) onNumericEvent: (NSUInteger)  event
origin:(NSString *)  origin
params:(NSArray *)  params 
+
+
+ +

+An unhandled numeric was received from the IRC server

+

Parameters:
+ + + + +
event the unknown event number
origin the sender of the event
params an NSArray of NSData objects that are the raw C strings of the event.
+
+ +
+

+ +

+
+ + + + + + + + + + + + + + + + + + +
- (void) onPrivmsg: (NSData *)  message
nick:(NSString *)  nick 
+
+
+ +

+The client has received a private PRIVMSG from another IRC client.

+

Parameters:
+ + + +
message the text of the message
nick the other IRC Client that sent the message.
+
+ +
+

+ +

+
+ + + + + + + + + + + + + + + + + + +
- (void) onQuit: (NSString *)  nick
reason:(NSString *)  reason 
+
+
+ +

+An IRC client on a channel that this client is connected to has quit IRC.

+

Parameters:
+ + + +
nick the nickname of the client that quit.
reason (optional) the quit message, if any.
+
+ +
+

+ +

+
+ + + + + + + + + + + + + + + + + + + + + + + + +
- (void) onUnknownEvent: (NSString *)  event
origin:(NSString *)  origin
params:(NSArray *)  params 
+
+
+ +

+An unhandled event was received from the IRC server.

+

Parameters:
+ + + + +
event the unknown event name
origin the sender of the event
params an NSArray of NSData objects that are the raw C strings of the event.
+
+ +
+

+


The documentation for this class was generated from the following file: +
+
Generated on Sat Jan 10 18:10:37 2009 for IRCClient by  + +doxygen 1.5.7.1
+ + diff --git a/libircclient/cocoa/doc/html/tab_b.gif b/libircclient/cocoa/doc/html/tab_b.gif new file mode 100644 index 0000000000000000000000000000000000000000..0d623483ffdf5f9f96900108042a7ab0643fe2a3 GIT binary patch literal 35 ncmZ?wbhEHbWMp7uXkcJy*>IeJfk6j|fqX^=1|}vKMh0sDa2W*H literal 0 HcmV?d00001 diff --git a/libircclient/cocoa/doc/html/tab_l.gif b/libircclient/cocoa/doc/html/tab_l.gif new file mode 100644 index 0000000000000000000000000000000000000000..9b1e6337c9299a700401a2a78a2c6ffced475216 GIT binary patch literal 706 zcmZ?wbhEHbZT`}F1e&(Gg}Y(8=I;HA5#Z$3JI=gGB)FQ#odI(O&E^@q;x zK6mr*m3xOS-#u~t!I@i+u0DKm^U160k6t`|^WpV}&n+8{U%dD9&a>B#U%!9-@yol< zU%&tQ{rk_K|NsC0`}dE5ET99@1@a36+kb~?0UJ*yc&I3X_m z!ND^5$O7$#8OFRuDhG}!?8z?cdZK&!`PWjdR;Aj^wZ` zeK{IEYHBJ)6K8VIp1`BVt++swf6j+=L{p1*nO(VhE`pFexG@5$|>uaCcd z`0m=9m+yak{QmXN#Sc$^{$X9h9&q2jiKAI|&T)a;PPx2K9p`YIdw8HtR5k2Q$2-O2 z*;3y{MQ-RnJTgJfI&R5|O)AHxDf_00XbPvDZPy4t=hHd)nfLPvms&O`Ok(sD()5v$ z5U@&h;a=#xbxVbo2~X&Xj0Ie(f{v>vERH+qC+nTG=B8Nca=wU-O$?1&vUgV~9=!H; zx>3p9Yn%*<>t~sk+&0xfyS8RsPfYBd<~wWK%j-LmpU>O7yX^h#UCp1x-p#i7@bE;py8XI6 zmY<)m>~)W~yIWcMVoiPg{duuf<*)9qZ9l$m*Ph&W&$jlv*Vpa+{pH@n=IQ$L?0$ax ec60Ul|8o2P|NVbd{6P)#weSbE3}s?04AuZvx_~SI literal 0 HcmV?d00001 diff --git a/libircclient/cocoa/doc/html/tab_r.gif b/libircclient/cocoa/doc/html/tab_r.gif new file mode 100644 index 0000000000000000000000000000000000000000..ce9dd9f533cb5486d6941844f442b59d4a9e9175 GIT binary patch literal 2585 zcmbV}`9Bkk1ILFF--w5zJc=ZZT(zjE=;2|_S)Qm~rCWz1Pc)KPl;jv%A#&v2*x}yc zmf2~Jm~&=xjJY?PqwIN}f8qQ2{r$uH{c*nJbmr{cR5??*egHrs-B=MzCF`3%e{FAW z{oL5xTHn~5TM{jaB;@|_Ue5F&Zb@p(kMyG{*;gWDg zyeL|eZf7Qd8=#bXzSiR{yzRgLSj-fJS8>lBjVHN z^o-0eS=nE6a`W;LChBs=`+QAJP~{b93>H^eRb5kCSC1zUNezun%`L5M?RDzv#%jk7 zYVRX=vATPD`+oEfum^{RM@GjuP?-r=yh0!p;Vx^T9G7~`7%5ydH%70=jyJ;;`d;hv92x3R=z{xp+Lg2!*@OK*K15-t&okoPtSED)h&$RLxdbA zseWm^C3d%-yRNi-ryk^!ek+C`n&~cd$#ZWct_cUL{l~i+Nzx^5d!n94(>bW-iL~Rl z&8r)?q|1DIo=0=judQ{FaGcfLERz8gfn3-Qt<2lksh{mzpT}DXxUuR^z=^key&q4! z+wWI45vL0k$R^(F#{qfqhUsN@WA+w-V?LPH33!Q?WFSB3)WBojE@hK41Nb?KfS+Qo zXgrzfsP$wr4Qzy*{OD>uJBjdgGM@VMml5)2f~_}lD*YyOb}Hjeobhz#4c`w(l^>KK zr?Ud;W~Z}*w;%hZ|2^p^+f06gJDJQD zeIhGADbDmm&6arh(q>EZ<7mjzg7l|z$hRL8=1>)Nv=S7CY$B}iYJ&*T_-T_OG*L1q ztZ3Lana33?y3AKnyq^YCF|4x%Rb5WU&2qcl{TFKey%QJeMxn^SdT!hZ5+0i1zeusiYVp-phBl7b5+Px-X&LhByq z0F&<;K0l2+v>qiHlXb#$jXMv$uK-dEGE9L~qtdU(XeRXmvu*K2Q&6!fD**JxYP4b4BR7FdJ$Qx9G9`J%-_X!a#LGpp3g9)VWytGCa;7`S1_e8F~!R+aSJ zOF17p2`H?2kPs8Q`_;U}+D%3p zs2-0BTqFwpUoBk`?P;iPQ(IbEA|JmMx!P&YYG|R@S=5Mnw;-?A6rEEVyV%d7{iU4a zNk`i!%F(Ykpm`}#oH;BjY->@b8vQedv;pza2FL&*6ufjd+*3Ute&>kes~TU?^KkojsTh(o~(3tk1Y6>4(yn( z#U*ID9@eg-beKo1B;HXe+}{Z%n@7m0+yxivuqk9~;!1LGQlah)xYK4>wgL}l6dsaN zIxlRlq`*`j9PG4*0hD6YV_b_2w5b#)o7J?`q#{GjvvKlD`T*dWcZx<-s(ZvLB44E# z=!|sw!?)@%y$oRNL#25WS3lzdii}TuQ3?CLnvQ1_n};2sT_;Y;#d3=+-(O% zMN$>O!3;ke(UuLR%h_&)N zs^!-@A>QR}4yB1bPp`9S19ikTbZ~O{&FF-yHK{En;mmShDUIEw03`j(DBIsM}Rjki2J#SQa3gFZTKBPDeIiLt9Z z%bL3(B@Qw%(B`wSMS~dPh$=R`(}lBoFXKy(s|*{#ru$wjsBc_O#zxNk9w+UUHmx(U zmJ8+M+ndtnZ<7|VU9Mbt61zpo9T&3%Wx&XII=#QJxjR`CZf22ac3d51Z?GD%LEe_&*t46Qf;4`bZ7p2K(Ab5>GfT^}4! zBT&HZD`^PEgWoI&{~o-ID0F?O`75sm(87x%A{(}Ch1)QlzdJ)1B-eqe5a(weg0`4lQIf1evjvbBY50DVbzO7CLf|vP z2#0(U-|jZ`H{y5N^o7%iK6H>_HEGN->U6^!)1{XpJV!!4(Ig7wzZQ*9WYF4X1rG0x z=1uA@i`rIAciubDC{;~b(|&|A@xkjRP5aRcvRU9tvIm}jDB6J eQ0-6-y)mpwdT=ayS0tBxKDA*~;EWmo literal 0 HcmV?d00001 diff --git a/libircclient/cocoa/doc/html/tabs.css b/libircclient/cocoa/doc/html/tabs.css new file mode 100644 index 0000000..16b1be0 --- /dev/null +++ b/libircclient/cocoa/doc/html/tabs.css @@ -0,0 +1,102 @@ +/* tabs styles, based on http://www.alistapart.com/articles/slidingdoors */ + +DIV.tabs +{ + float : left; + width : 100%; + background : url("tab_b.gif") repeat-x bottom; + margin-bottom : 4px; +} + +DIV.tabs UL +{ + margin : 0px; + padding-left : 10px; + list-style : none; +} + +DIV.tabs LI, DIV.tabs FORM +{ + display : inline; + margin : 0px; + padding : 0px; +} + +DIV.tabs FORM +{ + float : right; +} + +DIV.tabs A +{ + float : left; + background : url("tab_r.gif") no-repeat right top; + border-bottom : 1px solid #84B0C7; + font-size : 8px; + font-weight : bold; + text-decoration : none; +} + +DIV.tabs A:hover +{ + background-position: 100% -150px; +} + +DIV.tabs A:link, DIV.tabs A:visited, +DIV.tabs A:active, DIV.tabs A:hover +{ + color: #1A419D; +} + +DIV.tabs SPAN +{ + float : left; + display : block; + background : url("tab_l.gif") no-repeat left top; + padding : 5px 9px; + white-space : nowrap; +} + +DIV.tabs INPUT +{ + float : right; + display : inline; + font-size : 1em; +} + +DIV.tabs TD +{ + font-size : 8px; + font-weight : bold; + text-decoration : none; +} + + + +/* Commented Backslash Hack hides rule from IE5-Mac \*/ +DIV.tabs SPAN {float : none;} +/* End IE5-Mac hack */ + +DIV.tabs A:hover SPAN +{ + background-position: 0% -150px; +} + +DIV.tabs LI.current A +{ + background-position: 100% -150px; + border-width : 0px; +} + +DIV.tabs LI.current SPAN +{ + background-position: 0% -150px; + padding-bottom : 6px; +} + +DIV.navpath +{ + background : none; + border : none; + border-bottom : 1px solid #84B0C7; +} diff --git a/libircclient/configure b/libircclient/configure new file mode 100755 index 0000000..e2906c7 --- /dev/null +++ b/libircclient/configure @@ -0,0 +1,5939 @@ +#! /bin/sh +# Guess values for system-dependent variables and create Makefiles. +# Generated by GNU Autoconf 2.69 for libircclient 1.3. +# +# Report bugs to . +# +# +# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. +# +# +# This configure script is free software; the Free Software Foundation +# gives unlimited permission to copy, distribute and modify it. +## -------------------- ## +## M4sh Initialization. ## +## -------------------- ## + +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi + + +as_nl=' +' +export as_nl +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +# Prefer a ksh shell builtin over an external printf program on Solaris, +# but without wasting forks for bash or zsh. +if test -z "$BASH_VERSION$ZSH_VERSION" \ + && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='print -r --' + as_echo_n='print -rn --' +elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' + else + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in #( + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' + fi + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' +fi + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +fi + + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +as_myself= +case $0 in #(( + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + exit 1 +fi + +# Unset variables that we do not need and which cause bugs (e.g. in +# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" +# suppresses any "Segmentation fault" message there. '((' could +# trigger a bug in pdksh 5.2.14. +for as_var in BASH_ENV ENV MAIL MAILPATH +do eval test x\${$as_var+set} = xset \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# CDPATH. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +# Use a proper internal environment variable to ensure we don't fall + # into an infinite loop, continuously re-executing ourselves. + if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then + _as_can_reexec=no; export _as_can_reexec; + # We cannot yet assume a decent shell, so we have to provide a +# neutralization value for shells without unset; and this also +# works around shells that cannot unset nonexistent variables. +# Preserve -v and -x to the replacement shell. +BASH_ENV=/dev/null +ENV=/dev/null +(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV +case $- in # (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; +esac +exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} +# Admittedly, this is quite paranoid, since all the known shells bail +# out after a failed `exec'. +$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 +as_fn_exit 255 + fi + # We don't want this to propagate to other subprocesses. + { _as_can_reexec=; unset _as_can_reexec;} +if test "x$CONFIG_SHELL" = x; then + as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which + # is contrary to our usage. Disable this feature. + alias -g '\${1+\"\$@\"}'='\"\$@\"' + setopt NO_GLOB_SUBST +else + case \`(set -o) 2>/dev/null\` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi +" + as_required="as_fn_return () { (exit \$1); } +as_fn_success () { as_fn_return 0; } +as_fn_failure () { as_fn_return 1; } +as_fn_ret_success () { return 0; } +as_fn_ret_failure () { return 1; } + +exitcode=0 +as_fn_success || { exitcode=1; echo as_fn_success failed.; } +as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } +as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } +as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } +if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : + +else + exitcode=1; echo positional parameters were not saved. +fi +test x\$exitcode = x0 || exit 1 +test -x / || exit 1" + as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO + as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO + eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && + test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 +test \$(( 1 + 1 )) = 2 || exit 1" + if (eval "$as_required") 2>/dev/null; then : + as_have_required=yes +else + as_have_required=no +fi + if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : + +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_found=false +for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + as_found=: + case $as_dir in #( + /*) + for as_base in sh bash ksh sh5; do + # Try only shells that exist, to save several forks. + as_shell=$as_dir/$as_base + if { test -f "$as_shell" || test -f "$as_shell.exe"; } && + { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : + CONFIG_SHELL=$as_shell as_have_required=yes + if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : + break 2 +fi +fi + done;; + esac + as_found=false +done +$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && + { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : + CONFIG_SHELL=$SHELL as_have_required=yes +fi; } +IFS=$as_save_IFS + + + if test "x$CONFIG_SHELL" != x; then : + export CONFIG_SHELL + # We cannot yet assume a decent shell, so we have to provide a +# neutralization value for shells without unset; and this also +# works around shells that cannot unset nonexistent variables. +# Preserve -v and -x to the replacement shell. +BASH_ENV=/dev/null +ENV=/dev/null +(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV +case $- in # (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; +esac +exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} +# Admittedly, this is quite paranoid, since all the known shells bail +# out after a failed `exec'. +$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 +exit 255 +fi + + if test x$as_have_required = xno; then : + $as_echo "$0: This script requires a shell more modern than all" + $as_echo "$0: the shells that I found on your system." + if test x${ZSH_VERSION+set} = xset ; then + $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" + $as_echo "$0: be upgraded to zsh 4.3.4 or later." + else + $as_echo "$0: Please tell bug-autoconf@gnu.org and +$0: gyunaev@ulduzsoft.com about your system, including any +$0: error possibly output before this message. Then install +$0: a modern shell, or manually run the script under such a +$0: shell if you do have one." + fi + exit 1 +fi +fi +fi +SHELL=${CONFIG_SHELL-/bin/sh} +export SHELL +# Unset more variables known to interfere with behavior of common tools. +CLICOLOR_FORCE= GREP_OPTIONS= +unset CLICOLOR_FORCE GREP_OPTIONS + +## --------------------- ## +## M4sh Shell Functions. ## +## --------------------- ## +# as_fn_unset VAR +# --------------- +# Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset + +# as_fn_set_status STATUS +# ----------------------- +# Set $? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} # as_fn_set_status + +# as_fn_exit STATUS +# ----------------- +# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} # as_fn_exit + +# as_fn_mkdir_p +# ------------- +# Create "$as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" + + +} # as_fn_mkdir_p + +# as_fn_executable_p FILE +# ----------------------- +# Test if FILE is an executable regular file. +as_fn_executable_p () +{ + test -f "$1" && test -x "$1" +} # as_fn_executable_p +# as_fn_append VAR VALUE +# ---------------------- +# Append the text in VALUE to the end of the definition contained in VAR. Take +# advantage of any shell optimizations that allow amortized linear growth over +# repeated appends, instead of the typical quadratic growth present in naive +# implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else + as_fn_append () + { + eval $1=\$$1\$2 + } +fi # as_fn_append + +# as_fn_arith ARG... +# ------------------ +# Perform arithmetic evaluation on the ARGs, and store the result in the +# global $as_val. Take advantage of shells that can avoid forks. The arguments +# must be portable across $(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } +fi # as_fn_arith + + +# as_fn_error STATUS ERROR [LINENO LOG_FD] +# ---------------------------------------- +# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are +# provided, also output the error to LOG_FD, referencing LINENO. Then exit the +# script with STATUS, using 1 if that was 0. +as_fn_error () +{ + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + fi + $as_echo "$as_me: error: $2" >&2 + as_fn_exit $as_status +} # as_fn_error + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + + + as_lineno_1=$LINENO as_lineno_1a=$LINENO + as_lineno_2=$LINENO as_lineno_2a=$LINENO + eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && + test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { + # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) + sed -n ' + p + /[$]LINENO/= + ' <$as_myself | + sed ' + s/[$]LINENO.*/&-/ + t lineno + b + :lineno + N + :loop + s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ + t loop + s/-\n.*// + ' >$as_me.lineno && + chmod +x "$as_me.lineno" || + { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } + + # If we had to re-execute with $CONFIG_SHELL, we're ensured to have + # already done that, so ensure we don't try to do so again and fall + # in an infinite loop. This has already happened in practice. + _as_can_reexec=no; export _as_can_reexec + # Don't try to exec as it changes $[0], causing all sort of problems + # (the dirname of $[0] is not the place where we might find the + # original and so on. Autoconf is especially sensitive to this). + . "./$as_me.lineno" + # Exit status is that of the last command. + exit +} + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in #((((( +-n*) + case `echo 'xy\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; + esac;; +*) + ECHO_N='-n';; +esac + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null +fi +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -pR'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -pR' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -pR' + fi +else + as_ln_s='cp -pR' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + +if mkdir -p . 2>/dev/null; then + as_mkdir_p='mkdir -p "$as_dir"' +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +as_test_x='test -x' +as_executable_p=as_fn_executable_p + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + +test -n "$DJDIR" || exec 7<&0 &1 + +# Name of the host. +# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, +# so uname gets run too. +ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` + +# +# Initializations. +# +ac_default_prefix=/usr/local +ac_clean_files= +ac_config_libobj_dir=. +LIBOBJS= +cross_compiling=no +subdirs= +MFLAGS= +MAKEFLAGS= + +# Identity of this package. +PACKAGE_NAME='libircclient' +PACKAGE_TARNAME='libircclient' +PACKAGE_VERSION='1.3' +PACKAGE_STRING='libircclient 1.3' +PACKAGE_BUGREPORT='gyunaev@ulduzsoft.com' +PACKAGE_URL='' + +ac_unique_file="include/libircclient.h" +# Factoring default headers for most tests. +ac_includes_default="\ +#include +#ifdef HAVE_SYS_TYPES_H +# include +#endif +#ifdef HAVE_SYS_STAT_H +# include +#endif +#ifdef STDC_HEADERS +# include +# include +#else +# ifdef HAVE_STDLIB_H +# include +# endif +#endif +#ifdef HAVE_STRING_H +# if !defined STDC_HEADERS && defined HAVE_MEMORY_H +# include +# endif +# include +#endif +#ifdef HAVE_STRINGS_H +# include +#endif +#ifdef HAVE_INTTYPES_H +# include +#endif +#ifdef HAVE_STDINT_H +# include +#endif +#ifdef HAVE_UNISTD_H +# include +#endif" + +ac_subst_vars='LTLIBOBJS +PREFIX +TARGET +LIBOBJS +EGREP +GREP +CPP +RANLIB +AR +ac_ct_CC +CFLAGS +CC +OBJEXT +EXEEXT +ac_ct_CXX +CPPFLAGS +LDFLAGS +CXXFLAGS +CXX +target_alias +host_alias +build_alias +LIBS +ECHO_T +ECHO_N +ECHO_C +DEFS +mandir +localedir +libdir +psdir +pdfdir +dvidir +htmldir +infodir +docdir +oldincludedir +includedir +localstatedir +sharedstatedir +sysconfdir +datadir +datarootdir +libexecdir +sbindir +bindir +program_transform_name +prefix +exec_prefix +PACKAGE_URL +PACKAGE_BUGREPORT +PACKAGE_STRING +PACKAGE_VERSION +PACKAGE_TARNAME +PACKAGE_NAME +PATH_SEPARATOR +SHELL' +ac_subst_files='' +ac_user_opts=' +enable_option_checking +enable_debug +enable_shared +enable_threads +enable_ipv6 +enable_openssl +' + ac_precious_vars='build_alias +host_alias +target_alias +CXX +CXXFLAGS +LDFLAGS +LIBS +CPPFLAGS +CCC +CC +CFLAGS +CPP' + + +# Initialize some variables set by options. +ac_init_help= +ac_init_version=false +ac_unrecognized_opts= +ac_unrecognized_sep= +# The variables have the same names as the options, with +# dashes changed to underlines. +cache_file=/dev/null +exec_prefix=NONE +no_create= +no_recursion= +prefix=NONE +program_prefix=NONE +program_suffix=NONE +program_transform_name=s,x,x, +silent= +site= +srcdir= +verbose= +x_includes=NONE +x_libraries=NONE + +# Installation directory options. +# These are left unexpanded so users can "make install exec_prefix=/foo" +# and all the variables that are supposed to be based on exec_prefix +# by default will actually change. +# Use braces instead of parens because sh, perl, etc. also accept them. +# (The list follows the same order as the GNU Coding Standards.) +bindir='${exec_prefix}/bin' +sbindir='${exec_prefix}/sbin' +libexecdir='${exec_prefix}/libexec' +datarootdir='${prefix}/share' +datadir='${datarootdir}' +sysconfdir='${prefix}/etc' +sharedstatedir='${prefix}/com' +localstatedir='${prefix}/var' +includedir='${prefix}/include' +oldincludedir='/usr/include' +docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' +infodir='${datarootdir}/info' +htmldir='${docdir}' +dvidir='${docdir}' +pdfdir='${docdir}' +psdir='${docdir}' +libdir='${exec_prefix}/lib' +localedir='${datarootdir}/locale' +mandir='${datarootdir}/man' + +ac_prev= +ac_dashdash= +for ac_option +do + # If the previous option needs an argument, assign it. + if test -n "$ac_prev"; then + eval $ac_prev=\$ac_option + ac_prev= + continue + fi + + case $ac_option in + *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; + *=) ac_optarg= ;; + *) ac_optarg=yes ;; + esac + + # Accept the important Cygnus configure options, so we can diagnose typos. + + case $ac_dashdash$ac_option in + --) + ac_dashdash=yes ;; + + -bindir | --bindir | --bindi | --bind | --bin | --bi) + ac_prev=bindir ;; + -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) + bindir=$ac_optarg ;; + + -build | --build | --buil | --bui | --bu) + ac_prev=build_alias ;; + -build=* | --build=* | --buil=* | --bui=* | --bu=*) + build_alias=$ac_optarg ;; + + -cache-file | --cache-file | --cache-fil | --cache-fi \ + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) + ac_prev=cache_file ;; + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) + cache_file=$ac_optarg ;; + + --config-cache | -C) + cache_file=config.cache ;; + + -datadir | --datadir | --datadi | --datad) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=*) + datadir=$ac_optarg ;; + + -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ + | --dataroo | --dataro | --datar) + ac_prev=datarootdir ;; + -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ + | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) + datarootdir=$ac_optarg ;; + + -disable-* | --disable-*) + ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid feature name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=no ;; + + -docdir | --docdir | --docdi | --doc | --do) + ac_prev=docdir ;; + -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) + docdir=$ac_optarg ;; + + -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) + ac_prev=dvidir ;; + -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) + dvidir=$ac_optarg ;; + + -enable-* | --enable-*) + ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid feature name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=\$ac_optarg ;; + + -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ + | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ + | --exec | --exe | --ex) + ac_prev=exec_prefix ;; + -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ + | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ + | --exec=* | --exe=* | --ex=*) + exec_prefix=$ac_optarg ;; + + -gas | --gas | --ga | --g) + # Obsolete; use --with-gas. + with_gas=yes ;; + + -help | --help | --hel | --he | -h) + ac_init_help=long ;; + -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) + ac_init_help=recursive ;; + -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) + ac_init_help=short ;; + + -host | --host | --hos | --ho) + ac_prev=host_alias ;; + -host=* | --host=* | --hos=* | --ho=*) + host_alias=$ac_optarg ;; + + -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) + ac_prev=htmldir ;; + -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ + | --ht=*) + htmldir=$ac_optarg ;; + + -includedir | --includedir | --includedi | --included | --include \ + | --includ | --inclu | --incl | --inc) + ac_prev=includedir ;; + -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ + | --includ=* | --inclu=* | --incl=* | --inc=*) + includedir=$ac_optarg ;; + + -infodir | --infodir | --infodi | --infod | --info | --inf) + ac_prev=infodir ;; + -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) + infodir=$ac_optarg ;; + + -libdir | --libdir | --libdi | --libd) + ac_prev=libdir ;; + -libdir=* | --libdir=* | --libdi=* | --libd=*) + libdir=$ac_optarg ;; + + -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ + | --libexe | --libex | --libe) + ac_prev=libexecdir ;; + -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ + | --libexe=* | --libex=* | --libe=*) + libexecdir=$ac_optarg ;; + + -localedir | --localedir | --localedi | --localed | --locale) + ac_prev=localedir ;; + -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) + localedir=$ac_optarg ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst | --locals) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) + localstatedir=$ac_optarg ;; + + -mandir | --mandir | --mandi | --mand | --man | --ma | --m) + ac_prev=mandir ;; + -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) + mandir=$ac_optarg ;; + + -nfp | --nfp | --nf) + # Obsolete; use --without-fp. + with_fp=no ;; + + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c | -n) + no_create=yes ;; + + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) + no_recursion=yes ;; + + -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ + | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ + | --oldin | --oldi | --old | --ol | --o) + ac_prev=oldincludedir ;; + -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ + | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ + | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) + oldincludedir=$ac_optarg ;; + + -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) + ac_prev=prefix ;; + -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) + prefix=$ac_optarg ;; + + -program-prefix | --program-prefix | --program-prefi | --program-pref \ + | --program-pre | --program-pr | --program-p) + ac_prev=program_prefix ;; + -program-prefix=* | --program-prefix=* | --program-prefi=* \ + | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) + program_prefix=$ac_optarg ;; + + -program-suffix | --program-suffix | --program-suffi | --program-suff \ + | --program-suf | --program-su | --program-s) + ac_prev=program_suffix ;; + -program-suffix=* | --program-suffix=* | --program-suffi=* \ + | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) + program_suffix=$ac_optarg ;; + + -program-transform-name | --program-transform-name \ + | --program-transform-nam | --program-transform-na \ + | --program-transform-n | --program-transform- \ + | --program-transform | --program-transfor \ + | --program-transfo | --program-transf \ + | --program-trans | --program-tran \ + | --progr-tra | --program-tr | --program-t) + ac_prev=program_transform_name ;; + -program-transform-name=* | --program-transform-name=* \ + | --program-transform-nam=* | --program-transform-na=* \ + | --program-transform-n=* | --program-transform-=* \ + | --program-transform=* | --program-transfor=* \ + | --program-transfo=* | --program-transf=* \ + | --program-trans=* | --program-tran=* \ + | --progr-tra=* | --program-tr=* | --program-t=*) + program_transform_name=$ac_optarg ;; + + -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) + ac_prev=pdfdir ;; + -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) + pdfdir=$ac_optarg ;; + + -psdir | --psdir | --psdi | --psd | --ps) + ac_prev=psdir ;; + -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) + psdir=$ac_optarg ;; + + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + silent=yes ;; + + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) + ac_prev=sbindir ;; + -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ + | --sbi=* | --sb=*) + sbindir=$ac_optarg ;; + + -sharedstatedir | --sharedstatedir | --sharedstatedi \ + | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ + | --sharedst | --shareds | --shared | --share | --shar \ + | --sha | --sh) + ac_prev=sharedstatedir ;; + -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ + | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ + | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ + | --sha=* | --sh=*) + sharedstatedir=$ac_optarg ;; + + -site | --site | --sit) + ac_prev=site ;; + -site=* | --site=* | --sit=*) + site=$ac_optarg ;; + + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + srcdir=$ac_optarg ;; + + -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ + | --syscon | --sysco | --sysc | --sys | --sy) + ac_prev=sysconfdir ;; + -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ + | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) + sysconfdir=$ac_optarg ;; + + -target | --target | --targe | --targ | --tar | --ta | --t) + ac_prev=target_alias ;; + -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) + target_alias=$ac_optarg ;; + + -v | -verbose | --verbose | --verbos | --verbo | --verb) + verbose=yes ;; + + -version | --version | --versio | --versi | --vers | -V) + ac_init_version=: ;; + + -with-* | --with-*) + ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid package name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=\$ac_optarg ;; + + -without-* | --without-*) + ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid package name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=no ;; + + --x) + # Obsolete; use --with-x. + with_x=yes ;; + + -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ + | --x-incl | --x-inc | --x-in | --x-i) + ac_prev=x_includes ;; + -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ + | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) + x_includes=$ac_optarg ;; + + -x-libraries | --x-libraries | --x-librarie | --x-librari \ + | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) + ac_prev=x_libraries ;; + -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ + | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) + x_libraries=$ac_optarg ;; + + -*) as_fn_error $? "unrecognized option: \`$ac_option' +Try \`$0 --help' for more information" + ;; + + *=*) + ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` + # Reject names that are not valid shell variable names. + case $ac_envvar in #( + '' | [0-9]* | *[!_$as_cr_alnum]* ) + as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; + esac + eval $ac_envvar=\$ac_optarg + export $ac_envvar ;; + + *) + # FIXME: should be removed in autoconf 3.0. + $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 + expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && + $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 + : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" + ;; + + esac +done + +if test -n "$ac_prev"; then + ac_option=--`echo $ac_prev | sed 's/_/-/g'` + as_fn_error $? "missing argument to $ac_option" +fi + +if test -n "$ac_unrecognized_opts"; then + case $enable_option_checking in + no) ;; + fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; + *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; + esac +fi + +# Check all directory arguments for consistency. +for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ + datadir sysconfdir sharedstatedir localstatedir includedir \ + oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ + libdir localedir mandir +do + eval ac_val=\$$ac_var + # Remove trailing slashes. + case $ac_val in + */ ) + ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` + eval $ac_var=\$ac_val;; + esac + # Be sure to have absolute directory names. + case $ac_val in + [\\/$]* | ?:[\\/]* ) continue;; + NONE | '' ) case $ac_var in *prefix ) continue;; esac;; + esac + as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" +done + +# There might be people who depend on the old broken behavior: `$host' +# used to hold the argument of --host etc. +# FIXME: To remove some day. +build=$build_alias +host=$host_alias +target=$target_alias + +# FIXME: To remove some day. +if test "x$host_alias" != x; then + if test "x$build_alias" = x; then + cross_compiling=maybe + elif test "x$build_alias" != "x$host_alias"; then + cross_compiling=yes + fi +fi + +ac_tool_prefix= +test -n "$host_alias" && ac_tool_prefix=$host_alias- + +test "$silent" = yes && exec 6>/dev/null + + +ac_pwd=`pwd` && test -n "$ac_pwd" && +ac_ls_di=`ls -di .` && +ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || + as_fn_error $? "working directory cannot be determined" +test "X$ac_ls_di" = "X$ac_pwd_ls_di" || + as_fn_error $? "pwd does not report name of working directory" + + +# Find the source files, if location was not specified. +if test -z "$srcdir"; then + ac_srcdir_defaulted=yes + # Try the directory containing this script, then the parent directory. + ac_confdir=`$as_dirname -- "$as_myself" || +$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_myself" : 'X\(//\)[^/]' \| \ + X"$as_myself" : 'X\(//\)$' \| \ + X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_myself" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + srcdir=$ac_confdir + if test ! -r "$srcdir/$ac_unique_file"; then + srcdir=.. + fi +else + ac_srcdir_defaulted=no +fi +if test ! -r "$srcdir/$ac_unique_file"; then + test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." + as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" +fi +ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" +ac_abs_confdir=`( + cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" + pwd)` +# When building in place, set srcdir=. +if test "$ac_abs_confdir" = "$ac_pwd"; then + srcdir=. +fi +# Remove unnecessary trailing slashes from srcdir. +# Double slashes in file names in object file debugging info +# mess up M-x gdb in Emacs. +case $srcdir in +*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; +esac +for ac_var in $ac_precious_vars; do + eval ac_env_${ac_var}_set=\${${ac_var}+set} + eval ac_env_${ac_var}_value=\$${ac_var} + eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} + eval ac_cv_env_${ac_var}_value=\$${ac_var} +done + +# +# Report the --help message. +# +if test "$ac_init_help" = "long"; then + # Omit some internal or obsolete options to make the list less imposing. + # This message is too long to be a string in the A/UX 3.1 sh. + cat <<_ACEOF +\`configure' configures libircclient 1.3 to adapt to many kinds of systems. + +Usage: $0 [OPTION]... [VAR=VALUE]... + +To assign environment variables (e.g., CC, CFLAGS...), specify them as +VAR=VALUE. See below for descriptions of some of the useful variables. + +Defaults for the options are specified in brackets. + +Configuration: + -h, --help display this help and exit + --help=short display options specific to this package + --help=recursive display the short help of all the included packages + -V, --version display version information and exit + -q, --quiet, --silent do not print \`checking ...' messages + --cache-file=FILE cache test results in FILE [disabled] + -C, --config-cache alias for \`--cache-file=config.cache' + -n, --no-create do not create output files + --srcdir=DIR find the sources in DIR [configure dir or \`..'] + +Installation directories: + --prefix=PREFIX install architecture-independent files in PREFIX + [$ac_default_prefix] + --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX + [PREFIX] + +By default, \`make install' will install all the files in +\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify +an installation prefix other than \`$ac_default_prefix' using \`--prefix', +for instance \`--prefix=\$HOME'. + +For better control, use the options below. + +Fine tuning of the installation directories: + --bindir=DIR user executables [EPREFIX/bin] + --sbindir=DIR system admin executables [EPREFIX/sbin] + --libexecdir=DIR program executables [EPREFIX/libexec] + --sysconfdir=DIR read-only single-machine data [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] + --localstatedir=DIR modifiable single-machine data [PREFIX/var] + --libdir=DIR object code libraries [EPREFIX/lib] + --includedir=DIR C header files [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc [/usr/include] + --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] + --datadir=DIR read-only architecture-independent data [DATAROOTDIR] + --infodir=DIR info documentation [DATAROOTDIR/info] + --localedir=DIR locale-dependent data [DATAROOTDIR/locale] + --mandir=DIR man documentation [DATAROOTDIR/man] + --docdir=DIR documentation root [DATAROOTDIR/doc/libircclient] + --htmldir=DIR html documentation [DOCDIR] + --dvidir=DIR dvi documentation [DOCDIR] + --pdfdir=DIR pdf documentation [DOCDIR] + --psdir=DIR ps documentation [DOCDIR] +_ACEOF + + cat <<\_ACEOF +_ACEOF +fi + +if test -n "$ac_init_help"; then + case $ac_init_help in + short | recursive ) echo "Configuration of libircclient 1.3:";; + esac + cat <<\_ACEOF + +Optional Features: + --disable-option-checking ignore unrecognized --enable/--with options + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --enable-debug compile with debug information (no) + --enable-shared build a shared library (no) + --enable-threads compile with multithread support (yes) + --enable-ipv6 compile with IPv6 support (no) + --enable-openssl compile with OpenSSL support (no) + +Some influential environment variables: + CXX C++ compiler command + CXXFLAGS C++ compiler flags + LDFLAGS linker flags, e.g. -L if you have libraries in a + nonstandard directory + LIBS libraries to pass to the linker, e.g. -l + CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if + you have headers in a nonstandard directory + CC C compiler command + CFLAGS C compiler flags + CPP C preprocessor + +Use these variables to override the choices made by `configure' or to help +it to find libraries and programs with nonstandard names/locations. + +Report bugs to . +_ACEOF +ac_status=$? +fi + +if test "$ac_init_help" = "recursive"; then + # If there are subdirs, report their specific --help. + for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue + test -d "$ac_dir" || + { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || + continue + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + cd "$ac_dir" || { ac_status=$?; continue; } + # Check for guested configure. + if test -f "$ac_srcdir/configure.gnu"; then + echo && + $SHELL "$ac_srcdir/configure.gnu" --help=recursive + elif test -f "$ac_srcdir/configure"; then + echo && + $SHELL "$ac_srcdir/configure" --help=recursive + else + $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 + fi || ac_status=$? + cd "$ac_pwd" || { ac_status=$?; break; } + done +fi + +test -n "$ac_init_help" && exit $ac_status +if $ac_init_version; then + cat <<\_ACEOF +libircclient configure 1.3 +generated by GNU Autoconf 2.69 + +Copyright (C) 2012 Free Software Foundation, Inc. +This configure script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it. +_ACEOF + exit +fi + +## ------------------------ ## +## Autoconf initialization. ## +## ------------------------ ## + +# ac_fn_cxx_try_compile LINENO +# ---------------------------- +# Try to compile conftest.$ac_ext, and return whether this succeeded. +ac_fn_cxx_try_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext + if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_cxx_try_compile + +# ac_fn_c_try_compile LINENO +# -------------------------- +# Try to compile conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext + if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_compile + +# ac_fn_c_try_cpp LINENO +# ---------------------- +# Try to preprocess conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_cpp () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { { ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } > conftest.i && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_cpp + +# ac_fn_c_try_run LINENO +# ---------------------- +# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes +# that executables *can* be run. +ac_fn_c_try_run () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then : + ac_retval=0 +else + $as_echo "$as_me: program exited with status $ac_status" >&5 + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=$ac_status +fi + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_run + +# ac_fn_c_check_type LINENO TYPE VAR INCLUDES +# ------------------------------------------- +# Tests whether TYPE exists after having included INCLUDES, setting cache +# variable VAR accordingly. +ac_fn_c_check_type () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + eval "$3=no" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +if (sizeof ($2)) + return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +if (sizeof (($2))) + return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + +else + eval "$3=yes" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_type + +# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES +# ------------------------------------------------------- +# Tests whether HEADER exists and can be compiled using the include files in +# INCLUDES, setting the cache variable VAR accordingly. +ac_fn_c_check_header_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +#include <$2> +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + eval "$3=yes" +else + eval "$3=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_header_compile + +# ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES +# ------------------------------------------------------- +# Tests whether HEADER exists, giving a warning if it cannot be compiled using +# the include files in INCLUDES and setting the cache variable VAR +# accordingly. +ac_fn_c_check_header_mongrel () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if eval \${$3+:} false; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +else + # Is the header compilable? +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 +$as_echo_n "checking $2 usability... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +#include <$2> +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_header_compiler=yes +else + ac_header_compiler=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } + +# Is the header present? +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 +$as_echo_n "checking $2 presence... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <$2> +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + ac_header_preproc=yes +else + ac_header_preproc=no +fi +rm -f conftest.err conftest.i conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( + yes:no: ) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} + ;; + no:yes:* ) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} +( $as_echo "## ------------------------------------ ## +## Report this to gyunaev@ulduzsoft.com ## +## ------------------------------------ ##" + ) | sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + eval "$3=\$ac_header_compiler" +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_header_mongrel + +# ac_fn_c_try_link LINENO +# ----------------------- +# Try to link conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_link () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext conftest$ac_exeext + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + test -x conftest$ac_exeext + }; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information + # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would + # interfere with the next link command; also delete a directory that is + # left behind by Apple's compiler. We do this before executing the actions. + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_link + +# ac_fn_c_check_func LINENO FUNC VAR +# ---------------------------------- +# Tests whether FUNC exists, setting the cache variable VAR accordingly +ac_fn_c_check_func () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +/* Define $2 to an innocuous variant, in case declares $2. + For example, HP-UX 11i declares gettimeofday. */ +#define $2 innocuous_$2 + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $2 (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef $2 + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char $2 (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined __stub_$2 || defined __stub___$2 +choke me +#endif + +int +main () +{ +return $2 (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + eval "$3=yes" +else + eval "$3=no" +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_func +cat >config.log <<_ACEOF +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. + +It was created by libircclient $as_me 1.3, which was +generated by GNU Autoconf 2.69. Invocation command line was + + $ $0 $@ + +_ACEOF +exec 5>>config.log +{ +cat <<_ASUNAME +## --------- ## +## Platform. ## +## --------- ## + +hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` + +/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` +/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` +/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` +/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` + +_ASUNAME + +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + $as_echo "PATH: $as_dir" + done +IFS=$as_save_IFS + +} >&5 + +cat >&5 <<_ACEOF + + +## ----------- ## +## Core tests. ## +## ----------- ## + +_ACEOF + + +# Keep a trace of the command line. +# Strip out --no-create and --no-recursion so they do not pile up. +# Strip out --silent because we don't want to record it for future runs. +# Also quote any args containing shell meta-characters. +# Make two passes to allow for proper duplicate-argument suppression. +ac_configure_args= +ac_configure_args0= +ac_configure_args1= +ac_must_keep_next=false +for ac_pass in 1 2 +do + for ac_arg + do + case $ac_arg in + -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + continue ;; + *\'*) + ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + case $ac_pass in + 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; + 2) + as_fn_append ac_configure_args1 " '$ac_arg'" + if test $ac_must_keep_next = true; then + ac_must_keep_next=false # Got value, back to normal. + else + case $ac_arg in + *=* | --config-cache | -C | -disable-* | --disable-* \ + | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ + | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ + | -with-* | --with-* | -without-* | --without-* | --x) + case "$ac_configure_args0 " in + "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; + esac + ;; + -* ) ac_must_keep_next=true ;; + esac + fi + as_fn_append ac_configure_args " '$ac_arg'" + ;; + esac + done +done +{ ac_configure_args0=; unset ac_configure_args0;} +{ ac_configure_args1=; unset ac_configure_args1;} + +# When interrupted or exit'd, cleanup temporary files, and complete +# config.log. We remove comments because anyway the quotes in there +# would cause problems or look ugly. +# WARNING: Use '\'' to represent an apostrophe within the trap. +# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. +trap 'exit_status=$? + # Save into config.log some information that might help in debugging. + { + echo + + $as_echo "## ---------------- ## +## Cache variables. ## +## ---------------- ##" + echo + # The following way of writing the cache mishandles newlines in values, +( + for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( + *) { eval $ac_var=; unset $ac_var;} ;; + esac ;; + esac + done + (set) 2>&1 | + case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( + *${as_nl}ac_space=\ *) + sed -n \ + "s/'\''/'\''\\\\'\'''\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" + ;; #( + *) + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) + echo + + $as_echo "## ----------------- ## +## Output variables. ## +## ----------------- ##" + echo + for ac_var in $ac_subst_vars + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + $as_echo "$ac_var='\''$ac_val'\''" + done | sort + echo + + if test -n "$ac_subst_files"; then + $as_echo "## ------------------- ## +## File substitutions. ## +## ------------------- ##" + echo + for ac_var in $ac_subst_files + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + $as_echo "$ac_var='\''$ac_val'\''" + done | sort + echo + fi + + if test -s confdefs.h; then + $as_echo "## ----------- ## +## confdefs.h. ## +## ----------- ##" + echo + cat confdefs.h + echo + fi + test "$ac_signal" != 0 && + $as_echo "$as_me: caught signal $ac_signal" + $as_echo "$as_me: exit $exit_status" + } >&5 + rm -f core *.core core.conftest.* && + rm -f -r conftest* confdefs* conf$$* $ac_clean_files && + exit $exit_status +' 0 +for ac_signal in 1 2 13 15; do + trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal +done +ac_signal=0 + +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -f -r conftest* confdefs.h + +$as_echo "/* confdefs.h */" > confdefs.h + +# Predefined preprocessor variables. + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_NAME "$PACKAGE_NAME" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_TARNAME "$PACKAGE_TARNAME" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_VERSION "$PACKAGE_VERSION" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_STRING "$PACKAGE_STRING" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_URL "$PACKAGE_URL" +_ACEOF + + +# Let the site file select an alternate cache file if it wants to. +# Prefer an explicitly selected file to automatically selected ones. +ac_site_file1=NONE +ac_site_file2=NONE +if test -n "$CONFIG_SITE"; then + # We do not want a PATH search for config.site. + case $CONFIG_SITE in #(( + -*) ac_site_file1=./$CONFIG_SITE;; + */*) ac_site_file1=$CONFIG_SITE;; + *) ac_site_file1=./$CONFIG_SITE;; + esac +elif test "x$prefix" != xNONE; then + ac_site_file1=$prefix/share/config.site + ac_site_file2=$prefix/etc/config.site +else + ac_site_file1=$ac_default_prefix/share/config.site + ac_site_file2=$ac_default_prefix/etc/config.site +fi +for ac_site_file in "$ac_site_file1" "$ac_site_file2" +do + test "x$ac_site_file" = xNONE && continue + if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 +$as_echo "$as_me: loading site script $ac_site_file" >&6;} + sed 's/^/| /' "$ac_site_file" >&5 + . "$ac_site_file" \ + || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "failed to load site script $ac_site_file +See \`config.log' for more details" "$LINENO" 5; } + fi +done + +if test -r "$cache_file"; then + # Some versions of bash will fail to source /dev/null (special files + # actually), so we avoid doing that. DJGPP emulates it as a regular file. + if test /dev/null != "$cache_file" && test -f "$cache_file"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 +$as_echo "$as_me: loading cache $cache_file" >&6;} + case $cache_file in + [\\/]* | ?:[\\/]* ) . "$cache_file";; + *) . "./$cache_file";; + esac + fi +else + { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 +$as_echo "$as_me: creating cache $cache_file" >&6;} + >$cache_file +fi + +# Check that the precious variables saved in the cache have kept the same +# value. +ac_cache_corrupted=false +for ac_var in $ac_precious_vars; do + eval ac_old_set=\$ac_cv_env_${ac_var}_set + eval ac_new_set=\$ac_env_${ac_var}_set + eval ac_old_val=\$ac_cv_env_${ac_var}_value + eval ac_new_val=\$ac_env_${ac_var}_value + case $ac_old_set,$ac_new_set in + set,) + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 +$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,set) + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 +$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,);; + *) + if test "x$ac_old_val" != "x$ac_new_val"; then + # differences in whitespace do not lead to failure. + ac_old_val_w=`echo x $ac_old_val` + ac_new_val_w=`echo x $ac_new_val` + if test "$ac_old_val_w" != "$ac_new_val_w"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 +$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} + ac_cache_corrupted=: + else + { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 +$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} + eval $ac_var=\$ac_old_val + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 +$as_echo "$as_me: former value: \`$ac_old_val'" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 +$as_echo "$as_me: current value: \`$ac_new_val'" >&2;} + fi;; + esac + # Pass precious variables to config.status. + if test "$ac_new_set" = set; then + case $ac_new_val in + *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; + *) ac_arg=$ac_var=$ac_new_val ;; + esac + case " $ac_configure_args " in + *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. + *) as_fn_append ac_configure_args " '$ac_arg'" ;; + esac + fi +done +if $ac_cache_corrupted; then + { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 +$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} + as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 +fi +## -------------------- ## +## Main body of script. ## +## -------------------- ## + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + +ac_config_headers="$ac_config_headers src/config.h" + + +# Check for command-line +# Check whether --enable-debug was given. +if test "${enable_debug+set}" = set; then : + enableval=$enable_debug; use_debug=$enableval +else + use_debug=no +fi + + +# Check whether --enable-shared was given. +if test "${enable_shared+set}" = set; then : + enableval=$enable_shared; build_shared=$enableval +else + build_shared=no +fi + + +# Check whether --enable-threads was given. +if test "${enable_threads+set}" = set; then : + enableval=$enable_threads; use_threads=$enableval +else + use_threads=yes +fi + + +# Check whether --enable-ipv6 was given. +if test "${enable_ipv6+set}" = set; then : + enableval=$enable_ipv6; use_ipv6=$enableval +else + use_ipv6=no +fi + + +# Check whether --enable-openssl was given. +if test "${enable_openssl+set}" = set; then : + enableval=$enable_openssl; use_openssl=$enableval +else + use_openssl=no +fi + + +# Checks for programs. +ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu +if test -z "$CXX"; then + if test -n "$CCC"; then + CXX=$CCC + else + if test -n "$ac_tool_prefix"; then + for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CXX+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CXX"; then + ac_cv_prog_CXX="$CXX" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CXX=$ac_cv_prog_CXX +if test -n "$CXX"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5 +$as_echo "$CXX" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$CXX" && break + done +fi +if test -z "$CXX"; then + ac_ct_CXX=$CXX + for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_CXX+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_CXX"; then + ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CXX="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CXX=$ac_cv_prog_ac_ct_CXX +if test -n "$ac_ct_CXX"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5 +$as_echo "$ac_ct_CXX" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$ac_ct_CXX" && break +done + + if test "x$ac_ct_CXX" = x; then + CXX="g++" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CXX=$ac_ct_CXX + fi +fi + + fi +fi +# Provide some information about the compiler. +$as_echo "$as_me:${as_lineno-$LINENO}: checking for C++ compiler version" >&5 +set X $ac_compile +ac_compiler=$2 +for ac_option in --version -v -V -qversion; do + { { ac_try="$ac_compiler $ac_option >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compiler $ac_option >&5") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + sed '10a\ +... rest of stderr output deleted ... + 10q' conftest.err >conftest.er1 + cat conftest.er1 >&5 + fi + rm -f conftest.er1 conftest.err + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +done + +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" +# Try to create an executable without -o first, disregard a.out. +# It will help us diagnose broken compilers, and finding out an intuition +# of exeext. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C++ compiler works" >&5 +$as_echo_n "checking whether the C++ compiler works... " >&6; } +ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` + +# The possible output files: +ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" + +ac_rmfiles= +for ac_file in $ac_files +do + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; + * ) ac_rmfiles="$ac_rmfiles $ac_file";; + esac +done +rm -f $ac_rmfiles + +if { { ac_try="$ac_link_default" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link_default") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. +# So ignore a value of `no', otherwise this would lead to `EXEEXT = no' +# in a Makefile. We should not override ac_cv_exeext if it was cached, +# so that the user can short-circuit this test for compilers unknown to +# Autoconf. +for ac_file in $ac_files '' +do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) + ;; + [ab].out ) + # We found the default executable, but exeext='' is most + # certainly right. + break;; + *.* ) + if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; + then :; else + ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + fi + # We set ac_cv_exeext here because the later test for it is not + # safe: cross compilers may not add the suffix if given an `-o' + # argument, so we may need to know it at that point already. + # Even if this section looks crufty: it has the advantage of + # actually working. + break;; + * ) + break;; + esac +done +test "$ac_cv_exeext" = no && ac_cv_exeext= + +else + ac_file='' +fi +if test -z "$ac_file"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +$as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "C++ compiler cannot create executables +See \`config.log' for more details" "$LINENO" 5; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C++ compiler default output file name" >&5 +$as_echo_n "checking for C++ compiler default output file name... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 +$as_echo "$ac_file" >&6; } +ac_exeext=$ac_cv_exeext + +rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out +ac_clean_files=$ac_clean_files_save +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 +$as_echo_n "checking for suffix of executables... " >&6; } +if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + # If both `conftest.exe' and `conftest' are `present' (well, observable) +# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will +# work properly (i.e., refer to `conftest.exe'), while it won't with +# `rm'. +for ac_file in conftest.exe conftest conftest.*; do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; + *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + break;; + * ) break;; + esac +done +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot compute suffix of executables: cannot compile and link +See \`config.log' for more details" "$LINENO" 5; } +fi +rm -f conftest conftest$ac_cv_exeext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 +$as_echo "$ac_cv_exeext" >&6; } + +rm -f conftest.$ac_ext +EXEEXT=$ac_cv_exeext +ac_exeext=$EXEEXT +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ +FILE *f = fopen ("conftest.out", "w"); + return ferror (f) || fclose (f) != 0; + + ; + return 0; +} +_ACEOF +ac_clean_files="$ac_clean_files conftest.out" +# Check that the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 +$as_echo_n "checking whether we are cross compiling... " >&6; } +if test "$cross_compiling" != yes; then + { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + if { ac_try='./conftest$ac_cv_exeext' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then + cross_compiling=no + else + if test "$cross_compiling" = maybe; then + cross_compiling=yes + else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot run C++ compiled programs. +If you meant to cross compile, use \`--host'. +See \`config.log' for more details" "$LINENO" 5; } + fi + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 +$as_echo "$cross_compiling" >&6; } + +rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out +ac_clean_files=$ac_clean_files_save +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 +$as_echo_n "checking for suffix of object files... " >&6; } +if ${ac_cv_objext+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.o conftest.obj +if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + for ac_file in conftest.o conftest.obj conftest.*; do + test -f "$ac_file" || continue; + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; + *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` + break;; + esac +done +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot compute suffix of object files: cannot compile +See \`config.log' for more details" "$LINENO" 5; } +fi +rm -f conftest.$ac_cv_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 +$as_echo "$ac_cv_objext" >&6; } +OBJEXT=$ac_cv_objext +ac_objext=$OBJEXT +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C++ compiler" >&5 +$as_echo_n "checking whether we are using the GNU C++ compiler... " >&6; } +if ${ac_cv_cxx_compiler_gnu+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + ac_compiler_gnu=yes +else + ac_compiler_gnu=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_cxx_compiler_gnu=$ac_compiler_gnu + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5 +$as_echo "$ac_cv_cxx_compiler_gnu" >&6; } +if test $ac_compiler_gnu = yes; then + GXX=yes +else + GXX= +fi +ac_test_CXXFLAGS=${CXXFLAGS+set} +ac_save_CXXFLAGS=$CXXFLAGS +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5 +$as_echo_n "checking whether $CXX accepts -g... " >&6; } +if ${ac_cv_prog_cxx_g+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_save_cxx_werror_flag=$ac_cxx_werror_flag + ac_cxx_werror_flag=yes + ac_cv_prog_cxx_g=no + CXXFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + ac_cv_prog_cxx_g=yes +else + CXXFLAGS="" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + +else + ac_cxx_werror_flag=$ac_save_cxx_werror_flag + CXXFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + ac_cv_prog_cxx_g=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_cxx_werror_flag=$ac_save_cxx_werror_flag +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_g" >&5 +$as_echo "$ac_cv_prog_cxx_g" >&6; } +if test "$ac_test_CXXFLAGS" = set; then + CXXFLAGS=$ac_save_CXXFLAGS +elif test $ac_cv_prog_cxx_g = yes; then + if test "$GXX" = yes; then + CXXFLAGS="-g -O2" + else + CXXFLAGS="-g" + fi +else + if test "$GXX" = yes; then + CXXFLAGS="-O2" + else + CXXFLAGS= + fi +fi +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. +set dummy ${ac_tool_prefix}gcc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}gcc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="gcc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +else + CC="$ac_cv_prog_CC" +fi + +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. +set dummy ${ac_tool_prefix}cc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}cc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + fi +fi +if test -z "$CC"; then + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + ac_prog_rejected=no +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC + shift + if test $# != 0; then + # We chose a different compiler from the bogus one. + # However, it has the same basename, so the bogon will be chosen + # first if we set CC to just the basename; use the full file name. + shift + ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" + fi +fi +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + for ac_prog in cl.exe + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$CC" && break + done +fi +if test -z "$CC"; then + ac_ct_CC=$CC + for ac_prog in cl.exe +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$ac_ct_CC" && break +done + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +fi + +fi + + +test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "no acceptable C compiler found in \$PATH +See \`config.log' for more details" "$LINENO" 5; } + +# Provide some information about the compiler. +$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 +set X $ac_compile +ac_compiler=$2 +for ac_option in --version -v -V -qversion; do + { { ac_try="$ac_compiler $ac_option >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compiler $ac_option >&5") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + sed '10a\ +... rest of stderr output deleted ... + 10q' conftest.err >conftest.er1 + cat conftest.er1 >&5 + fi + rm -f conftest.er1 conftest.err + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +done + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 +$as_echo_n "checking whether we are using the GNU C compiler... " >&6; } +if ${ac_cv_c_compiler_gnu+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_compiler_gnu=yes +else + ac_compiler_gnu=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_c_compiler_gnu=$ac_compiler_gnu + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 +$as_echo "$ac_cv_c_compiler_gnu" >&6; } +if test $ac_compiler_gnu = yes; then + GCC=yes +else + GCC= +fi +ac_test_CFLAGS=${CFLAGS+set} +ac_save_CFLAGS=$CFLAGS +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 +$as_echo_n "checking whether $CC accepts -g... " >&6; } +if ${ac_cv_prog_cc_g+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_save_c_werror_flag=$ac_c_werror_flag + ac_c_werror_flag=yes + ac_cv_prog_cc_g=no + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_g=yes +else + CFLAGS="" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + +else + ac_c_werror_flag=$ac_save_c_werror_flag + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_g=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_c_werror_flag=$ac_save_c_werror_flag +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 +$as_echo "$ac_cv_prog_cc_g" >&6; } +if test "$ac_test_CFLAGS" = set; then + CFLAGS=$ac_save_CFLAGS +elif test $ac_cv_prog_cc_g = yes; then + if test "$GCC" = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-g" + fi +else + if test "$GCC" = yes; then + CFLAGS="-O2" + else + CFLAGS= + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 +$as_echo_n "checking for $CC option to accept ISO C89... " >&6; } +if ${ac_cv_prog_cc_c89+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_cv_prog_cc_c89=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +struct stat; +/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ +struct buf { int x; }; +FILE * (*rcsopen) (struct buf *, struct stat *, int); +static char *e (p, i) + char **p; + int i; +{ + return p[i]; +} +static char *f (char * (*g) (char **, int), char **p, ...) +{ + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + va_end (v); + return s; +} + +/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has + function prototypes and stuff, but not '\xHH' hex character constants. + These don't provoke an error unfortunately, instead are silently treated + as 'x'. The following induces an error, until -std is added to get + proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an + array size at least. It's necessary to write '\x00'==0 to get something + that's true only with -std. */ +int osf4_cc_array ['\x00' == 0 ? 1 : -1]; + +/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters + inside strings and character constants. */ +#define FOO(x) 'x' +int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; + +int test (int i, double x); +struct s1 {int (*f) (int a);}; +struct s2 {int (*f) (double a);}; +int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); +int argc; +char **argv; +int +main () +{ +return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; + ; + return 0; +} +_ACEOF +for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ + -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_c89=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext + test "x$ac_cv_prog_cc_c89" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC + +fi +# AC_CACHE_VAL +case "x$ac_cv_prog_cc_c89" in + x) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +$as_echo "none needed" >&6; } ;; + xno) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +$as_echo "unsupported" >&6; } ;; + *) + CC="$CC $ac_cv_prog_cc_c89" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 +$as_echo "$ac_cv_prog_cc_c89" >&6; } ;; +esac +if test "x$ac_cv_prog_cc_c89" != xno; then : + +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. +set dummy ${ac_tool_prefix}ar; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_AR+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$AR"; then + ac_cv_prog_AR="$AR" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_AR="${ac_tool_prefix}ar" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +AR=$ac_cv_prog_AR +if test -n "$AR"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 +$as_echo "$AR" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_AR"; then + ac_ct_AR=$AR + # Extract the first word of "ar", so it can be a program name with args. +set dummy ar; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_AR+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_AR"; then + ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_AR="ar" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_AR=$ac_cv_prog_ac_ct_AR +if test -n "$ac_ct_AR"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 +$as_echo "$ac_ct_AR" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_AR" = x; then + AR=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + AR=$ac_ct_AR + fi +else + AR="$ac_cv_prog_AR" +fi + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. +set dummy ${ac_tool_prefix}ranlib; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_RANLIB+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +RANLIB=$ac_cv_prog_RANLIB +if test -n "$RANLIB"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 +$as_echo "$RANLIB" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_RANLIB"; then + ac_ct_RANLIB=$RANLIB + # Extract the first word of "ranlib", so it can be a program name with args. +set dummy ranlib; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_RANLIB+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_RANLIB"; then + ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_RANLIB="ranlib" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB +if test -n "$ac_ct_RANLIB"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 +$as_echo "$ac_ct_RANLIB" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_RANLIB" = x; then + RANLIB=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + RANLIB=$ac_ct_RANLIB + fi +else + RANLIB="$ac_cv_prog_RANLIB" +fi + + +# Checks for header files. + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 +$as_echo_n "checking how to run the C preprocessor... " >&6; } +# On Suns, sometimes $CPP names a directory. +if test -n "$CPP" && test -d "$CPP"; then + CPP= +fi +if test -z "$CPP"; then + if ${ac_cv_prog_CPP+:} false; then : + $as_echo_n "(cached) " >&6 +else + # Double quotes because CPP needs to be expanded + for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" + do + ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + +else + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + # Broken: success on invalid input. +continue +else + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.i conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.i conftest.err conftest.$ac_ext +if $ac_preproc_ok; then : + break +fi + + done + ac_cv_prog_CPP=$CPP + +fi + CPP=$ac_cv_prog_CPP +else + ac_cv_prog_CPP=$CPP +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 +$as_echo "$CPP" >&6; } +ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + +else + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + # Broken: success on invalid input. +continue +else + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.i conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.i conftest.err conftest.$ac_ext +if $ac_preproc_ok; then : + +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details" "$LINENO" 5; } +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 +$as_echo_n "checking for grep that handles long lines and -e... " >&6; } +if ${ac_cv_path_GREP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -z "$GREP"; then + ac_path_GREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in grep ggrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_GREP" || continue +# Check for GNU ac_path_GREP and select it if it is found. + # Check for GNU $ac_path_GREP +case `"$ac_path_GREP" --version 2>&1` in +*GNU*) + ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'GREP' >> "conftest.nl" + "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_GREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_GREP="$ac_path_GREP" + ac_path_GREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_GREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_GREP"; then + as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_GREP=$GREP +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 +$as_echo "$ac_cv_path_GREP" >&6; } + GREP="$ac_cv_path_GREP" + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 +$as_echo_n "checking for egrep... " >&6; } +if ${ac_cv_path_EGREP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 + then ac_cv_path_EGREP="$GREP -E" + else + if test -z "$EGREP"; then + ac_path_EGREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in egrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_EGREP" || continue +# Check for GNU ac_path_EGREP and select it if it is found. + # Check for GNU $ac_path_EGREP +case `"$ac_path_EGREP" --version 2>&1` in +*GNU*) + ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'EGREP' >> "conftest.nl" + "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_EGREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_EGREP="$ac_path_EGREP" + ac_path_EGREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_EGREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_EGREP"; then + as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_EGREP=$EGREP +fi + + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 +$as_echo "$ac_cv_path_EGREP" >&6; } + EGREP="$ac_cv_path_EGREP" + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 +$as_echo_n "checking for ANSI C header files... " >&6; } +if ${ac_cv_header_stdc+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#include +#include + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_header_stdc=yes +else + ac_cv_header_stdc=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +if test $ac_cv_header_stdc = yes; then + # SunOS 4.x string.h does not declare mem*, contrary to ANSI. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "memchr" >/dev/null 2>&1; then : + +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "free" >/dev/null 2>&1; then : + +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. + if test "$cross_compiling" = yes; then : + : +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#if ((' ' & 0x0FF) == 0x020) +# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') +# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) +#else +# define ISLOWER(c) \ + (('a' <= (c) && (c) <= 'i') \ + || ('j' <= (c) && (c) <= 'r') \ + || ('s' <= (c) && (c) <= 'z')) +# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) +#endif + +#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) +int +main () +{ + int i; + for (i = 0; i < 256; i++) + if (XOR (islower (i), ISLOWER (i)) + || toupper (i) != TOUPPER (i)) + return 2; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + +else + ac_cv_header_stdc=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 +$as_echo "$ac_cv_header_stdc" >&6; } +if test $ac_cv_header_stdc = yes; then + +$as_echo "#define STDC_HEADERS 1" >>confdefs.h + +fi + + +# Checks for typedefs, structures, and compiler characteristics. +# On IRIX 5.3, sys/types and inttypes.h are conflicting. +for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ + inttypes.h stdint.h unistd.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default +" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for stdbool.h that conforms to C99" >&5 +$as_echo_n "checking for stdbool.h that conforms to C99... " >&6; } +if ${ac_cv_header_stdbool_h+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include + #ifndef bool + "error: bool is not defined" + #endif + #ifndef false + "error: false is not defined" + #endif + #if false + "error: false is not 0" + #endif + #ifndef true + "error: true is not defined" + #endif + #if true != 1 + "error: true is not 1" + #endif + #ifndef __bool_true_false_are_defined + "error: __bool_true_false_are_defined is not defined" + #endif + + struct s { _Bool s: 1; _Bool t; } s; + + char a[true == 1 ? 1 : -1]; + char b[false == 0 ? 1 : -1]; + char c[__bool_true_false_are_defined == 1 ? 1 : -1]; + char d[(bool) 0.5 == true ? 1 : -1]; + /* See body of main program for 'e'. */ + char f[(_Bool) 0.0 == false ? 1 : -1]; + char g[true]; + char h[sizeof (_Bool)]; + char i[sizeof s.t]; + enum { j = false, k = true, l = false * true, m = true * 256 }; + /* The following fails for + HP aC++/ANSI C B3910B A.05.55 [Dec 04 2003]. */ + _Bool n[m]; + char o[sizeof n == m * sizeof n[0] ? 1 : -1]; + char p[-1 - (_Bool) 0 < 0 && -1 - (bool) 0 < 0 ? 1 : -1]; + /* Catch a bug in an HP-UX C compiler. See + http://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html + http://lists.gnu.org/archive/html/bug-coreutils/2005-11/msg00161.html + */ + _Bool q = true; + _Bool *pq = &q; + +int +main () +{ + + bool e = &s; + *pq |= q; + *pq |= ! q; + /* Refer to every declared value, to avoid compiler optimizations. */ + return (!a + !b + !c + !d + !e + !f + !g + !h + !i + !!j + !k + !!l + + !m + !n + !o + !p + !q + !pq); + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_header_stdbool_h=yes +else + ac_cv_header_stdbool_h=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdbool_h" >&5 +$as_echo "$ac_cv_header_stdbool_h" >&6; } + ac_fn_c_check_type "$LINENO" "_Bool" "ac_cv_type__Bool" "$ac_includes_default" +if test "x$ac_cv_type__Bool" = xyes; then : + +cat >>confdefs.h <<_ACEOF +#define HAVE__BOOL 1 +_ACEOF + + +fi + + +if test $ac_cv_header_stdbool_h = yes; then + +$as_echo "#define HAVE_STDBOOL_H 1" >>confdefs.h + +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5 +$as_echo_n "checking for an ANSI C-conforming const... " >&6; } +if ${ac_cv_c_const+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + +#ifndef __cplusplus + /* Ultrix mips cc rejects this sort of thing. */ + typedef int charset[2]; + const charset cs = { 0, 0 }; + /* SunOS 4.1.1 cc rejects this. */ + char const *const *pcpcc; + char **ppc; + /* NEC SVR4.0.2 mips cc rejects this. */ + struct point {int x, y;}; + static struct point const zero = {0,0}; + /* AIX XL C 1.02.0.0 rejects this. + It does not let you subtract one const X* pointer from another in + an arm of an if-expression whose if-part is not a constant + expression */ + const char *g = "string"; + pcpcc = &g + (g ? g-g : 0); + /* HPUX 7.0 cc rejects these. */ + ++pcpcc; + ppc = (char**) pcpcc; + pcpcc = (char const *const *) ppc; + { /* SCO 3.2v4 cc rejects this sort of thing. */ + char tx; + char *t = &tx; + char const *s = 0 ? (char *) 0 : (char const *) 0; + + *t++ = 0; + if (s) return 0; + } + { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ + int x[] = {25, 17}; + const int *foo = &x[0]; + ++foo; + } + { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ + typedef const int *iptr; + iptr p = 0; + ++p; + } + { /* AIX XL C 1.02.0.0 rejects this sort of thing, saying + "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ + struct s { int j; const int *ap[3]; } bx; + struct s *b = &bx; b->j = 5; + } + { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ + const int foo = 10; + if (!foo) return 0; + } + return !cs[0] && !zero.x; +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_c_const=yes +else + ac_cv_c_const=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_const" >&5 +$as_echo "$ac_cv_c_const" >&6; } +if test $ac_cv_c_const = no; then + +$as_echo "#define const /**/" >>confdefs.h + +fi + +ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default" +if test "x$ac_cv_type_size_t" = xyes; then : + +else + +cat >>confdefs.h <<_ACEOF +#define size_t unsigned int +_ACEOF + +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether time.h and sys/time.h may both be included" >&5 +$as_echo_n "checking whether time.h and sys/time.h may both be included... " >&6; } +if ${ac_cv_header_time+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#include + +int +main () +{ +if ((struct tm *) 0) +return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_header_time=yes +else + ac_cv_header_time=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_time" >&5 +$as_echo "$ac_cv_header_time" >&6; } +if test $ac_cv_header_time = yes; then + +$as_echo "#define TIME_WITH_SYS_TIME 1" >>confdefs.h + +fi + + +# Checks for library functions. +for ac_header in stdlib.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "stdlib.h" "ac_cv_header_stdlib_h" "$ac_includes_default" +if test "x$ac_cv_header_stdlib_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_STDLIB_H 1 +_ACEOF + +fi + +done + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU libc compatible malloc" >&5 +$as_echo_n "checking for GNU libc compatible malloc... " >&6; } +if ${ac_cv_func_malloc_0_nonnull+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + ac_cv_func_malloc_0_nonnull=no +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#if defined STDC_HEADERS || defined HAVE_STDLIB_H +# include +#else +char *malloc (); +#endif + +int +main () +{ +return ! malloc (0); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + ac_cv_func_malloc_0_nonnull=yes +else + ac_cv_func_malloc_0_nonnull=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_malloc_0_nonnull" >&5 +$as_echo "$ac_cv_func_malloc_0_nonnull" >&6; } +if test $ac_cv_func_malloc_0_nonnull = yes; then : + +$as_echo "#define HAVE_MALLOC 1" >>confdefs.h + +else + $as_echo "#define HAVE_MALLOC 0" >>confdefs.h + + case " $LIBOBJS " in + *" malloc.$ac_objext "* ) ;; + *) LIBOBJS="$LIBOBJS malloc.$ac_objext" + ;; +esac + + +$as_echo "#define malloc rpl_malloc" >>confdefs.h + +fi + + +for ac_header in sys/select.h sys/socket.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking types of arguments for select" >&5 +$as_echo_n "checking types of arguments for select... " >&6; } +if ${ac_cv_func_select_args+:} false; then : + $as_echo_n "(cached) " >&6 +else + for ac_arg234 in 'fd_set *' 'int *' 'void *'; do + for ac_arg1 in 'int' 'size_t' 'unsigned long int' 'unsigned int'; do + for ac_arg5 in 'struct timeval *' 'const struct timeval *'; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default +#ifdef HAVE_SYS_SELECT_H +# include +#endif +#ifdef HAVE_SYS_SOCKET_H +# include +#endif + +int +main () +{ +extern int select ($ac_arg1, + $ac_arg234, $ac_arg234, $ac_arg234, + $ac_arg5); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_func_select_args="$ac_arg1,$ac_arg234,$ac_arg5"; break 3 +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + done + done +done +# Provide a safe default value. +: "${ac_cv_func_select_args=int,int *,struct timeval *}" + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_select_args" >&5 +$as_echo "$ac_cv_func_select_args" >&6; } +ac_save_IFS=$IFS; IFS=',' +set dummy `echo "$ac_cv_func_select_args" | sed 's/\*/\*/g'` +IFS=$ac_save_IFS +shift + +cat >>confdefs.h <<_ACEOF +#define SELECT_TYPE_ARG1 $1 +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define SELECT_TYPE_ARG234 ($2) +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define SELECT_TYPE_ARG5 ($3) +_ACEOF + +rm -f conftest* + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether lstat correctly handles trailing slash" >&5 +$as_echo_n "checking whether lstat correctly handles trailing slash... " >&6; } +if ${ac_cv_func_lstat_dereferences_slashed_symlink+:} false; then : + $as_echo_n "(cached) " >&6 +else + rm -f conftest.sym conftest.file +echo >conftest.file +if test "$as_ln_s" = "ln -s" && ln -s conftest.file conftest.sym; then + if test "$cross_compiling" = yes; then : + ac_cv_func_lstat_dereferences_slashed_symlink=no +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +struct stat sbuf; + /* Linux will dereference the symlink and fail, as required by POSIX. + That is better in the sense that it means we will not + have to compile and use the lstat wrapper. */ + return lstat ("conftest.sym/", &sbuf) == 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + ac_cv_func_lstat_dereferences_slashed_symlink=yes +else + ac_cv_func_lstat_dereferences_slashed_symlink=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +else + # If the `ln -s' command failed, then we probably don't even + # have an lstat function. + ac_cv_func_lstat_dereferences_slashed_symlink=no +fi +rm -f conftest.sym conftest.file + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_lstat_dereferences_slashed_symlink" >&5 +$as_echo "$ac_cv_func_lstat_dereferences_slashed_symlink" >&6; } + +test $ac_cv_func_lstat_dereferences_slashed_symlink = yes && + +cat >>confdefs.h <<_ACEOF +#define LSTAT_FOLLOWS_SLASHED_SYMLINK 1 +_ACEOF + + +if test "x$ac_cv_func_lstat_dereferences_slashed_symlink" = xno; then + case " $LIBOBJS " in + *" lstat.$ac_objext "* ) ;; + *) LIBOBJS="$LIBOBJS lstat.$ac_objext" + ;; +esac + +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stat accepts an empty string" >&5 +$as_echo_n "checking whether stat accepts an empty string... " >&6; } +if ${ac_cv_func_stat_empty_string_bug+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + ac_cv_func_stat_empty_string_bug=yes +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +struct stat sbuf; + return stat ("", &sbuf) == 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + ac_cv_func_stat_empty_string_bug=no +else + ac_cv_func_stat_empty_string_bug=yes +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_stat_empty_string_bug" >&5 +$as_echo "$ac_cv_func_stat_empty_string_bug" >&6; } +if test $ac_cv_func_stat_empty_string_bug = yes; then + case " $LIBOBJS " in + *" stat.$ac_objext "* ) ;; + *) LIBOBJS="$LIBOBJS stat.$ac_objext" + ;; +esac + + +cat >>confdefs.h <<_ACEOF +#define HAVE_STAT_EMPTY_STRING_BUG 1 +_ACEOF + +fi + +for ac_func in localtime_r socket +do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for socket in -lsocket" >&5 +$as_echo_n "checking for socket in -lsocket... " >&6; } +if ${ac_cv_lib_socket_socket+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lsocket $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char socket (); +int +main () +{ +return socket (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_socket_socket=yes +else + ac_cv_lib_socket_socket=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_socket" >&5 +$as_echo "$ac_cv_lib_socket_socket" >&6; } +if test "x$ac_cv_lib_socket_socket" = xyes; then : + $as_echo "#define HAVE_SOCKET 1" >>confdefs.h + LIBS="$LIBS -lsocket" +fi + + +if test "$use_debug" = "yes"; then + CFLAGS="${CFLAGS} -g -DENABLE_DEBUG" +else + CFLAGS="${CFLAGS} -O3" +fi + +# Choosing the target +TARGET="static" +if test "$build_shared" = "yes"; then + CFLAGS="$CFLAGS -fpic" + TARGET="shared" +fi + +if test "$use_ipv6" = "yes"; then + for ac_func in getaddrinfo inet_pton +do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for getaddrinfo in -lnsl" >&5 +$as_echo_n "checking for getaddrinfo in -lnsl... " >&6; } +if ${ac_cv_lib_nsl_getaddrinfo+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lnsl $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char getaddrinfo (); +int +main () +{ +return getaddrinfo (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_nsl_getaddrinfo=yes +else + ac_cv_lib_nsl_getaddrinfo=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nsl_getaddrinfo" >&5 +$as_echo "$ac_cv_lib_nsl_getaddrinfo" >&6; } +if test "x$ac_cv_lib_nsl_getaddrinfo" = xyes; then : + $as_echo "#define HAVE_GETADDRINFO 1" >>confdefs.h + LIBS="$LIBS -lnsl" +fi + + CFLAGS="$CFLAGS -DENABLE_IPV6" +else + for ac_func in gethostbyname_r inet_ntoa +do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for inet_ntoa in -lnsl" >&5 +$as_echo_n "checking for inet_ntoa in -lnsl... " >&6; } +if ${ac_cv_lib_nsl_inet_ntoa+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lnsl $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char inet_ntoa (); +int +main () +{ +return inet_ntoa (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_nsl_inet_ntoa=yes +else + ac_cv_lib_nsl_inet_ntoa=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nsl_inet_ntoa" >&5 +$as_echo "$ac_cv_lib_nsl_inet_ntoa" >&6; } +if test "x$ac_cv_lib_nsl_inet_ntoa" = xyes; then : + $as_echo "#define HAVE_INET_NTOA 1" >>confdefs.h + LIBS="$LIBS -lnsl" +fi + +fi + +if test "$use_threads" = "yes"; then + CFLAGS="$CFLAGS -DENABLE_THREADS -D_REENTRANT" +fi + + +# Checking for mingw +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking For MinGW32" >&5 +$as_echo_n "checking For MinGW32... " >&6; } +case "$host" in + *-*-mingw*) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + CFLAGS="$CFLAGS -DWIN32_DLL" + LIBS="$LIBS -lz -lwsock32 -lgdi32 -lkernel32" # for openssl + TARGET="shared_mingw" + ;; + *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } ;; +esac + +if test "$use_openssl" = "yes"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for CRYPTO_free in -lcrypto" >&5 +$as_echo_n "checking for CRYPTO_free in -lcrypto... " >&6; } +if ${ac_cv_lib_crypto_CRYPTO_free+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lcrypto $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char CRYPTO_free (); +int +main () +{ +return CRYPTO_free (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_crypto_CRYPTO_free=yes +else + ac_cv_lib_crypto_CRYPTO_free=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_CRYPTO_free" >&5 +$as_echo "$ac_cv_lib_crypto_CRYPTO_free" >&6; } +if test "x$ac_cv_lib_crypto_CRYPTO_free" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBCRYPTO 1 +_ACEOF + + LIBS="-lcrypto $LIBS" + +else + as_fn_error $? "OpenSSL not found (libcrypto)" "$LINENO" 5 +fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SSL_CTX_new in -lssl" >&5 +$as_echo_n "checking for SSL_CTX_new in -lssl... " >&6; } +if ${ac_cv_lib_ssl_SSL_CTX_new+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lssl $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char SSL_CTX_new (); +int +main () +{ +return SSL_CTX_new (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_ssl_SSL_CTX_new=yes +else + ac_cv_lib_ssl_SSL_CTX_new=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ssl_SSL_CTX_new" >&5 +$as_echo "$ac_cv_lib_ssl_SSL_CTX_new" >&6; } +if test "x$ac_cv_lib_ssl_SSL_CTX_new" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBSSL 1 +_ACEOF + + LIBS="-lssl $LIBS" + +else + as_fn_error $? "OpenSSL not found (libssl)" "$LINENO" 5 +fi + + ac_fn_c_check_header_mongrel "$LINENO" "openssl/ssl.h" "ac_cv_header_openssl_ssl_h" "$ac_includes_default" +if test "x$ac_cv_header_openssl_ssl_h" = xyes; then : + +else + as_fn_error $? "OpenSSL headers not found; did you install the -dev package?" "$LINENO" 5 +fi + + + CFLAGS="$CFLAGS -DENABLE_SSL" +fi + + + + + + +ac_config_files="$ac_config_files examples/Makefile src/Makefile" + +cat >confcache <<\_ACEOF +# This file is a shell script that caches the results of configure +# tests run on this system so they can be shared between configure +# scripts and configure runs, see configure's option --config-cache. +# It is not useful on other systems. If it contains results you don't +# want to keep, you may remove or edit it. +# +# config.status only pays attention to the cache file if you give it +# the --recheck option to rerun configure. +# +# `ac_cv_env_foo' variables (set or unset) will be overridden when +# loading this file, other *unset* `ac_cv_foo' will be assigned the +# following values. + +_ACEOF + +# The following way of writing the cache mishandles newlines in values, +# but we know of no workaround that is simple, portable, and efficient. +# So, we kill variables containing newlines. +# Ultrix sh set writes to stderr and can't be redirected directly, +# and sets the high bit in the cache file unless we assign to the vars. +( + for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( + *) { eval $ac_var=; unset $ac_var;} ;; + esac ;; + esac + done + + (set) 2>&1 | + case $as_nl`(ac_space=' '; set) 2>&1` in #( + *${as_nl}ac_space=\ *) + # `set' does not quote correctly, so add quotes: double-quote + # substitution turns \\\\ into \\, and sed turns \\ into \. + sed -n \ + "s/'/'\\\\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" + ;; #( + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) | + sed ' + /^ac_cv_env_/b end + t clear + :clear + s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ + t end + s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ + :end' >>confcache +if diff "$cache_file" confcache >/dev/null 2>&1; then :; else + if test -w "$cache_file"; then + if test "x$cache_file" != "x/dev/null"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 +$as_echo "$as_me: updating cache $cache_file" >&6;} + if test ! -f "$cache_file" || test -h "$cache_file"; then + cat confcache >"$cache_file" + else + case $cache_file in #( + */* | ?:*) + mv -f confcache "$cache_file"$$ && + mv -f "$cache_file"$$ "$cache_file" ;; #( + *) + mv -f confcache "$cache_file" ;; + esac + fi + fi + else + { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 +$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} + fi +fi +rm -f confcache + +test "x$prefix" = xNONE && prefix=$ac_default_prefix +# Let make expand exec_prefix. +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + +DEFS=-DHAVE_CONFIG_H + +ac_libobjs= +ac_ltlibobjs= +U= +for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue + # 1. Remove the extension, and $U if already installed. + ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' + ac_i=`$as_echo "$ac_i" | sed "$ac_script"` + # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR + # will be set to the directory where LIBOBJS objects are built. + as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" + as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' +done +LIBOBJS=$ac_libobjs + +LTLIBOBJS=$ac_ltlibobjs + + + +: "${CONFIG_STATUS=./config.status}" +ac_write_fail=0 +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files $CONFIG_STATUS" +{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 +$as_echo "$as_me: creating $CONFIG_STATUS" >&6;} +as_write_fail=0 +cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 +#! $SHELL +# Generated by $as_me. +# Run this file to recreate the current configuration. +# Compiler output produced by configure, useful for debugging +# configure, is in config.log if it exists. + +debug=false +ac_cs_recheck=false +ac_cs_silent=false + +SHELL=\${CONFIG_SHELL-$SHELL} +export SHELL +_ASEOF +cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 +## -------------------- ## +## M4sh Initialization. ## +## -------------------- ## + +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi + + +as_nl=' +' +export as_nl +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +# Prefer a ksh shell builtin over an external printf program on Solaris, +# but without wasting forks for bash or zsh. +if test -z "$BASH_VERSION$ZSH_VERSION" \ + && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='print -r --' + as_echo_n='print -rn --' +elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' + else + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in #( + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' + fi + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' +fi + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +fi + + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +as_myself= +case $0 in #(( + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + exit 1 +fi + +# Unset variables that we do not need and which cause bugs (e.g. in +# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" +# suppresses any "Segmentation fault" message there. '((' could +# trigger a bug in pdksh 5.2.14. +for as_var in BASH_ENV ENV MAIL MAILPATH +do eval test x\${$as_var+set} = xset \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# CDPATH. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + + +# as_fn_error STATUS ERROR [LINENO LOG_FD] +# ---------------------------------------- +# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are +# provided, also output the error to LOG_FD, referencing LINENO. Then exit the +# script with STATUS, using 1 if that was 0. +as_fn_error () +{ + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + fi + $as_echo "$as_me: error: $2" >&2 + as_fn_exit $as_status +} # as_fn_error + + +# as_fn_set_status STATUS +# ----------------------- +# Set $? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} # as_fn_set_status + +# as_fn_exit STATUS +# ----------------- +# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} # as_fn_exit + +# as_fn_unset VAR +# --------------- +# Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset +# as_fn_append VAR VALUE +# ---------------------- +# Append the text in VALUE to the end of the definition contained in VAR. Take +# advantage of any shell optimizations that allow amortized linear growth over +# repeated appends, instead of the typical quadratic growth present in naive +# implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else + as_fn_append () + { + eval $1=\$$1\$2 + } +fi # as_fn_append + +# as_fn_arith ARG... +# ------------------ +# Perform arithmetic evaluation on the ARGs, and store the result in the +# global $as_val. Take advantage of shells that can avoid forks. The arguments +# must be portable across $(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } +fi # as_fn_arith + + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in #((((( +-n*) + case `echo 'xy\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; + esac;; +*) + ECHO_N='-n';; +esac + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null +fi +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -pR'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -pR' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -pR' + fi +else + as_ln_s='cp -pR' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + + +# as_fn_mkdir_p +# ------------- +# Create "$as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" + + +} # as_fn_mkdir_p +if mkdir -p . 2>/dev/null; then + as_mkdir_p='mkdir -p "$as_dir"' +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + + +# as_fn_executable_p FILE +# ----------------------- +# Test if FILE is an executable regular file. +as_fn_executable_p () +{ + test -f "$1" && test -x "$1" +} # as_fn_executable_p +as_test_x='test -x' +as_executable_p=as_fn_executable_p + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + +exec 6>&1 +## ----------------------------------- ## +## Main body of $CONFIG_STATUS script. ## +## ----------------------------------- ## +_ASEOF +test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# Save the log message, to keep $0 and so on meaningful, and to +# report actual input values of CONFIG_FILES etc. instead of their +# values after options handling. +ac_log=" +This file was extended by libircclient $as_me 1.3, which was +generated by GNU Autoconf 2.69. Invocation command line was + + CONFIG_FILES = $CONFIG_FILES + CONFIG_HEADERS = $CONFIG_HEADERS + CONFIG_LINKS = $CONFIG_LINKS + CONFIG_COMMANDS = $CONFIG_COMMANDS + $ $0 $@ + +on `(hostname || uname -n) 2>/dev/null | sed 1q` +" + +_ACEOF + +case $ac_config_files in *" +"*) set x $ac_config_files; shift; ac_config_files=$*;; +esac + +case $ac_config_headers in *" +"*) set x $ac_config_headers; shift; ac_config_headers=$*;; +esac + + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +# Files that config.status was made for. +config_files="$ac_config_files" +config_headers="$ac_config_headers" + +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +ac_cs_usage="\ +\`$as_me' instantiates files and other configuration actions +from templates according to the current configuration. Unless the files +and actions are specified as TAGs, all are instantiated by default. + +Usage: $0 [OPTION]... [TAG]... + + -h, --help print this help, then exit + -V, --version print version number and configuration settings, then exit + --config print configuration, then exit + -q, --quiet, --silent + do not print progress messages + -d, --debug don't remove temporary files + --recheck update $as_me by reconfiguring in the same conditions + --file=FILE[:TEMPLATE] + instantiate the configuration file FILE + --header=FILE[:TEMPLATE] + instantiate the configuration header FILE + +Configuration files: +$config_files + +Configuration headers: +$config_headers + +Report bugs to ." + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" +ac_cs_version="\\ +libircclient config.status 1.3 +configured by $0, generated by GNU Autoconf 2.69, + with options \\"\$ac_cs_config\\" + +Copyright (C) 2012 Free Software Foundation, Inc. +This config.status script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it." + +ac_pwd='$ac_pwd' +srcdir='$srcdir' +test -n "\$AWK" || AWK=awk +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# The default lists apply if the user does not specify any file. +ac_need_defaults=: +while test $# != 0 +do + case $1 in + --*=?*) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` + ac_shift=: + ;; + --*=) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg= + ac_shift=: + ;; + *) + ac_option=$1 + ac_optarg=$2 + ac_shift=shift + ;; + esac + + case $ac_option in + # Handling of the options. + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + ac_cs_recheck=: ;; + --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) + $as_echo "$ac_cs_version"; exit ;; + --config | --confi | --conf | --con | --co | --c ) + $as_echo "$ac_cs_config"; exit ;; + --debug | --debu | --deb | --de | --d | -d ) + debug=: ;; + --file | --fil | --fi | --f ) + $ac_shift + case $ac_optarg in + *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + '') as_fn_error $? "missing file argument" ;; + esac + as_fn_append CONFIG_FILES " '$ac_optarg'" + ac_need_defaults=false;; + --header | --heade | --head | --hea ) + $ac_shift + case $ac_optarg in + *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + as_fn_append CONFIG_HEADERS " '$ac_optarg'" + ac_need_defaults=false;; + --he | --h) + # Conflict between --help and --header + as_fn_error $? "ambiguous option: \`$1' +Try \`$0 --help' for more information.";; + --help | --hel | -h ) + $as_echo "$ac_cs_usage"; exit ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil | --si | --s) + ac_cs_silent=: ;; + + # This is an error. + -*) as_fn_error $? "unrecognized option: \`$1' +Try \`$0 --help' for more information." ;; + + *) as_fn_append ac_config_targets " $1" + ac_need_defaults=false ;; + + esac + shift +done + +ac_configure_extra_args= + +if $ac_cs_silent; then + exec 6>/dev/null + ac_configure_extra_args="$ac_configure_extra_args --silent" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +if \$ac_cs_recheck; then + set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion + shift + \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 + CONFIG_SHELL='$SHELL' + export CONFIG_SHELL + exec "\$@" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +exec 5>>config.log +{ + echo + sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX +## Running $as_me. ## +_ASBOX + $as_echo "$ac_log" +} >&5 + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 + +# Handling of arguments. +for ac_config_target in $ac_config_targets +do + case $ac_config_target in + "src/config.h") CONFIG_HEADERS="$CONFIG_HEADERS src/config.h" ;; + "examples/Makefile") CONFIG_FILES="$CONFIG_FILES examples/Makefile" ;; + "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; + + *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; + esac +done + + +# If the user did not use the arguments to specify the items to instantiate, +# then the envvar interface is used. Set only those that are not. +# We use the long form for the default assignment because of an extremely +# bizarre bug on SunOS 4.1.3. +if $ac_need_defaults; then + test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files + test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers +fi + +# Have a temporary directory for convenience. Make it in the build tree +# simply because there is no reason against having it here, and in addition, +# creating and moving files from /tmp can sometimes cause problems. +# Hook for its removal unless debugging. +# Note that there is a small window in which the directory will not be cleaned: +# after its creation but before its name has been assigned to `$tmp'. +$debug || +{ + tmp= ac_tmp= + trap 'exit_status=$? + : "${ac_tmp:=$tmp}" + { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status +' 0 + trap 'as_fn_exit 1' 1 2 13 15 +} +# Create a (secure) tmp directory for tmp files. + +{ + tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && + test -d "$tmp" +} || +{ + tmp=./conf$$-$RANDOM + (umask 077 && mkdir "$tmp") +} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 +ac_tmp=$tmp + +# Set up the scripts for CONFIG_FILES section. +# No need to generate them if there are no CONFIG_FILES. +# This happens for instance with `./config.status config.h'. +if test -n "$CONFIG_FILES"; then + + +ac_cr=`echo X | tr X '\015'` +# On cygwin, bash can eat \r inside `` if the user requested igncr. +# But we know of no other shell where ac_cr would be empty at this +# point, so we can use a bashism as a fallback. +if test "x$ac_cr" = x; then + eval ac_cr=\$\'\\r\' +fi +ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` +if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then + ac_cs_awk_cr='\\r' +else + ac_cs_awk_cr=$ac_cr +fi + +echo 'BEGIN {' >"$ac_tmp/subs1.awk" && +_ACEOF + + +{ + echo "cat >conf$$subs.awk <<_ACEOF" && + echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && + echo "_ACEOF" +} >conf$$subs.sh || + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 +ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` +ac_delim='%!_!# ' +for ac_last_try in false false false false false :; do + . ./conf$$subs.sh || + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 + + ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` + if test $ac_delim_n = $ac_delim_num; then + break + elif $ac_last_try; then + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done +rm -f conf$$subs.sh + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && +_ACEOF +sed -n ' +h +s/^/S["/; s/!.*/"]=/ +p +g +s/^[^!]*!// +:repl +t repl +s/'"$ac_delim"'$// +t delim +:nl +h +s/\(.\{148\}\)..*/\1/ +t more1 +s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ +p +n +b repl +:more1 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t nl +:delim +h +s/\(.\{148\}\)..*/\1/ +t more2 +s/["\\]/\\&/g; s/^/"/; s/$/"/ +p +b +:more2 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t delim +' >$CONFIG_STATUS || ac_write_fail=1 +rm -f conf$$subs.awk +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +_ACAWK +cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && + for (key in S) S_is_set[key] = 1 + FS = "" + +} +{ + line = $ 0 + nfields = split(line, field, "@") + substed = 0 + len = length(field[1]) + for (i = 2; i < nfields; i++) { + key = field[i] + keylen = length(key) + if (S_is_set[key]) { + value = S[key] + line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) + len += length(value) + length(field[++i]) + substed = 1 + } else + len += 1 + keylen + } + + print line +} + +_ACAWK +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then + sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" +else + cat +fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ + || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 +_ACEOF + +# VPATH may cause trouble with some makes, so we remove sole $(srcdir), +# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and +# trailing colons and then remove the whole line if VPATH becomes empty +# (actually we leave an empty line to preserve line numbers). +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ +h +s/// +s/^/:/ +s/[ ]*$/:/ +s/:\$(srcdir):/:/g +s/:\${srcdir}:/:/g +s/:@srcdir@:/:/g +s/^:*// +s/:*$// +x +s/\(=[ ]*\).*/\1/ +G +s/\n// +s/^[^=]*=[ ]*$// +}' +fi + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +fi # test -n "$CONFIG_FILES" + +# Set up the scripts for CONFIG_HEADERS section. +# No need to generate them if there are no CONFIG_HEADERS. +# This happens for instance with `./config.status Makefile'. +if test -n "$CONFIG_HEADERS"; then +cat >"$ac_tmp/defines.awk" <<\_ACAWK || +BEGIN { +_ACEOF + +# Transform confdefs.h into an awk script `defines.awk', embedded as +# here-document in config.status, that substitutes the proper values into +# config.h.in to produce config.h. + +# Create a delimiter string that does not exist in confdefs.h, to ease +# handling of long lines. +ac_delim='%!_!# ' +for ac_last_try in false false :; do + ac_tt=`sed -n "/$ac_delim/p" confdefs.h` + if test -z "$ac_tt"; then + break + elif $ac_last_try; then + as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done + +# For the awk script, D is an array of macro values keyed by name, +# likewise P contains macro parameters if any. Preserve backslash +# newline sequences. + +ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* +sed -n ' +s/.\{148\}/&'"$ac_delim"'/g +t rset +:rset +s/^[ ]*#[ ]*define[ ][ ]*/ / +t def +d +:def +s/\\$// +t bsnl +s/["\\]/\\&/g +s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ +D["\1"]=" \3"/p +s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p +d +:bsnl +s/["\\]/\\&/g +s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ +D["\1"]=" \3\\\\\\n"\\/p +t cont +s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p +t cont +d +:cont +n +s/.\{148\}/&'"$ac_delim"'/g +t clear +:clear +s/\\$// +t bsnlc +s/["\\]/\\&/g; s/^/"/; s/$/"/p +d +:bsnlc +s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p +b cont +' >$CONFIG_STATUS || ac_write_fail=1 + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 + for (key in D) D_is_set[key] = 1 + FS = "" +} +/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { + line = \$ 0 + split(line, arg, " ") + if (arg[1] == "#") { + defundef = arg[2] + mac1 = arg[3] + } else { + defundef = substr(arg[1], 2) + mac1 = arg[2] + } + split(mac1, mac2, "(") #) + macro = mac2[1] + prefix = substr(line, 1, index(line, defundef) - 1) + if (D_is_set[macro]) { + # Preserve the white space surrounding the "#". + print prefix "define", macro P[macro] D[macro] + next + } else { + # Replace #undef with comments. This is necessary, for example, + # in the case of _POSIX_SOURCE, which is predefined and required + # on some systems where configure will not decide to define it. + if (defundef == "undef") { + print "/*", prefix defundef, macro, "*/" + next + } + } +} +{ print } +_ACAWK +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 + as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 +fi # test -n "$CONFIG_HEADERS" + + +eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS " +shift +for ac_tag +do + case $ac_tag in + :[FHLC]) ac_mode=$ac_tag; continue;; + esac + case $ac_mode$ac_tag in + :[FHL]*:*);; + :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; + :[FH]-) ac_tag=-:-;; + :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; + esac + ac_save_IFS=$IFS + IFS=: + set x $ac_tag + IFS=$ac_save_IFS + shift + ac_file=$1 + shift + + case $ac_mode in + :L) ac_source=$1;; + :[FH]) + ac_file_inputs= + for ac_f + do + case $ac_f in + -) ac_f="$ac_tmp/stdin";; + *) # Look for the file first in the build tree, then in the source tree + # (if the path is not absolute). The absolute path cannot be DOS-style, + # because $ac_f cannot contain `:'. + test -f "$ac_f" || + case $ac_f in + [\\/$]*) false;; + *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; + esac || + as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; + esac + case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac + as_fn_append ac_file_inputs " '$ac_f'" + done + + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated by config.status. */ + configure_input='Generated from '` + $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' + `' by configure.' + if test x"$ac_file" != x-; then + configure_input="$ac_file. $configure_input" + { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 +$as_echo "$as_me: creating $ac_file" >&6;} + fi + # Neutralize special characters interpreted by sed in replacement strings. + case $configure_input in #( + *\&* | *\|* | *\\* ) + ac_sed_conf_input=`$as_echo "$configure_input" | + sed 's/[\\\\&|]/\\\\&/g'`;; #( + *) ac_sed_conf_input=$configure_input;; + esac + + case $ac_tag in + *:-:* | *:-) cat >"$ac_tmp/stdin" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; + esac + ;; + esac + + ac_dir=`$as_dirname -- "$ac_file" || +$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + as_dir="$ac_dir"; as_fn_mkdir_p + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + + case $ac_mode in + :F) + # + # CONFIG_FILE + # + +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# If the template does not know about datarootdir, expand it. +# FIXME: This hack should be removed a few years after 2.60. +ac_datarootdir_hack=; ac_datarootdir_seen= +ac_sed_dataroot=' +/datarootdir/ { + p + q +} +/@datadir@/p +/@docdir@/p +/@infodir@/p +/@localedir@/p +/@mandir@/p' +case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in +*datarootdir*) ac_datarootdir_seen=yes;; +*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 +$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 + ac_datarootdir_hack=' + s&@datadir@&$datadir&g + s&@docdir@&$docdir&g + s&@infodir@&$infodir&g + s&@localedir@&$localedir&g + s&@mandir@&$mandir&g + s&\\\${datarootdir}&$datarootdir&g' ;; +esac +_ACEOF + +# Neutralize VPATH when `$srcdir' = `.'. +# Shell code in configure.ac might set extrasub. +# FIXME: do we really want to maintain this feature? +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_sed_extra="$ac_vpsub +$extrasub +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +:t +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b +s|@configure_input@|$ac_sed_conf_input|;t t +s&@top_builddir@&$ac_top_builddir_sub&;t t +s&@top_build_prefix@&$ac_top_build_prefix&;t t +s&@srcdir@&$ac_srcdir&;t t +s&@abs_srcdir@&$ac_abs_srcdir&;t t +s&@top_srcdir@&$ac_top_srcdir&;t t +s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t +s&@builddir@&$ac_builddir&;t t +s&@abs_builddir@&$ac_abs_builddir&;t t +s&@abs_top_builddir@&$ac_abs_top_builddir&;t t +$ac_datarootdir_hack +" +eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ + >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + +test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && + { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && + { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ + "$ac_tmp/out"`; test -z "$ac_out"; } && + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined" >&5 +$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined" >&2;} + + rm -f "$ac_tmp/stdin" + case $ac_file in + -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; + *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; + esac \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + ;; + :H) + # + # CONFIG_HEADER + # + if test x"$ac_file" != x-; then + { + $as_echo "/* $configure_input */" \ + && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" + } >"$ac_tmp/config.h" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then + { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 +$as_echo "$as_me: $ac_file is unchanged" >&6;} + else + rm -f "$ac_file" + mv "$ac_tmp/config.h" "$ac_file" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + fi + else + $as_echo "/* $configure_input */" \ + && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ + || as_fn_error $? "could not create -" "$LINENO" 5 + fi + ;; + + + esac + +done # for ac_tag + + +as_fn_exit 0 +_ACEOF +ac_clean_files=$ac_clean_files_save + +test $ac_write_fail = 0 || + as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 + + +# configure is writing to config.log, and then calls config.status. +# config.status does its own redirection, appending to config.log. +# Unfortunately, on DOS this fails, as config.log is still kept open +# by configure, so config.status won't be able to write to it; its +# output is simply discarded. So we exec the FD to /dev/null, +# effectively closing config.log, so it can be properly (re)opened and +# appended to by config.status. When coming back to configure, we +# need to make the FD available again. +if test "$no_create" != yes; then + ac_cs_success=: + ac_config_status_args= + test "$silent" = yes && + ac_config_status_args="$ac_config_status_args --quiet" + exec 5>/dev/null + $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false + exec 5>>config.log + # Use ||, not &&, to avoid exiting from the if with $? = 1, which + # would make configure fail if this is the last instruction. + $ac_cs_success || as_fn_exit 1 +fi +if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 +$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} +fi + diff --git a/libircclient/configure.in b/libircclient/configure.in new file mode 100644 index 0000000..6d10ece --- /dev/null +++ b/libircclient/configure.in @@ -0,0 +1,115 @@ +# -*- Autoconf -*- +# Process this file with autoconf to produce a configure script. + +AC_PREREQ(2.52) +AC_INIT(libircclient, 1.3, gyunaev@ulduzsoft.com) +AC_CONFIG_SRCDIR([include/libircclient.h]) +AC_CONFIG_HEADER([src/config.h]) + +# Check for command-line +AC_ARG_ENABLE([debug], + [AS_HELP_STRING([--enable-debug], + [compile with debug information (no)])], + [use_debug=$enableval], + [use_debug=no]) + +AC_ARG_ENABLE([shared], + [AS_HELP_STRING([--enable-shared], + [build a shared library (no)])], + [build_shared=$enableval], + [build_shared=no]) + +AC_ARG_ENABLE([threads], + [AS_HELP_STRING([--enable-threads], + [compile with multithread support (yes)])], + [use_threads=$enableval], + [use_threads=yes]) + +AC_ARG_ENABLE([ipv6], + [AS_HELP_STRING([--enable-ipv6], + [compile with IPv6 support (no)])], + [use_ipv6=$enableval], + [use_ipv6=no]) + +AC_ARG_ENABLE([openssl], + [AS_HELP_STRING([--enable-openssl], + [compile with OpenSSL support (no)])], + [use_openssl=$enableval], + [use_openssl=no]) + +# Checks for programs. +AC_PROG_CXX +AC_PROG_CC +AC_CHECK_TOOL(AR, ar, :) +AC_PROG_RANLIB + +# Checks for header files. +AC_HEADER_STDC + +# Checks for typedefs, structures, and compiler characteristics. +AC_HEADER_STDBOOL +AC_C_CONST +AC_TYPE_SIZE_T +AC_HEADER_TIME + +# Checks for library functions. +AC_FUNC_MALLOC +AC_FUNC_SELECT_ARGTYPES +AC_FUNC_STAT +AC_CHECK_FUNCS([localtime_r socket]) + +AC_CHECK_LIB(socket, socket, AC_DEFINE(HAVE_SOCKET) LIBS="$LIBS -lsocket") + +if test "$use_debug" = "yes"; then + CFLAGS="${CFLAGS} -g -DENABLE_DEBUG" +else + CFLAGS="${CFLAGS} -O3" +fi + +# Choosing the target +TARGET="static" +if test "$build_shared" = "yes"; then + CFLAGS="$CFLAGS -fpic" + TARGET="shared" +fi + +if test "$use_ipv6" = "yes"; then + AC_CHECK_FUNCS([getaddrinfo inet_pton]) + AC_CHECK_LIB(nsl, getaddrinfo, AC_DEFINE(HAVE_GETADDRINFO) LIBS="$LIBS -lnsl") + CFLAGS="$CFLAGS -DENABLE_IPV6" +else + AC_CHECK_FUNCS([gethostbyname_r inet_ntoa]) + AC_CHECK_LIB(nsl, inet_ntoa, AC_DEFINE(HAVE_INET_NTOA) LIBS="$LIBS -lnsl") +fi + +if test "$use_threads" = "yes"; then + CFLAGS="$CFLAGS -DENABLE_THREADS -D_REENTRANT" +fi + + +# Checking for mingw +AC_MSG_CHECKING([For MinGW32]) +case "$host" in + *-*-mingw*) + AC_MSG_RESULT([yes]) + CFLAGS="$CFLAGS -DWIN32_DLL" + LIBS="$LIBS -lz -lwsock32 -lgdi32 -lkernel32" # for openssl + TARGET="shared_mingw" + ;; + *) AC_MSG_RESULT([no]) ;; +esac + +if test "$use_openssl" = "yes"; then + AC_CHECK_LIB(crypto, [CRYPTO_free], [], [AC_MSG_ERROR([OpenSSL not found (libcrypto)])]) + AC_CHECK_LIB(ssl, [SSL_CTX_new], [], [AC_MSG_ERROR([OpenSSL not found (libssl)])]) + AC_CHECK_HEADER([openssl/ssl.h], [], [AC_MSG_ERROR([OpenSSL headers not found; did you install the -dev package?])]) + CFLAGS="$CFLAGS -DENABLE_SSL" +fi + +AC_SUBST(TARGET) +AC_SUBST(CFLAGS) +AC_SUBST(LDFLAGS) +AC_SUBST(LIBS) +AC_SUBST(PREFIX) +AC_CONFIG_FILES([examples/Makefile src/Makefile]) +AC_OUTPUT diff --git a/libircclient/doc/Makefile b/libircclient/doc/Makefile new file mode 100644 index 0000000..db8d866 --- /dev/null +++ b/libircclient/doc/Makefile @@ -0,0 +1,156 @@ +# Makefile for Sphinx documentation +# + +# You can set these variables from the command line. +SPHINXOPTS = +SPHINXBUILD = sphinx-build +PAPER = +BUILDDIR = _build + +# Internal variables. +PAPEROPT_a4 = -D latex_paper_size=a4 +PAPEROPT_letter = -D latex_paper_size=letter +ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . +# the i18n builder cannot share the environment and doctrees with the others +I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . + +.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext + +help: + @echo "Please use \`make ' where is one of" + @echo " html to make standalone HTML files" + @echo " dirhtml to make HTML files named index.html in directories" + @echo " singlehtml to make a single large HTML file" + @echo " pickle to make pickle files" + @echo " json to make JSON files" + @echo " htmlhelp to make HTML files and a HTML help project" + @echo " qthelp to make HTML files and a qthelp project" + @echo " devhelp to make HTML files and a Devhelp project" + @echo " epub to make an epub" + @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter" + @echo " pdf to make PDF" + @echo " text to make text files" + @echo " man to make manual pages" + @echo " texinfo to make Texinfo files" + @echo " info to make Texinfo files and run them through makeinfo" + @echo " gettext to make PO message catalogs" + @echo " changes to make an overview of all changed/added/deprecated items" + @echo " linkcheck to check all external links for integrity" + @echo " doctest to run all doctests embedded in the documentation (if enabled)" + +clean: + -rm -rf $(BUILDDIR)/* + +html: + $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html + @echo + @echo "Build finished. The HTML pages are in $(BUILDDIR)/html." + +dirhtml: + $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml + @echo + @echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml." + +singlehtml: + $(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml + @echo + @echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml." + +pickle: + $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle + @echo + @echo "Build finished; now you can process the pickle files." + +json: + $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json + @echo + @echo "Build finished; now you can process the JSON files." + +htmlhelp: + $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp + @echo + @echo "Build finished; now you can run HTML Help Workshop with the" \ + ".hhp project file in $(BUILDDIR)/htmlhelp." + +qthelp: + $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp + @echo + @echo "Build finished; now you can run "qcollectiongenerator" with the" \ + ".qhcp project file in $(BUILDDIR)/qthelp, like this:" + @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/Libircclient.qhcp" + @echo "To view the help file:" + @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/Libircclient.qhc" + +devhelp: + $(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp + @echo + @echo "Build finished." + @echo "To view the help file:" + @echo "# mkdir -p $$HOME/.local/share/devhelp/Libircclient" + @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/Libircclient" + @echo "# devhelp" + +epub: + $(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub + @echo + @echo "Build finished. The epub file is in $(BUILDDIR)/epub." + +latex: + $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex + @echo + @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex." + @echo "Run \`make' in that directory to run these through (pdf)latex" \ + "(use \`make latexpdf' here to do that automatically)." + +latexpdf: + $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex + @echo "Running LaTeX files through pdflatex..." + $(MAKE) -C $(BUILDDIR)/latex all-pdf + @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex." + +text: + $(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text + @echo + @echo "Build finished. The text files are in $(BUILDDIR)/text." + +man: + $(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man + @echo + @echo "Build finished. The manual pages are in $(BUILDDIR)/man." + +texinfo: + $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo + @echo + @echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo." + @echo "Run \`make' in that directory to run these through makeinfo" \ + "(use \`make info' here to do that automatically)." + +pdf: + $(SPHINXBUILD) -b rinoh . _build/rinoh + +info: + $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo + @echo "Running Texinfo files through makeinfo..." + make -C $(BUILDDIR)/texinfo info + @echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo." + +gettext: + $(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale + @echo + @echo "Build finished. The message catalogs are in $(BUILDDIR)/locale." + +changes: + $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes + @echo + @echo "The overview file is in $(BUILDDIR)/changes." + +linkcheck: + $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck + @echo + @echo "Link check complete; look for any errors in the above output " \ + "or in $(BUILDDIR)/linkcheck/output.txt." + +doctest: + $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest + @echo "Testing of doctests in the sources finished, look at the " \ + "results in $(BUILDDIR)/doctest/output.txt." diff --git a/libircclient/doc/conf.py b/libircclient/doc/conf.py new file mode 100644 index 0000000..d525433 --- /dev/null +++ b/libircclient/doc/conf.py @@ -0,0 +1,296 @@ +# -*- coding: utf-8 -*- +# +# Libircclient documentation build configuration file, created by +# sphinx-quickstart on Sat Jun 15 22:37:32 2013. +# +# This file is execfile()d with the current directory set to its containing dir. +# +# Note that not all possible configuration values are present in this +# autogenerated file. +# +# All configuration values have a default; values that are commented out +# serve to show the default. + +import sys, os + +# If extensions (or modules to document with autodoc) are in another directory, +# add these directories to sys.path here. If the directory is relative to the +# documentation root, use os.path.abspath to make it absolute, like shown here. +#sys.path.insert(0, os.path.abspath('.')) + +# -- General configuration ----------------------------------------------------- + +# If your documentation needs a minimal Sphinx version, state it here. +#needs_sphinx = '1.0' + +# Add any Sphinx extension module names here, as strings. They can be extensions +# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.rinoh.frontend.sphinx +extensions = ['sphinx.ext.doctest'] + +# Add any paths that contain templates here, relative to this directory. +templates_path = ['_templates'] + +# The suffix of source filenames. +source_suffix = '.rst' + +# The encoding of source files. +#source_encoding = 'utf-8-sig' + +# The master toctree document. +master_doc = 'index' + +# General information about the project. +project = u'Libircclient' +copyright = u'2005-2016 George Yunaev, http://www.ulduzsoft.com/linux/libircclient/' + +# The version info for the project you're documenting, acts as replacement for +# |version| and |release|, also used in various other places throughout the +# built documents. +# +# The short X.Y version. +version = '1.9' +# The full version, including alpha/beta/rc tags. +release = '1.9' + +# The language for content autogenerated by Sphinx. Refer to documentation +# for a list of supported languages. +#language = None + +# There are two options for replacing |today|: either, you set today to some +# non-false value, then it is used: +#today = '' +# Else, today_fmt is used as the format for a strftime call. +#today_fmt = '%B %d, %Y' + +# List of patterns, relative to source directory, that match files and +# directories to ignore when looking for source files. +exclude_patterns = ['_build'] + +# The reST default role (used for this markup: `text`) to use for all documents. +#default_role = None + +# If true, '()' will be appended to :func: etc. cross-reference text. +#add_function_parentheses = True + +# If true, the current module name will be prepended to all description +# unit titles (such as .. function::). +#add_module_names = True + +# If true, sectionauthor and moduleauthor directives will be shown in the +# output. They are ignored by default. +#show_authors = False + +# The name of the Pygments (syntax highlighting) style to use. +pygments_style = 'sphinx' + +# A list of ignored prefixes for module index sorting. +#modindex_common_prefix = [] + + +# -- Options for HTML output --------------------------------------------------- + +# The theme to use for HTML and HTML Help pages. See the documentation for +# a list of builtin themes. +html_theme = 'default' + +# Theme options are theme-specific and customize the look and feel of a theme +# further. For a list of options available for each theme, see the +# documentation. +#html_theme_options = {} + +# Add any paths that contain custom themes here, relative to this directory. +#html_theme_path = [] + +# The name for this set of Sphinx documents. If None, it defaults to +# " v documentation". +#html_title = None + +# A shorter title for the navigation bar. Default is the same as html_title. +#html_short_title = None + +# The name of an image file (relative to this directory) to place at the top +# of the sidebar. +#html_logo = None + +# The name of an image file (within the static path) to use as favicon of the +# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 +# pixels large. +#html_favicon = None + +# Add any paths that contain custom static files (such as style sheets) here, +# relative to this directory. They are copied after the builtin static files, +# so a file named "default.css" will overwrite the builtin "default.css". +html_static_path = ['_static'] + +# If not '', a 'Last updated on:' timestamp is inserted at every page bottom, +# using the given strftime format. +#html_last_updated_fmt = '%b %d, %Y' + +# If true, SmartyPants will be used to convert quotes and dashes to +# typographically correct entities. +#html_use_smartypants = True + +# Custom sidebar templates, maps document names to template names. +#html_sidebars = {} + +# Additional templates that should be rendered to pages, maps page names to +# template names. +#html_additional_pages = {} + +# If false, no module index is generated. +#html_domain_indices = True + +# If false, no index is generated. +#html_use_index = True + +# If true, the index is split into individual pages for each letter. +#html_split_index = False + +# If true, links to the reST sources are added to the pages. +#html_show_sourcelink = True + +# If true, "Created using Sphinx" is shown in the HTML footer. Default is True. +#html_show_sphinx = True + +# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True. +#html_show_copyright = True + +# If true, an OpenSearch description file will be output, and all pages will +# contain a tag referring to it. The value of this option must be the +# base URL from which the finished HTML is served. +#html_use_opensearch = '' + +# This is the file name suffix for HTML files (e.g. ".xhtml"). +#html_file_suffix = None + +# Output file base name for HTML help builder. +htmlhelp_basename = 'Libircclientdoc' + + +# -- Options for LaTeX output -------------------------------------------------- + +#latex_elements = { +# The paper size ('letterpaper' or 'a4paper'). +#'papersize': 'letterpaper', + +# The font size ('10pt', '11pt' or '12pt'). +#'pointsize': '10pt', + +# Additional stuff for the LaTeX preamble. +#'preamble': '\setcounter{tocdepth}{4}', +#} + +# Grouping the document tree into LaTeX files. List of tuples +# (source start file, target name, title, author, documentclass [howto/manual]). +#latex_documents = [ +# ('index', 'Libircclient.tex', u'Libircclient Documentation', +# u'George Yunaev', 'manual'), +#] + +# The name of an image file (relative to this directory) to place at the top of +# the title page. +#latex_logo = None + +# For "manual" documents, if this is true, then toplevel headings are parts, +# not chapters. +#latex_use_parts = False + +# If true, show page references after internal links. +#latex_show_pagerefs = False + +# If true, show URL addresses after external links. +#latex_show_urls = False + +# Documents to append as an appendix to all manuals. +#latex_appendices = [] + +# If false, no module index is generated. +#latex_domain_indices = True + + +# -- Options for manual page output -------------------------------------------- + +# One entry per manual page. List of tuples +# (source start file, name, description, authors, manual section). +man_pages = [ + ('index', 'libircclient', u'Libircclient Documentation', + [u'George Yunaev'], 1) +] + +# If true, show URL addresses after external links. +#man_show_urls = False + + +# -- Options for Texinfo output ------------------------------------------------ + +# Grouping the document tree into Texinfo files. List of tuples +# (source start file, target name, title, author, +# dir menu entry, description, category) +texinfo_documents = [ + ('index', 'Libircclient', u'Libircclient Documentation', + u'George Yunaev', 'Libircclient', 'One line description of project.', + 'Miscellaneous'), +] + +# Documents to append as an appendix to all manuals. +#texinfo_appendices = [] + +# If false, no module index is generated. +#texinfo_domain_indices = True + +# How to display URL addresses: 'footnote', 'no', or 'inline'. +#texinfo_show_urls = 'footnote' + + +# -- Options for Epub output --------------------------------------------------- + +# Bibliographic Dublin Core info. +epub_title = u'Libircclient' +epub_author = u'George Yunaev' +epub_publisher = u'George Yunaev' +epub_copyright = u'2013, George Yunaev' + +# The language of the text. It defaults to the language option +# or en if the language is not set. +#epub_language = '' + +# The scheme of the identifier. Typical schemes are ISBN or URL. +#epub_scheme = '' + +# The unique identifier of the text. This can be a ISBN number +# or the project homepage. +#epub_identifier = '' + +# A unique identification for the text. +#epub_uid = '' + +# A tuple containing the cover image and cover page html template filenames. +#epub_cover = () + +# HTML files that should be inserted before the pages created by sphinx. +# The format is a list of tuples containing the path and title. +#epub_pre_files = [] + +# HTML files shat should be inserted after the pages created by sphinx. +# The format is a list of tuples containing the path and title. +#epub_post_files = [] + +# A list of files that should not be packed into the epub file. +#epub_exclude_files = [] + +# The depth of the table of contents in toc.ncx. +#epub_tocdepth = 3 + +# Allow duplicate toc entries. +#epub_tocdup = True + + +# -- Options for Rhinotype output --------------------------------------------------- + +rinoh_documents = [('index', # top-level file (index.rst) + 'libircclient', # output (target.pdf) + 'Libircclient Documentation', # document title + 'George Yunaev')] # document author + +rinoh_paper_size = 'letterpaper' + diff --git a/libircclient/doc/index.rst b/libircclient/doc/index.rst new file mode 100644 index 0000000..a14b8b3 --- /dev/null +++ b/libircclient/doc/index.rst @@ -0,0 +1,52 @@ +.. Libircclient documentation master file, created by + sphinx-quickstart on Sat Jun 15 22:37:32 2013. + You can adapt this file completely to your liking, but it should at least + contain the root `toctree` directive. + +Libircclient technical documentation +"""""""""""""""""""""""""""""""""""" + +===================== + Introduction +===================== + +.. toctree:: + + sources/Introduction + + +===================== + Integration +===================== + +.. toctree:: + + sources/Writing_code + +===================== + API Reference +===================== + +.. toctree:: + + sources/API_reference_callbacks + sources/API_reference_functions + sources/API_reference_types + sources/API_reference_constants + +===================== + Appendix +===================== + +.. toctree:: + + sources/Appendix_FAQ + sources/Appendix_LGPL + +Indices and tables +================== + +* :ref:`genindex` +* :ref:`modindex` +* :ref:`search` + diff --git a/libircclient/doc/make.bat b/libircclient/doc/make.bat new file mode 100644 index 0000000..70f8b58 --- /dev/null +++ b/libircclient/doc/make.bat @@ -0,0 +1,190 @@ +@ECHO OFF + +REM Command file for Sphinx documentation + +if "%SPHINXBUILD%" == "" ( + set SPHINXBUILD=sphinx-build +) +set BUILDDIR=_build +set ALLSPHINXOPTS=-d %BUILDDIR%/doctrees %SPHINXOPTS% . +set I18NSPHINXOPTS=%SPHINXOPTS% . +if NOT "%PAPER%" == "" ( + set ALLSPHINXOPTS=-D latex_paper_size=%PAPER% %ALLSPHINXOPTS% + set I18NSPHINXOPTS=-D latex_paper_size=%PAPER% %I18NSPHINXOPTS% +) + +if "%1" == "" goto help + +if "%1" == "help" ( + :help + echo.Please use `make ^` where ^ is one of + echo. html to make standalone HTML files + echo. dirhtml to make HTML files named index.html in directories + echo. singlehtml to make a single large HTML file + echo. pickle to make pickle files + echo. json to make JSON files + echo. htmlhelp to make HTML files and a HTML help project + echo. qthelp to make HTML files and a qthelp project + echo. devhelp to make HTML files and a Devhelp project + echo. epub to make an epub + echo. latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter + echo. text to make text files + echo. man to make manual pages + echo. texinfo to make Texinfo files + echo. gettext to make PO message catalogs + echo. changes to make an overview over all changed/added/deprecated items + echo. linkcheck to check all external links for integrity + echo. doctest to run all doctests embedded in the documentation if enabled + goto end +) + +if "%1" == "clean" ( + for /d %%i in (%BUILDDIR%\*) do rmdir /q /s %%i + del /q /s %BUILDDIR%\* + goto end +) + +if "%1" == "html" ( + %SPHINXBUILD% -b html %ALLSPHINXOPTS% %BUILDDIR%/html + if errorlevel 1 exit /b 1 + echo. + echo.Build finished. The HTML pages are in %BUILDDIR%/html. + goto end +) + +if "%1" == "dirhtml" ( + %SPHINXBUILD% -b dirhtml %ALLSPHINXOPTS% %BUILDDIR%/dirhtml + if errorlevel 1 exit /b 1 + echo. + echo.Build finished. The HTML pages are in %BUILDDIR%/dirhtml. + goto end +) + +if "%1" == "singlehtml" ( + %SPHINXBUILD% -b singlehtml %ALLSPHINXOPTS% %BUILDDIR%/singlehtml + if errorlevel 1 exit /b 1 + echo. + echo.Build finished. The HTML pages are in %BUILDDIR%/singlehtml. + goto end +) + +if "%1" == "pickle" ( + %SPHINXBUILD% -b pickle %ALLSPHINXOPTS% %BUILDDIR%/pickle + if errorlevel 1 exit /b 1 + echo. + echo.Build finished; now you can process the pickle files. + goto end +) + +if "%1" == "json" ( + %SPHINXBUILD% -b json %ALLSPHINXOPTS% %BUILDDIR%/json + if errorlevel 1 exit /b 1 + echo. + echo.Build finished; now you can process the JSON files. + goto end +) + +if "%1" == "htmlhelp" ( + %SPHINXBUILD% -b htmlhelp %ALLSPHINXOPTS% %BUILDDIR%/htmlhelp + if errorlevel 1 exit /b 1 + echo. + echo.Build finished; now you can run HTML Help Workshop with the ^ +.hhp project file in %BUILDDIR%/htmlhelp. + goto end +) + +if "%1" == "qthelp" ( + %SPHINXBUILD% -b qthelp %ALLSPHINXOPTS% %BUILDDIR%/qthelp + if errorlevel 1 exit /b 1 + echo. + echo.Build finished; now you can run "qcollectiongenerator" with the ^ +.qhcp project file in %BUILDDIR%/qthelp, like this: + echo.^> qcollectiongenerator %BUILDDIR%\qthelp\Libircclient.qhcp + echo.To view the help file: + echo.^> assistant -collectionFile %BUILDDIR%\qthelp\Libircclient.ghc + goto end +) + +if "%1" == "devhelp" ( + %SPHINXBUILD% -b devhelp %ALLSPHINXOPTS% %BUILDDIR%/devhelp + if errorlevel 1 exit /b 1 + echo. + echo.Build finished. + goto end +) + +if "%1" == "epub" ( + %SPHINXBUILD% -b epub %ALLSPHINXOPTS% %BUILDDIR%/epub + if errorlevel 1 exit /b 1 + echo. + echo.Build finished. The epub file is in %BUILDDIR%/epub. + goto end +) + +if "%1" == "latex" ( + %SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex + if errorlevel 1 exit /b 1 + echo. + echo.Build finished; the LaTeX files are in %BUILDDIR%/latex. + goto end +) + +if "%1" == "text" ( + %SPHINXBUILD% -b text %ALLSPHINXOPTS% %BUILDDIR%/text + if errorlevel 1 exit /b 1 + echo. + echo.Build finished. The text files are in %BUILDDIR%/text. + goto end +) + +if "%1" == "man" ( + %SPHINXBUILD% -b man %ALLSPHINXOPTS% %BUILDDIR%/man + if errorlevel 1 exit /b 1 + echo. + echo.Build finished. The manual pages are in %BUILDDIR%/man. + goto end +) + +if "%1" == "texinfo" ( + %SPHINXBUILD% -b texinfo %ALLSPHINXOPTS% %BUILDDIR%/texinfo + if errorlevel 1 exit /b 1 + echo. + echo.Build finished. The Texinfo files are in %BUILDDIR%/texinfo. + goto end +) + +if "%1" == "gettext" ( + %SPHINXBUILD% -b gettext %I18NSPHINXOPTS% %BUILDDIR%/locale + if errorlevel 1 exit /b 1 + echo. + echo.Build finished. The message catalogs are in %BUILDDIR%/locale. + goto end +) + +if "%1" == "changes" ( + %SPHINXBUILD% -b changes %ALLSPHINXOPTS% %BUILDDIR%/changes + if errorlevel 1 exit /b 1 + echo. + echo.The overview file is in %BUILDDIR%/changes. + goto end +) + +if "%1" == "linkcheck" ( + %SPHINXBUILD% -b linkcheck %ALLSPHINXOPTS% %BUILDDIR%/linkcheck + if errorlevel 1 exit /b 1 + echo. + echo.Link check complete; look for any errors in the above output ^ +or in %BUILDDIR%/linkcheck/output.txt. + goto end +) + +if "%1" == "doctest" ( + %SPHINXBUILD% -b doctest %ALLSPHINXOPTS% %BUILDDIR%/doctest + if errorlevel 1 exit /b 1 + echo. + echo.Testing of doctests in the sources finished, look at the ^ +results in %BUILDDIR%/doctest/output.txt. + goto end +) + +:end diff --git a/libircclient/doc/sources/API_reference_callbacks.rst b/libircclient/doc/sources/API_reference_callbacks.rst new file mode 100644 index 0000000..3e37e2c --- /dev/null +++ b/libircclient/doc/sources/API_reference_callbacks.rst @@ -0,0 +1,173 @@ + +Callbacks +~~~~~~~~~ + +This section describes the callbacks supported by the library. + +irc_event_callback_t +^^^^^^^^^^^^^^^^^^^^ + +**Prototype:** + +.. c:type:: typedef void (*irc_event_callback_t) (irc_session_t * session, const char * event, const char * origin, const char ** params, unsigned int count) + +**Parameters:** + ++-------------+-------------------------------------------------------------------------------------------------------------------------------------------------+ +| *session* | The IRC session, which generated the event | ++-------------+-------------------------------------------------------------------------------------------------------------------------------------------------+ +| *event* | The text name of the event. Useful in case a single event handler is used to handle multiple events | ++-------------+-------------------------------------------------------------------------------------------------------------------------------------------------+ +| *origin* | The originator of the event. Depends on the event. | ++-------------+-------------------------------------------------------------------------------------------------------------------------------------------------+ +| *params* | Extra parameters, if any, for this event. The number of extra parameters depends on the event, and may be zero. | +| | Each parameter is a NULL-terminated text string. None of the params can be NULL, but the *params* pointer itself could be NULL for some events. | ++-------------+-------------------------------------------------------------------------------------------------------------------------------------------------+ +| *count* | The number of entries in the *params* argument supplied. | ++-------------+-------------------------------------------------------------------------------------------------------------------------------------------------+ + +**Description:** + +Every IRC event generates a callback. This type of callback is universal and is used by almost all IRC events. Depending on the event nature, it can have zero or more parameters. +For each type of event, the number of provided parameters is fixed, and their meaning is described in the :c:type:`irc_callbacks_t` structure. + +Every event has an origin (i.e. who originated the event). In some cases the *origin* variable may be NULL, which indicates that event origin is unknown. The origin usually looks like *nick!host@ircserver*, +i.e. like *tim!home@irc.server.net*. Such origins can not be used in IRC commands, and need to be stripped (i.e. host and server part should be cut off) before using. This can be done either manually, by +calling :c:func:`irc_target_get_nick`, or automatically for all the events - by setting the :c:macro:`LIBIRC_OPTION_STRIPNICKS` option with :c:func:`irc_option_set`. + + + +irc_event_dcc_chat_t +^^^^^^^^^^^^^^^^^^^^ + +**Prototype:** + +.. c:type:: typedef void (*irc_event_dcc_chat_t) (irc_session_t * session, const char * nick, const char * addr, irc_dcc_t dccid) + +**Parameters:** + ++-------------+-------------------------------------------------------------------------------------------------------------------------------------------------+ +| *session* | IRC session, which generates an event (the one returned by irc_create_session) | ++-------------+-------------------------------------------------------------------------------------------------------------------------------------------------+ +| *nick* | User who requested the chat | ++-------------+-------------------------------------------------------------------------------------------------------------------------------------------------+ +| *addr* | IP address of the person such as 189.12.34.56 | ++-------------+-------------------------------------------------------------------------------------------------------------------------------------------------+ +| *dccid* | Identifier associated with this request which should be passed to the :c:func:`irc_dcc_accept` / :c:func:`irc_dcc_decline` functions | ++-------------+-------------------------------------------------------------------------------------------------------------------------------------------------+ + +**Description:** + +This callback is called when someone requests DCC CHAT with you. DCC CHAT is the type of chat which goes directly between the clients, instead of going through the IRC server. Since the TCP connection must be +established for it to happen, typically the initiator must either have the public IP or special software on the firewall which handles the necessary port forwarding. + +You must respond to the chat request either by calling :c:func:`irc_dcc_accept` to accept it, or by calling :c:func:`irc_dcc_decline` to decline it. + + +irc_event_dcc_send_t +^^^^^^^^^^^^^^^^^^^^ + +**Prototype:** + +.. c:type:: typedef void (*irc_event_dcc_send_t) (irc_session_t * session, const char * nick, const char * addr, const char * filename, unsigned long size, irc_dcc_t dccid) + +**Parameters:** + ++-------------+-------------------------------------------------------------------------------------------------------------------------------------------------+ +| *session* | The IRC session, which generates an event (the one returned by irc_create_session) | ++-------------+-------------------------------------------------------------------------------------------------------------------------------------------------+ +| *nick* | The user who requested the chat | ++-------------+-------------------------------------------------------------------------------------------------------------------------------------------------+ +| *addr* | The IP address of the person such as 189.12.34.56 | ++-------------+-------------------------------------------------------------------------------------------------------------------------------------------------+ +| *filename* | The name of the file the user is trying to send you | ++-------------+-------------------------------------------------------------------------------------------------------------------------------------------------+ +| *size* | The size of the file | ++-------------+-------------------------------------------------------------------------------------------------------------------------------------------------+ +| *dccid* | Identifier associated with this request which should be passed to the :c:func:`irc_dcc_accept` / :c:func:`irc_dcc_decline` functions | ++-------------+-------------------------------------------------------------------------------------------------------------------------------------------------+ + +**Description:** + +This callback is called when someone wants to send you a file by using DCC SEND. DCC SEND goes directly between the clients, and requires the TCP connection to be established +established for it to happen. Therefore the initiator must either have the public IP or special software on the firewall which handles the necessary port forwarding. + +You must respond to the chat request either by calling :c:func:`irc_dcc_accept` to accept it, or by calling :c:func:`irc_dcc_decline` to decline it. + + + +irc_dcc_callback_t +^^^^^^^^^^^^^^^^^^ + +**Prototype:** + +.. c:type:: typedef void (*irc_dcc_callback_t) (irc_session_t * session, irc_dcc_t id, int status, void * ctx, const char * data, unsigned int length) + +**Parameters:** + ++-------------+-------------------------------------------------------------------------------------------------------------------------------------------------+ +| *session* | The IRC session, which generates an event (the one returned by irc_create_session) | ++-------------+-------------------------------------------------------------------------------------------------------------------------------------------------+ +| *id* | The DCC session id | ++-------------+-------------------------------------------------------------------------------------------------------------------------------------------------+ +| *status* | The DCC connection status. 0 means there is no error, otherwise contains an error code | ++-------------+-------------------------------------------------------------------------------------------------------------------------------------------------+ +| *ctx* | The user-provided context | ++-------------+-------------------------------------------------------------------------------------------------------------------------------------------------+ +| *data* | Data received (if available), otherwise NULL | ++-------------+-------------------------------------------------------------------------------------------------------------------------------------------------+ +| *length* | Size of the data received if any data | ++-------------+-------------------------------------------------------------------------------------------------------------------------------------------------+ + +**Description:** + +This callback is called for all DCC functions when state change occurs. + +For DCC CHAT, the callback is called as following: + * *status* is :c:macro:`LIBIRC_ERR_CLOSED`: connection is closed by remote peer. After returning from the callback, the DCC session is automatically destroyed + * *status* is nonzero but not :c:macro:`LIBIRC_ERR_CLOSED`: socket I/O error (connect error, accept error, recv error, send error). After returning from the callback, the DCC session is automatically destroyed + * *status* is zero and *length* is zero: the remote side accepted the chat request + * *status* is zero and *length* is nonzero: new chat message received, *data* contains the message (a null-terminated string), *length* contains the string length without null terminator + + +For DCC SEND, while file is being sent, the callback is called as following: + * *status* is nonzero: socket I/O error (connect error, accept error, recv error, send error). After returning from the callback, the DCC session is automatically destroyed + * *status* is zero: another data packet has been sent, *length* contains the total amount of data sent so far, *data* is NULL + +For DCC RECV, while file is being sending, callback called as following: + * *status* is nonzero: socket I/O error (connect error, accept error, recv error, send error). After returning from the callback, the DCC session is automatically destroyed. + * *status* is zero, and *data* is NULL: the file has been received successfully. After returning from the callback, the DCC session is automatically destroyed. + * *status* is zero, and *data* is not NULL: new data received, *data* contains the data received, *length* contains the amount of data received. + + +irc_eventcode_callback_t +^^^^^^^^^^^^^^^^^^^^^^^^ + +**Prototype:** + +.. c:type:: typedef void (*irc_eventcode_callback_t) (irc_session_t * session, unsigned int event, const char * origin, const char ** params, unsigned int count) + +**Parameters:** + ++-------------+-------------------------------------------------------------------------------------------------------------------------------------------------+ +| *session* | The IRC session, which generates an event (the one returned by irc_create_session) | ++-------------+-------------------------------------------------------------------------------------------------------------------------------------------------+ +| *event* | The numeric code of the event. Useful in case a single event handler is used to handle multiple events | ++-------------+-------------------------------------------------------------------------------------------------------------------------------------------------+ +| *origin* | The originator of the event. Depends on the event. | ++-------------+-------------------------------------------------------------------------------------------------------------------------------------------------+ +| *params* | Extra parameters, if any, for this event. The number of extra parameters depends on the event, and may be zero. | +| | Each parameter is a NULL-terminated text string. None of the params can be NULL, but the *params* pointer itself could be NULL for some events. | ++-------------+-------------------------------------------------------------------------------------------------------------------------------------------------+ +| *count* | The number of entries in the *params* argument supplied. | ++-------------+-------------------------------------------------------------------------------------------------------------------------------------------------+ + +**Description:** + +This is an advanced callback for those who want to handle events deeper. Most times the IRC server replies to your actions with numeric events. +Most of those events are error codes, and some are list-start and list-stop markers. Every code has its own set of params; for details you can either experiment, or read RFC 1459 +(don't expect servers to follow it closely though). + +Every event has an origin (i.e. who originated the event). In some cases the *origin* variable may be NULL, which indicates that event origin is unknown. The origin usually looks like *nick!host@ircserver*, +i.e. like *tim!home@irc.server.net*. Such origins can not be used in IRC commands, and need to be stripped (i.e. host and server part should be cut off) before using. This can be done either manually, by +calling :c:func:`irc_target_get_nick`, or automatically for all the events - by setting the :c:macro:`LIBIRC_OPTION_STRIPNICKS` option with :c:func:`irc_option_set`. diff --git a/libircclient/doc/sources/API_reference_constants.rst b/libircclient/doc/sources/API_reference_constants.rst new file mode 100644 index 0000000..ac78256 --- /dev/null +++ b/libircclient/doc/sources/API_reference_constants.rst @@ -0,0 +1,126 @@ + +Constants +~~~~~~~~~ + +This section describes contstants such as options and the error codes. + +Errors +^^^^^^ + +.. c:macro:: LIBIRC_ERR_OK + +(0): No error + + +.. c:macro:: LIBIRC_ERR_INVAL + +(1): An invalid value was given for one of the arguments to a function. For example, supplying the NULL value as a channel argument of :c:func:`irc_cmd_join` produces this error. + + +.. c:macro:: LIBIRC_ERR_RESOLV + +(2): The host name supplied for :c:func:`irc_connect` function could not be resolved into valid IP address. + + +.. c:macro:: LIBIRC_ERR_SOCKET + +(3): The new socket could not be created or made non-blocking. Usually means that the server is out of resources, or (hopefully not) a bug in libircclient. See also :ref:`faq_err_socket` + +.. c:macro:: LIBIRC_ERR_CONNECT + +(4): The socket could not connect to the IRC server, or to the destination DCC part. Usually means that either the IRC server is down or its address is invalid. +For DCC the reason usually is the firewall on your or destination computer, which refuses DCC transfer. + +.. c:macro:: LIBIRC_ERR_CLOSED + +(5): The IRC connection was closed by the IRC server (which could mean that an IRC operator just have banned you from the server - test your client before connecting to a public server), or the DCC connection +was closed by remote peer - for example, the other side just terminates the IRC application. Usually it is not an error. + + +.. c:macro:: LIBIRC_ERR_NOMEM + +(6): There are two possible reasons for this error. First is that memory could not be allocated for libircclient internal use, and this error is usually fatal. +Second reason is that the command buffer (which queues the commands ready to be sent to the IRC server) is full, and could not accept more commands yet. +In the last case you should just wait, and repeat the command later. + + +.. c:macro:: LIBIRC_ERR_ACCEPT + +(7): A DCC chat/send connection from the remote peer could not be accepted. Either the connection was just terminated before it is accepted, or there is a bug in libircclient. + + +.. c:macro:: LIBIRC_ERR_NODCCSEND + +(9): A filename supplied to :c:func:`irc_dcc_sendfile` could not be sent. Either is is not a regular file (a directory or a socket, for example), or it could not be read. See also :c:macro:`LIBIRC_ERR_OPENFILE` + + +.. c:macro:: LIBIRC_ERR_READ + +(10): Either a DCC file could not be read (for example, was truncated during sending), or a DCC socket returns a read error, which usually means that the network connection is terminated. + +.. c:macro:: LIBIRC_ERR_WRITE + +(11): Either a DCC file could not be written (for example, there is no free space on disk), or a DCC socket returns a write error, which usually means that the network connection is terminated. + +.. c:macro:: LIBIRC_ERR_STATE + +(12): The function is called when it is not allowed to be called. For example, :c:func:`irc_cmd_join` was called before the connection to IRC server succeed, and :c:member:`event_connect` is called. + +.. c:macro:: LIBIRC_ERR_TIMEOUT + +(13): The DCC request is timed out. There is a timer for each DCC request, which tracks connecting, accepting and non-accepted/declined DCC requests. For every request this timer +is currently set to 60 seconds. If the DCC request was not connected, accepted or declined during this time, it will be terminated with this error. + +.. c:macro:: LIBIRC_ERR_OPENFILE + +(14): The file specified in :c:func:`irc_dcc_sendfile` could not be opened. + +.. c:macro:: LIBIRC_ERR_TERMINATED + +(15): The connection to the IRC server was terminated. + +.. c:macro:: LIBIRC_ERR_NOIPV6 + +(16): The function which requires IPv6 support was called, but the IPv6 support was not compiled into the application + +.. c:macro:: LIBIRC_ERR_SSL_NOT_SUPPORTED + +(17): The SSL connection was required but the library was not compiled with SSL support + +.. c:macro:: LIBIRC_ERR_SSL_INIT_FAILED + +(18): The SSL library could not be initialized. + +.. c:macro:: LIBIRC_ERR_CONNECT_SSL_FAILED + +(19): SSL handshare failed when attempting to connect to the server. Typically this means you're trying to use SSL but attempting to connect to a non-SSL port. + +.. c:macro:: LIBIRC_ERR_SSL_CERT_VERIFY_FAILED + +(20): The server is using an invalid or the self-signed certificate. Use :c:macro:`LIBIRC_OPTION_SSL_NO_VERIFY` option to connect to it. + + +.. _api_options: + +Options +^^^^^^^ + +.. c:macro:: LIBIRC_OPTION_DEBUG + +If set, enables additional debug output which goes to STDOUT. + +.. c:macro:: LIBIRC_OPTION_STRIPNICKS + +If set, strips the event origins automatically. Every event has an origin (i.e. who originated the event). The origin usually looks like *nick!host@ircserver*, +i.e. like *tim!home@irc.server.net*. Such origins can not be used in IRC commands, and need to be stripped (i.e. host and server part should be cut off) before using. +This can be done either manually by calling :c:func:`irc_target_get_nick`, or automatically for all the events if this option is set. + + +.. c:macro:: LIBIRC_OPTION_SSL_NO_VERIFY + +By default the SSL connection is authenticated by verifying that the certificate presented by the server is signed by a known trusted certificate authority. +Since those typically cost money, some IRC servers use the self-signed certificates. They provide the benefits of the SSL connection but since they are +not signed by the Certificate Authority, their authencity cannot be verified. This option, if set, disables the certificate verification - the library +will accept any certificate presented by the server. + +This option must be set before the :c:macro:`irc_connect` function is called. diff --git a/libircclient/doc/sources/API_reference_functions.rst b/libircclient/doc/sources/API_reference_functions.rst new file mode 100644 index 0000000..2c4c1dd --- /dev/null +++ b/libircclient/doc/sources/API_reference_functions.rst @@ -0,0 +1,1710 @@ + +Functions +~~~~~~~~~ + +This section describes the functions defined in the library which are grouped by the purpose. + + +Library initialization and shutdown +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + +irc_create_session +****************** + +**Prototype:** + +.. c:function:: irc_session_t * irc_create_session( irc_callbacks_t * callbacks ) + +**Parameters:** + ++---------------------------------------------------------------------------------------------------------------------------------------+ +| *callbacks* | Event callbacks structure, which defines several callbacks, which will be called on appropriate events. Cannot be NULL. | ++---------------------------------------------------------------------------------------------------------------------------------------+ + +**Description:** + +Creates and initiates a new IRC session. Every session represents a single user connection to a single IRC server, and possibly to one or more users via DCC. +Almost every library function requires this object to be passed to, and therefore this function should be called first. +Multiple sessions could be allocated to support multiple connections. + +When it is not needed anymore, the session must be destroyed by calling the :c:func:`irc_destroy_session` function. + +**Return value:** + +An :c:type:`irc_session_t` object, or 0 if creation failed. Usually, failure is caused by out of memory error. + +**Thread safety:** + +This function can be called simultaneously from multiple threads. Same callback structure may be reused by multiple threads. + + +irc_destroy_session +******************* + +**Prototype:** + +.. c:function:: void irc_destroy_session (irc_session_t * session) + +**Parameters:** + ++---------------------------------------------------------------------------------------------------------------------------------------+ +| *session* | The IRC session handle | ++---------------------------------------------------------------------------------------------------------------------------------------+ + +**Description:** + +This function destroys an IRC session, closes the connection to the IRC server, and frees all the used resources. After calling this function you should not use this session object anymore. + +**Thread safety:** + +This function can be called simultaneously from multiple threads. + + + + +Connecting, disconnecting and running the main event loop +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +irc_connect6 +************ + +**Prototype:** + +.. c:function:: int irc_connect6 (irc_session_t * session, const char * server, unsigned short port, const char * password, const char * nick, const char * username, const char * realname) + +irc_connect +*********** + +**Prototype:** + +.. c:function:: int irc_connect (irc_session_t * session, const char * server, unsigned short port, const char * password, const char * nick, const char * username, const char * realname) + +**Parameters:** + ++-------------+-------------------------------------------------------------------------------------------------------------------------+ +| *session* | IRC session handle | ++-------------+-------------------------------------------------------------------------------------------------------------------------+ +| *server* | IP address or the host name of the server. If prefixed with #, the library will try to establish the SSL connection | +| | IPv4 address should be in numeric form such as 154.23.112.33; IPv6 address should be in IPv6 form | ++-------------+-------------------------------------------------------------------------------------------------------------------------+ +| *port* | Port number to connect to, usually 6667 | ++-------------+-------------------------------------------------------------------------------------------------------------------------+ +| *password* | IRC server password, if the server requires it. May be NULL, in this case password will not be send to the IRC | +| | server. Vast majority of IRC servers do not require passwords. This is NOT NickServ/ChanServ password | ++-------------+-------------------------------------------------------------------------------------------------------------------------+ +| *nick* | Nick which will be used to log into the IRC server. Cannot be NULL | ++-------------+-------------------------------------------------------------------------------------------------------------------------+ +| *username* | Username of the Unix account which is used to connect to the IRC server. This is for information only, will be shown in | +| | "user properties" dialogs and returned by /whois request. Can be NULL in which case "nobody" would be used | ++-------------+-------------------------------------------------------------------------------------------------------------------------+ +| *realname* | A real name of the person, who connects to the IRC. In reality nobody uses this field for that. Instead this field is | +| | used as user self-description, advertising, or other purposes. This information also will be shown in "user properties" | +| | dialogs and returned by /whois request. May be NULL, in this case "noname" will be used | ++-------------+-------------------------------------------------------------------------------------------------------------------------+ + +**Description:** + +This function initiates the connection to the IPv4 (irc_connect) or IPv6 (irc_connect6) IRC server. The server could be specified either by an IP address or by the DNS name. +The irc_connect6 works only if the library was built with the IPv6 support. + +If the library was built with the OpenSSL support, and the IP address or the host name is prefixed by a hash, such as ``"#irc.example.com"``, the library attempts to establish the SSL connection. + +The connection is established asynchronously, and the :c:member:`event_connect` is called once the connection is established. + +A single IRC session object can only be connected to a single IRC server and only with a single nick, meaning it is not possible to have multiple nicks sharing a single connection. + +**Return value:** + +Returns 0 if the connection is initiated successfully. This doesn't mean the connection is established - the :c:member:`event_connect` is called when it happens. If the connection cannot be established, +either :c:func:`irc_run` or :c:func:`irc_process_select_descriptors` will return an error. + +**Thread safety:** + +This function can be called simultaneously from multiple threads, but not using the same session object. + + + +irc_disconnect +************** + +**Prototype:** + +.. c:function:: void irc_disconnect (irc_session_t * session) + +**Parameters:** + ++---------------------------------------------------------------------------------------------------------------------------------------+ +| *session* | IRC session handle | ++---------------------------------------------------------------------------------------------------------------------------------------+ + +**Description:** + +This function closes the IRC connection. After that connection is closed, if the libirc was looped in the :c:func:`irc_run` loop, it automatically leaves the loop and :c:func:`irc_run` returns. + + +**Thread safety:** + +This function can be called simultaneously from multiple threads, but not using the same session object. + + + +irc_is_connected +**************** + +**Prototype:** + +.. c:function:: int irc_is_connected (irc_session_t * session) + +**Parameters:** + ++-------------+-------------------------------------------------------------------------------------------------------------------------+ +| *session* | IRC session handle | ++-------------+-------------------------------------------------------------------------------------------------------------------------+ + +**Return value:** + +This function returns 1 if the connection to the IRC server is established or 0 if it is not. + + +**Thread safety:** + +This function can be called simultaneously from multiple threads. + + +irc_run +******* + +**Prototype:** + +.. c:function:: int irc_run (irc_session_t * session) + +**Parameters:** + ++-------------+-------------------------------------------------------------------------------------------------------------------------+ +| *session* | IRC session handle | ++-------------+-------------------------------------------------------------------------------------------------------------------------+ + +**Description:** + +This function enters into forever loop, processing the IRC events, and calling the relevant callbacks. This function will not return +until the server connection is terminated - either by server, or by calling :c:type:`irc_cmd_quit`. This function should only be used +if you use a single IRC session and don't need asynchronous request processing (i.e. your bot just reacts on the events, and doesn't +generate it asynchronously). Even in last case, you still can call this function and start the asynchronous thread in :c:member:`event_connect` handler. +See the examples. + +**Return value:** + +This function returns a nonzero value if the connection to the IRC server could not be established, or was terminated. + +**Thread safety:** + +This function cannot be called from multiple threads. Use :c:func:`irc_add_select_descriptors` and :c:func:`irc_process_select_descriptors` instead. + + +irc_add_select_descriptors +************************** + +**Prototype:** + +.. c:function:: int irc_add_select_descriptors (irc_session_t * session, fd_set *in_set, fd_set *out_set, int * maxfd) + +**Parameters:** + ++-------------+-------------------------------------------------------------------------------------------------------------------------+ +| *session* | IRC session handle | ++-------------+-------------------------------------------------------------------------------------------------------------------------+ +| *in_set* | fd_set input descriptor set for select() | ++-------------+-------------------------------------------------------------------------------------------------------------------------+ +| *out_set* | fd_set output descriptor set for select() | ++-------------+-------------------------------------------------------------------------------------------------------------------------+ +| *maxfd* | Largest descriptor already in all the sets. Will be updated if libirc adds larger number to the FD_SET array | ++-------------+-------------------------------------------------------------------------------------------------------------------------+ + + +**Description:** + +This function should be used after you called :c:func:`irc_connect`. It is useful when you have your own select-based event processing loop. To use it +you should put your own descriptors into the sets, call this function to add the library descriptor(s) into the set, and then call select(). +When it returns, you should call :c:func:`irc_process_select_descriptors` which will handle the events and calls your callbacks(!). Then you can process +your sockets events from set. See the example. + +What if you use epoll? :ref:`See the FAQ ` + +**Return value:** + +This function returns a nonzero value if the :c:func:`irc_connect` was not called before calling this function. + +**Thread safety:** + +This function can be called simultaneously from multiple threads, but it rarely makes sense. + + + +irc_process_select_descriptors +****************************** + +**Prototype:** + +.. c:function:: int irc_process_select_descriptors (irc_session_t * session, fd_set *in_set, fd_set *out_set) + +**Parameters:** + ++-------------+-------------------------------------------------------------------------------------------------------------------------+ +| *session* | IRC session handle | ++-------------+-------------------------------------------------------------------------------------------------------------------------+ +| *in_set* | fd_set input descriptor set for select() | ++-------------+-------------------------------------------------------------------------------------------------------------------------+ +| *out_set* | fd_set output descriptor set for select() | ++-------------+-------------------------------------------------------------------------------------------------------------------------+ + + +**Description:** + +This function should be used in pair with :c:func:`irc_add_select_descriptors` function, which documentation describes how they work together. + +Note that while processing the events this function calls your callbacks and it will not return until all your callbacks return. Keep that in mind +if you pop up a dialog in your application, such as a DCC CHAT or DCC SEND confirmation dialog. + +**Return value:** + +Return code 0 means success. Other value means error, the error code may be obtained through irc_errno(). + +**Thread safety:** + +This function can be called simultaneously from multiple threads for different IRC session objects only. + + + +Managing the IRC channels: joining, leaving, inviting +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +irc_cmd_join +************ + +**Prototype:** + +.. c:function:: int irc_cmd_join (irc_session_t * session, const char * channel, const char * key) + +**Parameters:** + ++-------------+-------------------------------------------------------------------------------------------------------------------------+ +| *session* | IRC session handle | ++-------------+-------------------------------------------------------------------------------------------------------------------------+ +| *channel* | Channel name to join. Cannot be NULL. | ++-------------+-------------------------------------------------------------------------------------------------------------------------+ +| *key* | Secret key for the channel. Can be NULL if not needed | ++-------------+-------------------------------------------------------------------------------------------------------------------------+ + + +**Description:** + +Use this function to join the new IRC channel. If the channel does not exist, it will be automatically created by the IRC server. +Note that to JOIN the password-protected channel, you must know the password, and specify it in the key argument. +If join is successful, the :c:member:`event_join` will be called (with your nick as the origin), then typically the :c:member:`event_topic` is be called and then you +receive the list of users who are on the channel (by using LIBIRC_RFC_RPL_NAMREPLY), which will include the user who just joined. + +**Return value:** + +Return code 0 means the command was sent to the IRC server successfully. This does not mean the operation succeed, and you need to wait +for the appropriate event or for the error code via :c:member:`event_numeric` event. + +Possible error responces for this command from the RFC1459: + - LIBIRC_RFC_ERR_BANNEDFROMCHAN + - LIBIRC_RFC_ERR_INVITEONLYCHAN + - LIBIRC_RFC_ERR_BADCHANNELKEY + - LIBIRC_RFC_ERR_CHANNELISFULL + - LIBIRC_RFC_ERR_BADCHANMASK + - LIBIRC_RFC_ERR_NOSUCHCHANNEL + - LIBIRC_RFC_ERR_TOOMANYCHANNELS + +**Thread safety:** + +This function can be called simultaneously from multiple threads. + + + +irc_cmd_part +************ + +**Prototype:** + +.. c:function:: int irc_cmd_part (irc_session_t * session, const char * channel) + +**Parameters:** + ++-------------+-------------------------------------------------------------------------------------------------------------------------+ +| *session* | IRC session handle | ++-------------+-------------------------------------------------------------------------------------------------------------------------+ +| *channel* | Channel name to leave. Cannot be NULL. | ++-------------+-------------------------------------------------------------------------------------------------------------------------+ + + +**Description:** + +Use this function to leave the IRC channel you've already joined to. An attempt to leave the channel you aren't in results a LIBIRC_RFC_ERR_NOTONCHANNEL server error. + +**Return value:** + +Return code 0 means the command was sent to the IRC server successfully. This does not mean the operation succeed, and you need to wait +for the appropriate event or for the error code via :c:member:`event_numeric` event. + +Possible error responces for this command from the RFC1459: + - LIBIRC_RFC_ERR_NOSUCHCHANNEL + - LIBIRC_RFC_ERR_NOTONCHANNEL + +**Thread safety:** + +This function can be called simultaneously from multiple threads. + + + +irc_cmd_invite +************** + +**Prototype:** + +.. c:function:: int irc_cmd_invite (irc_session_t * session, const char * nick, const char * channel) + +**Parameters:** + ++-------------+-------------------------------------------------------------------------------------------------------------------------+ +| *session* | IRC session handle | ++-------------+-------------------------------------------------------------------------------------------------------------------------+ +| *nick* | Nick name of the user to invite | ++-------------+-------------------------------------------------------------------------------------------------------------------------+ +| *channel* | Channel name to join. Cannot be NULL | ++-------------+-------------------------------------------------------------------------------------------------------------------------+ + + +**Description:** + +This function is used to invite someone to invite-only channel. "Invite-only" is a channel mode, which restricts anyone, except invided, to join this channel. +After invitation, the user could join this channel. The user, who is invited, will receive the :c:member:`event_invite` event. Note that you must be a channel operator to invite the users. + +**Return value:** + +Return code 0 means the command was sent to the IRC server successfully. This does not mean the operation succeed, and you need to wait +for the appropriate event or for the error code via :c:member:`event_numeric` event. + +On success one of the following replies returned: + - LIBIRC_RFC_RPL_INVITING + - LIBIRC_RFC_RPL_AWAY + +Possible error responces for this command from the RFC1459: + - LIBIRC_RFC_ERR_NEEDMOREPARAMS + - LIBIRC_RFC_ERR_NOSUCHNICK + - LIBIRC_RFC_ERR_NOTONCHANNEL + - LIBIRC_RFC_ERR_ERR_USERONCHANNEL + - LIBIRC_RFC_ERR_ERR_CHANOPRIVSNEEDED + +**Thread safety:** + +This function can be called simultaneously from multiple threads. + + +irc_cmd_names +************* + +**Prototype:** + +.. c:function:: int irc_cmd_names (irc_session_t * session, const char * channel); + +**Parameters:** + ++-------------+-------------------------------------------------------------------------------------------------------------------------+ +| *session* | IRC session handle | ++-------------+-------------------------------------------------------------------------------------------------------------------------+ +| *channel* | A channel name(s) to obtain user list. Multiple channel names must be separated by a comma | ++-------------+-------------------------------------------------------------------------------------------------------------------------+ + + +**Description:** + +This function is used to to ask the IRC server for the list of the users who are joined the specified channel. You can list all nicknames +that are visible to you on any channel that you can see. The list of users will be returned using LIBIRC_RFC_RPL_NAMREPLY and LIBIRC_RFC_RPL_ENDOFNAMES numeric codes. + +**Return value:** + +Return code 0 means the command was sent to the IRC server successfully. This does not mean the operation succeed, and you need to wait +for the appropriate event or for the error code via :c:member:`event_numeric` event. + +The channel names are returned by :c:member:`event_numeric` event using the following reply codes: + - LIBIRC_RFC_RPL_NAMREPLY + - LIBIRC_RFC_RPL_ENDOFNAMES + +**Thread safety:** + +This function can be called simultaneously from multiple threads. + + + +irc_cmd_list +************ + +**Prototype:** + +.. c:function:: int irc_cmd_list (irc_session_t * session, const char * channel) + +**Parameters:** + ++-------------+-------------------------------------------------------------------------------------------------------------------------+ +| *session* | IRC session handle | ++-------------+-------------------------------------------------------------------------------------------------------------------------+ +| *channel* | A channel name(s) to list. Multiple channel names must be separated by a comma. If NULL, all channels are listed | ++-------------+-------------------------------------------------------------------------------------------------------------------------+ + + +**Description:** + +This function is used to ask the IRC server for the active (existing) channels list. The list will be returned using the LIBIRC_RFC_RPL_LISTSTART, +multiple LIBIRC_RFC_RPL_LIST, and LIBIRC_RFC_RPL_LISTEND event sequence. Note that "private" channels are listed (without their topics) as channel +"Prv" unless the client generating the LIST query is actually on that channel. Likewise, secret channels are not listed at all unless the client +is active at the channel in question. + +**Return value:** + +Return code 0 means the command was sent to the IRC server successfully. This does not mean the operation succeed, and you need to wait +for the appropriate event or for the error code via :c:member:`event_numeric` event. + +The list of channels is returned by :c:member:`event_numeric` event using the following reply codes: + - LIBIRC_RFC_RPL_LISTSTART + - LIBIRC_RFC_RPL_LISTEND + - LIBIRC_RFC_RPL_LIST + +**Thread safety:** + +This function can be called simultaneously from multiple threads. + + +irc_cmd_topic +************* + +**Prototype:** + +.. c:function:: int irc_cmd_topic (irc_session_t * session, const char * channel, const char * topic) + +**Parameters:** + ++-------------+-------------------------------------------------------------------------------------------------------------------------+ +| *session* | IRC session handle | ++-------------+-------------------------------------------------------------------------------------------------------------------------+ +| *channel* | A channel name | ++-------------+-------------------------------------------------------------------------------------------------------------------------+ +| *topic* | A new channel topic. If NULL, the old topic would be returned and nothing would change. To set the empty topic use "" | ++-------------+-------------------------------------------------------------------------------------------------------------------------+ + + +**Description:** + +This function is used to change or view the topic (title) of a channel. Note that depending on *+t* channel mode, you may be required to be +a channel operator to change the channel topic. + +If the command succeeds, the IRC server will generate a LIBIRC_RFC_RPL_NOTOPIC or LIBIRC_RFC_RPL_TOPIC message, containing either the old +or changed topic. Also the IRC server can (but does not have to) generate the non-RFC LIBIRC_RFC_RPL_TOPIC_EXTRA message, containing the +nick of person who changed the topic, and the date/time of the last change. + +**Return value:** + +Return code 0 means the command was sent to the IRC server successfully. This does not mean the operation succeed, and you need to wait +for the appropriate event or for the error code via :c:member:`event_numeric` event. + +The topic information is returned using one of following reply codes: + - LIBIRC_RFC_RPL_NOTOPIC + - LIBIRC_RFC_RPL_TOPIC + +If the topic change was requested and it was successfully changed, the :c:member:`event_topic` is generated as well. + +Possible error responces for this command from the RFC1459: + - LIBIRC_RFC_ERR_NEEDMOREPARAMS + - LIBIRC_RFC_ERR_CHANOPRIVSNEEDED + - LIBIRC_RFC_ERR_NOTONCHANNEL + +**Thread safety:** + +This function can be called simultaneously from multiple threads. + + +irc_cmd_channel_mode +******************** + +**Prototype:** + +.. c:function:: int irc_cmd_channel_mode (irc_session_t * session, const char * channel, const char * mode) + +**Parameters:** + ++-------------+-------------------------------------------------------------------------------------------------------------------------+ +| *session* | IRC session handle | ++-------------+-------------------------------------------------------------------------------------------------------------------------+ +| *channel* | A channel name | ++-------------+-------------------------------------------------------------------------------------------------------------------------+ +| *mode* | A mode to change. If NULL, the channel mode is not changed but the old mode is returned | ++-------------+-------------------------------------------------------------------------------------------------------------------------+ + + +**Description:** + +This function is used to is used to change or view the channel modes. Note that only the channel operators can change the channel mode. + +Channel mode is represended by the multiple letters combination. Every letter has its own meaning in channel modes. Most channel mode letters +are boolean (i.e. could only be set or reset), but a few channel mode letters accept a parameter. All channel options are set by adding a +plus sign before the letter, and reset by adding a minus sign before the letter. + +Here is the list of 'standard' channel modes: + ++-------------+-------------------------------------------------------------------------------------------------------------------------+ +| o nickname | gives (+o nickname) to, or takes (-o nickname) the channel operator privileges from a *nickname*. This mode affects | +| | the users in channel, not the channel itself. Examples: "+o tim", "-o watson" | ++-------------+-------------------------------------------------------------------------------------------------------------------------+ +| p | sets (+p) or resets (-p) private channel flag. Private channels are shown in channel list as 'Prv', without the topic | ++-------------+-------------------------------------------------------------------------------------------------------------------------+ +| s | sets (+s) or resets (-s) secret channel flag. Secret channels aren't shown in channel list at all | ++-------------+-------------------------------------------------------------------------------------------------------------------------+ +| i | sets (+i) or resets (-i) invite-only channel flag. When the flag is set, only the people who are invited by the | +| | :c:func:`irc_cmd_invite` can join this channel | ++-------------+-------------------------------------------------------------------------------------------------------------------------+ +| t | allows (+t) or denies (-t) changing the topic by the non-channel operator users. When the flag is set, only the channel | +| | operators can change the channel topic | ++-------------+-------------------------------------------------------------------------------------------------------------------------+ +| n | sets (+n) or resets (-n) the protection from the users who did not join the channel. When the +n mode is set, only the | +| | users who have joined the channel can send the messages to the channel | ++-------------+-------------------------------------------------------------------------------------------------------------------------+ +| m | sets (+m) or resets (-m) the moderation of the channel. When the moderation mode is set, only channel operators and the | +| | users who have +v user mode can speak in the channel | ++-------------+-------------------------------------------------------------------------------------------------------------------------+ +| v nickname | gives (+v nick) or takes (-v nick) from user the ability to speak on a moderated channel. Examples: "+v bob", "-v joy" | ++-------------+-------------------------------------------------------------------------------------------------------------------------+ +| l number | sets (+l 20) or removes (-l) the restriction of maximum number of users allowed in channel. When the restriction is set | +| | and there is a number of users in the channel, no one can join the channel anymore | ++-------------+-------------------------------------------------------------------------------------------------------------------------+ +| k key | sets (+k password) or removes (-k) the password from the channel. When the restriction is set, any user joining the | +| | channel required to provide a channel key | ++-------------+-------------------------------------------------------------------------------------------------------------------------+ +| b mask | sets (+b *!*@*.mil) or removes (-b *!*@*.mil) the ban mask on a user to keep him out of channel. Note that to remove the| +| | ban you must specify the ban mask to remove, not just "-b". | ++-------------+-------------------------------------------------------------------------------------------------------------------------+ + +Note that the actual list of channel modes depends on the IRC server, and can be bigger. If you know the popular channel modes which aren't listed here - please contact me + +**Return value:** + +Return code 0 means the command was sent to the IRC server successfully. This does not mean the operation succeed, and you need to wait +for the appropriate event or for the error code via :c:member:`event_numeric` event. + +The old mode information is returned by using following numeric codes: + - LIBIRC_RFC_RPL_CHANNELMODEIS + - LIBIRC_RFC_RPL_BANLIST + - LIBIRC_RFC_RPL_ENDOFBANLIST + +Possible error responces for this command from the RFC1459: + - LIBIRC_RFC_ERR_NEEDMOREPARAMS + - LIBIRC_RFC_ERR_CHANOPRIVSNEEDED + - LIBIRC_RFC_ERR_NOSUCHNICK + - LIBIRC_RFC_ERR_NOTONCHANNEL + - LIBIRC_RFC_ERR_KEYSET + - LIBIRC_RFC_ERR_UNKNOWNMODE + - LIBIRC_RFC_ERR_NOSUCHCHANNEL + +**Thread safety:** + +This function can be called simultaneously from multiple threads. + + +irc_cmd_user_mode +***************** + +**Prototype:** + +.. c:function:: int irc_cmd_user_mode (irc_session_t * session, const char * mode) + +**Parameters:** + ++-------------+-------------------------------------------------------------------------------------------------------------------------+ +| *session* | IRC session handle | ++-------------+-------------------------------------------------------------------------------------------------------------------------+ +| *mode* | A mode to change. If NULL, the user mode is not changed but the old mode is returned | ++-------------+-------------------------------------------------------------------------------------------------------------------------+ + + +**Description:** + +This function is used to change or view the user modes. Note that, unlike channel modes, some user modes cannot be changed at all. + +User mode is represended by the letters combination. All the user mode letters are boolean (i.e. could only be set or reset), they are set +by adding a plus sign before the letter, and reset by adding a minus sign before the letter. + +Here is the list of 'standard' user modes: + ++---+-----------------------------------------------------------------------------------------------------------------------------------+ +| o | represents an IRC operator status. Could not be set directly (but can be reset though), to set it use the IRC \a OPER command | ++---+-----------------------------------------------------------------------------------------------------------------------------------+ +| i | if set, marks a user as 'invisible' - that is, not seen by lookups if the user is not in a channel | ++---+-----------------------------------------------------------------------------------------------------------------------------------+ +| w | if set, marks a user as 'receiving wallops' - special messages generated by IRC operators using WALLOPS command | ++---+-----------------------------------------------------------------------------------------------------------------------------------+ +| s | if set, marks a user for receipt of server notices | ++---+-----------------------------------------------------------------------------------------------------------------------------------+ +| r | NON-STANDARD MODE. If set, user has been authenticated with the NickServ IRC service | ++---+-----------------------------------------------------------------------------------------------------------------------------------+ +| x | NON-STANDARD MODE. If set, user's real IP is masked by the IRC server | ++---+-----------------------------------------------------------------------------------------------------------------------------------+ + +Note that the actual list of user modes depends on the IRC server, and can be bigger. If you know the popular user modes, which aren't mentioned here - please contact me. + + +**Return value:** + +Return code 0 means the command was sent to the IRC server successfully. This does not mean the operation succeed, and you need to wait +for the appropriate event or for the error code via :c:member:`event_numeric` event. + +The old mode information is returned by using the numeric code LIBIRC_RFC_RPL_UMODEIS: + +Possible error responces for this command from the RFC1459: + - LIBIRC_RFC_ERR_NEEDMOREPARAMS + - LIBIRC_RFC_ERR_NOSUCHNICK + - LIBIRC_RFC_ERR_UNKNOWNMODE + - LIBIRC_RFC_ERR_USERSDONTMATCH + - LIBIRC_RFC_ERR_UMODEUNKNOWNFLAG + +**Thread safety:** + +This function can be called simultaneously from multiple threads. + +irc_cmd_kick +************ + +**Prototype:** + +.. c:function:: int irc_cmd_kick (irc_session_t * session, const char * nick, const char * channel, const char * reason); + +**Parameters:** + ++-------------+-------------------------------------------------------------------------------------------------------------------------+ +| *session* | IRC session handle | ++-------------+-------------------------------------------------------------------------------------------------------------------------+ +| *nick* | The nick to kick | ++-------------+-------------------------------------------------------------------------------------------------------------------------+ +| *channel* | The channel to kick the nick from | ++-------------+-------------------------------------------------------------------------------------------------------------------------+ +| *nick* | If not NULL, the reason to kick the user | ++-------------+-------------------------------------------------------------------------------------------------------------------------+ + +**Description:** + +This function is used to kick a person out of channel. Note that you must be a channel operator to kick anyone from a channel. + +**Return value:** + +Return code 0 means the command was sent to the IRC server successfully. This does not mean the operation succeed, and you need to wait +for the appropriate event or for the error code via :c:member:`event_numeric` event. + +If the command succeed, the :c:member:`event_kick` will be generated. + +If the command failed, one of the following :c:member:`event_numeric` responses will be generated: + - LIBIRC_RFC_ERR_NEEDMOREPARAMS + - LIBIRC_RFC_ERR_BADCHANMASK + - LIBIRC_RFC_ERR_NOSUCHCHANNEL + - LIBIRC_RFC_ERR_NOTONCHANNEL + - LIBIRC_RFC_ERR_CHANOPRIVSNEEDED + +**Thread safety:** + +This function can be called simultaneously from multiple threads. + + +Sending the messages, notices, /me messages and working with CTCP +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +irc_cmd_msg +*********** + +**Prototype:** + +.. c:function:: int irc_cmd_msg (irc_session_t * session, const char * nch, const char * text) + +**Parameters:** + ++-------------+-------------------------------------------------------------------------------------------------------------------------+ +| *session* | IRC session handle | ++-------------+-------------------------------------------------------------------------------------------------------------------------+ +| *nch* | Target nick or target channel | ++-------------+-------------------------------------------------------------------------------------------------------------------------+ +| *text* | Message text | ++-------------+-------------------------------------------------------------------------------------------------------------------------+ + +**Description:** + +This function is used to send the message to the channel or privately to another nick. "Privately" here means the message is not posted to the public, +but the message still goes through the IRC server and could be seen by the IRC netwrk operators. The message target is determined by the *nch* argument: +if it is a nick, this will be a private message, but if it is a channel name it will be posted into the channel. + +The protocol does not require you to join the channel to post the message into it, but most channels set the channel mode preventing you from posting into a channel unless you join it. + +**Return value:** + +Return code 0 means the command was sent to the IRC server successfully. This does not mean the operation succeed. You need to wait +for the appropriate event or for the error code via :c:member:`event_numeric` event. + +If the command succeed, no event is typically generated except the possibility of LIBIRC_RFC_RPL_AWAY. + +However if the command failed, one of the following numeric events may be generated: + - LIBIRC_RFC_ERR_NORECIPIENT + - LIBIRC_RFC_ERR_NOTEXTTOSEND + - LIBIRC_RFC_ERR_CANNOTSENDTOCHAN + - LIBIRC_RFC_ERR_NOTONCHANNEL + - LIBIRC_RFC_ERR_NOTOPLEVEL + - LIBIRC_RFC_ERR_WILDTOPLEVEL + - LIBIRC_RFC_ERR_TOOMANYTARGETS + - LIBIRC_RFC_ERR_NOSUCHNICK + +**Thread safety:** + +This function can be called simultaneously from multiple threads. + + +irc_cmd_me +********** + +**Prototype:** + +.. c:function:: int irc_cmd_me (irc_session_t * session, const char * nch, const char * text) + +**Parameters:** + ++-------------+-------------------------------------------------------------------------------------------------------------------------+ +| *session* | IRC session handle | ++-------------+-------------------------------------------------------------------------------------------------------------------------+ +| *nch* | Target nick or target channel | ++-------------+-------------------------------------------------------------------------------------------------------------------------+ +| *text* | Message text | ++-------------+-------------------------------------------------------------------------------------------------------------------------+ + + +**Description:** + +This function is used to send the /me message (CTCP ACTION) to the channel or privately to another nick. "Privately" here means the message is not posted to the public, +but the message still goes through the IRC server and could be seen by the IRC netwrk operators. The message target is determined by the *nch* argument: +if it is a nick, this will be a private message, but if it is a channel name it will be posted into the channel. + +The protocol does not require you to join the channel to post the message into it, but most channels set the channel mode preventing you from posting into a channel unless you join it. + +**Return value:** + +Return code 0 means the command was sent to the IRC server successfully. This does not mean the operation succeed. You need to wait +for the appropriate event or for the error code via :c:member:`event_numeric` event. + +If the command succeed, no event is typically generated except the possibility of LIBIRC_RFC_RPL_AWAY. + +However if the command failed, one of the following numeric events may be generated: + - LIBIRC_RFC_ERR_NORECIPIENT + - LIBIRC_RFC_ERR_NOTEXTTOSEND + - LIBIRC_RFC_ERR_CANNOTSENDTOCHAN + - LIBIRC_RFC_ERR_NOTONCHANNEL + - LIBIRC_RFC_ERR_NOTOPLEVEL + - LIBIRC_RFC_ERR_WILDTOPLEVEL + - LIBIRC_RFC_ERR_TOOMANYTARGETS + - LIBIRC_RFC_ERR_NOSUCHNICK + +**Thread safety:** + +This function can be called simultaneously from multiple threads. + + +irc_cmd_notice +************** + +**Prototype:** + +.. c:function:: int irc_cmd_notice (irc_session_t * session, const char * nch, const char * text) + +**Parameters:** + ++-------------+-------------------------------------------------------------------------------------------------------------------------+ +| *session* | IRC session handle | ++-------------+-------------------------------------------------------------------------------------------------------------------------+ +| *nch* | Target nick or target channel | ++-------------+-------------------------------------------------------------------------------------------------------------------------+ +| *text* | Message text | ++-------------+-------------------------------------------------------------------------------------------------------------------------+ + +**Description:** + +This function is used to send the notice to the channel or privately to another nick. "Privately" here means the message is not posted to the public, +but the message still goes through the IRC server and could be seen by the IRC netwrk operators. The message target is determined by the *nch* argument: +if it is a nick, this will be a private message, but if it is a channel name it will be posted into the channel. + +The protocol does not require you to join the channel to post the notice into it, but most channels set the channel mode preventing you from posting into a channel unless you join it. + +The only difference between a message and a notice is that the RFC explicitly says the automatic bots must not reply to NOTICE automatically. + +**Return value:** + +Return code 0 means the command was sent to the IRC server successfully. This does not mean the operation succeed, and you need to wait +for the appropriate event or for the error code via :c:member:`event_numeric` event. + +If the command succeed, no event is typically generated except the possibility of LIBIRC_RFC_RPL_AWAY. + +However if the command failed, one of the following numeric events may be generated: + - LIBIRC_RFC_ERR_NORECIPIENT + - LIBIRC_RFC_ERR_NOTEXTTOSEND + - LIBIRC_RFC_ERR_CANNOTSENDTOCHAN + - LIBIRC_RFC_ERR_NOTONCHANNEL + - LIBIRC_RFC_ERR_NOTOPLEVEL + - LIBIRC_RFC_ERR_WILDTOPLEVEL + - LIBIRC_RFC_ERR_TOOMANYTARGETS + - LIBIRC_RFC_ERR_NOSUCHNICK + +**Thread safety:** + +This function can be called simultaneously from multiple threads. + + +irc_cmd_ctcp_request +******************** + +**Prototype:** + +.. c:function:: int irc_cmd_ctcp_request (irc_session_t * session, const char * nick, const char * request) + +**Parameters:** + ++-------------+-------------------------------------------------------------------------------------------------------------------------+ +| *session* | IRC session handle | ++-------------+-------------------------------------------------------------------------------------------------------------------------+ +| *nick* | Target nick | ++-------------+-------------------------------------------------------------------------------------------------------------------------+ +| *request* | CTCP request tex | ++-------------+-------------------------------------------------------------------------------------------------------------------------+ + +**Description:** + +This function is used to send a CTCP request. There are four CTCP requests supported by most IRC clients: + + * VERSION - get the client software name and version + * FINGER - get the client username, host and real name. + * PING - get the client delay. + * TIME - get the client local time. + +Some clients may support other requests. The RFC does not list the requests and does not mandate any CTCP support. + +If you send the CTCP request, make sure you define the handler for the :c:member:`event_ctcp_rep` to process the reply; + +**Return value:** + +Return code 0 means the command was sent to the IRC server successfully. This does not mean the operation succeed, and you need to wait +for the appropriate event or for the error code via :c:member:`event_numeric` event. + +Possible error responces for this command from the RFC1459: + - LIBIRC_RFC_ERR_NORECIPIENT + - LIBIRC_RFC_ERR_NOTEXTTOSEND + - LIBIRC_RFC_ERR_CANNOTSENDTOCHAN + - LIBIRC_RFC_ERR_NOTONCHANNEL + - LIBIRC_RFC_ERR_NOTOPLEVEL + - LIBIRC_RFC_ERR_WILDTOPLEVEL + - LIBIRC_RFC_ERR_TOOMANYTARGETS + - LIBIRC_RFC_ERR_NOSUCHNICK + +**Thread safety:** + +This function can be called simultaneously from multiple threads. + + +irc_cmd_ctcp_reply +****************** + +**Prototype:** + +.. c:function:: int irc_cmd_ctcp_reply (irc_session_t * session, const char * nick, const char * reply) + +**Parameters:** + ++-------------+-------------------------------------------------------------------------------------------------------------------------+ +| *session* | IRC session handle | ++-------------+-------------------------------------------------------------------------------------------------------------------------+ +| *nick* | Target nick | ++-------------+-------------------------------------------------------------------------------------------------------------------------+ +| *reply* | CTCP reply | ++-------------+-------------------------------------------------------------------------------------------------------------------------+ + +**Description:** + +This function is used to send a reply to the CTCP request received from :c:member:`event_ctcp_req` event. Note that you will not receive this event +unless you specify your own handler during the IRC session initialization. + +**Return value:** + +Return code 0 means the command was sent to the IRC server successfully. This does not mean the operation succeed, and you need to wait +for the appropriate event or for the error code via :c:member:`event_numeric` event. + +Possible error responces for this command from the RFC1459: + - LIBIRC_RFC_ERR_NORECIPIENT + - LIBIRC_RFC_ERR_NOTEXTTOSEND + - LIBIRC_RFC_ERR_CANNOTSENDTOCHAN + - LIBIRC_RFC_ERR_NOTONCHANNEL + - LIBIRC_RFC_ERR_NOTOPLEVEL + - LIBIRC_RFC_ERR_WILDTOPLEVEL + - LIBIRC_RFC_ERR_TOOMANYTARGETS + - LIBIRC_RFC_ERR_NOSUCHNICK + +**Thread safety:** + +This function can be called simultaneously from multiple threads. + + + +Miscellaneous: library version, raw data, changing nick, quitting +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +irc_cmd_nick +************ + +**Prototype:** + +.. c:function:: int irc_cmd_nick (irc_session_t * session, const char * newnick) + +**Parameters:** + ++-------------+-------------------------------------------------------------------------------------------------------------------------+ +| *session* | IRC session handle | ++-------------+-------------------------------------------------------------------------------------------------------------------------+ +| *nick* | New nick | ++-------------+-------------------------------------------------------------------------------------------------------------------------+ + +**Description:** + +This function is used to change your current nick to another nick. Note that such a change is not always possible; for example +you cannot change nick to the existing nick, or (on some servers) to the registered nick. + +**Return value:** + +Return code 0 means the command was sent to the IRC server successfully. This does not mean the operation succeed, and you need to wait +for the appropriate event or for the error code via :c:member:`event_numeric` event. + +If the operation succeed, the server will send the :c:member:`event_nick` event. If not, it will send a numeric error. Possible error responces for this command from the RFC1459: + - LIBIRC_RFC_ERR_NONICKNAMEGIVEN + - LIBIRC_RFC_ERR_ERRONEUSNICKNAME + - LIBIRC_RFC_ERR_NICKNAMEINUSE + - LIBIRC_RFC_ERR_NICKCOLLISION + +**Thread safety:** + +This function can be called simultaneously from multiple threads. + + +irc_cmd_whois +************* + +**Prototype:** + +.. c:function:: int irc_cmd_whois (irc_session_t * session, const char * nick) + +**Parameters:** + ++-------------+-------------------------------------------------------------------------------------------------------------------------+ +| *session* | IRC session handle | ++-------------+-------------------------------------------------------------------------------------------------------------------------+ +| *nick* | Nick or comma-separated list of nicks to query the information about | ++-------------+-------------------------------------------------------------------------------------------------------------------------+ + +**Description:** + +This function queries various information about the nick. The amount of information depends on the IRC server but typically includes username, +real name (as defined by the client at login), the IRC server used, the channels user is in, idle time, away mode and so on. + + +**Return value:** + +Return code 0 means the command was sent to the IRC server successfully. This does not mean the operation succeed, and you need to wait +for the appropriate :c:member:`event_numeric` event. + +If the request succeed, the information is returned through the following numeric codes which return the information: + - LIBIRC_RFC_RPL_WHOISUSER + - LIBIRC_RFC_RPL_WHOISCHANNELS + - LIBIRC_RFC_RPL_WHOISSERVER + - LIBIRC_RFC_RPL_AWAY + - LIBIRC_RFC_RPL_WHOISOPERATOR + - LIBIRC_RFC_RPL_WHOISIDLE + - LIBIRC_RFC_RPL_ENDOFWHOIS - this event terminates the WHOIS information + +Possible error responces for this command from the RFC1459: + - LIBIRC_RFC_ERR_NOSUCHSERVER + - LIBIRC_RFC_ERR_NOSUCHNICK + - LIBIRC_RFC_ERR_NONICKNAMEGIVEN + +**Thread safety:** + +This function can be called simultaneously from multiple threads. + + +irc_cmd_quit +************ + +**Prototype:** + +.. c:function:: int irc_cmd_quit (irc_session_t * session, const char * reason) + +**Parameters:** + ++-------------+-------------------------------------------------------------------------------------------------------------------------+ +| *session* | IRC session handle | ++-------------+-------------------------------------------------------------------------------------------------------------------------+ +| *reason* | If not NULL, the reason to quit | ++-------------+-------------------------------------------------------------------------------------------------------------------------+ + +**Description:** +This function sends the QUIT command to the IRC server. This command forces the IRC server to close the IRC connection, and terminate the session. + +The difference between this command and calling the irc_disconnect is that this command allows to specify the reason to quit which will be shown +to all the users in the channels you joined. Also it would make it clear that you left the IRC channels by purpose, and not merely got disconnected. + +**Return value:** + +Return code 0 means the command was sent to the IRC server successfully. This does not mean the operation succeed, and you need to wait +for the appropriate event or for the error code via :c:member:`event_numeric` event. + +**Thread safety:** + +This function can be called simultaneously from multiple threads. + + +irc_send_raw +************ + +**Prototype:** + +.. c:function:: int irc_send_raw (irc_session_t * session, const char * format, ...); + +**Parameters:** + ++-------------+-------------------------------------------------------------------------------------------------------------------------+ +| *session* | IRC session handle | ++-------------+-------------------------------------------------------------------------------------------------------------------------+ +| *format* | printf-type formatting string followed by the format arguments | ++-------------+-------------------------------------------------------------------------------------------------------------------------+ + +**Description:** + +This function sends the raw data as-is to the IRC server. Use it to generate a server command, which is not (yet) provided by libircclient directly. + +**Return value:** + +Return code 0 means the command was sent to the IRC server successfully. This does not mean the operation succeed, and you need to wait +for the appropriate event or for the error code via :c:member:`event_numeric` event. + +**Thread safety:** + +This function can be called simultaneously from multiple threads. + + +irc_target_get_nick +******************* + +**Prototype:** + +.. c:function:: void irc_target_get_nick (const char * origin, char *nick, size_t size) + +**Parameters:** + ++-------------+-------------------------------------------------------------------------------------------------------------------------+ +| *origin* | Nick in the common IRC server format such as tim!root\@mycomain.com | ++-------------+-------------------------------------------------------------------------------------------------------------------------+ +| *nick* | Buffer to retrieve the parsed nick name | ++-------------+-------------------------------------------------------------------------------------------------------------------------+ +| *size* | Size of the *nick* buffer. If the parsed nick is larger than the buffer size it will be truncated | ++-------------+-------------------------------------------------------------------------------------------------------------------------+ + +**Description:** + +For most events IRC server returns 'origin' (i.e. the person, who generated this event) in so-called "common" form, like nick!host@domain. +However, all the irc_cmd_* functions require just a nick. This function parses this origin, and retrieves the nick, storing it into the user-provided buffer. + +A buffer of size 128 should be enough for most nicks. + +**Thread safety:** + +This function can be called simultaneously from multiple threads. + + +irc_target_get_host +******************* + +**Prototype:** + +.. c:function:: void irc_target_get_host (const char * target, char *host, size_t size) + +**Parameters:** + ++-------------+-------------------------------------------------------------------------------------------------------------------------+ +| *origin* | Nick in the common IRC server format such as tim!root\@mycomain.com | ++-------------+-------------------------------------------------------------------------------------------------------------------------+ +| *host* | Buffer to retrieve the parsed hostname | ++-------------+-------------------------------------------------------------------------------------------------------------------------+ +| *size* | Size of the *host* buffer. If the parsed nick is larger than the buffer size it will be truncated | ++-------------+-------------------------------------------------------------------------------------------------------------------------+ + +**Description:** + +For most events IRC server returns 'origin' (i.e. the person, who generated this event) in so-called "common" form, like nick!host\@domain. +This function parses this origin, and retrieves the host, storing it into the user-provided buffer. + +**Thread safety:** + +This function can be called simultaneously from multiple threads. + + + +DCC initiating and accepting chat sessions, sending and receiving files +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +irc_dcc_chat +************ + +**Prototype:** + +.. c:function:: int irc_dcc_chat(irc_session_t * session, void * ctx, const char * nick, irc_dcc_callback_t callback, irc_dcc_t * dccid) + +**Parameters:** + ++-------------+-------------------------------------------------------------------------------------------------------------------------+ +| *session* | IRC session handle | ++-------------+-------------------------------------------------------------------------------------------------------------------------+ +| *ctx* | User-defined context which will be passed to the callback. May be NULL | ++-------------+-------------------------------------------------------------------------------------------------------------------------+ +| *nick* | Target nick | ++-------------+-------------------------------------------------------------------------------------------------------------------------+ +| *callback* | DCC callback which will be used for DCC and chat events | ++-------------+-------------------------------------------------------------------------------------------------------------------------+ +| *dccid* | If this function succeeds, the DCC session identifier is stored in this field | ++-------------+-------------------------------------------------------------------------------------------------------------------------+ + +**Description:** + +This function requests a DCC CHAT between you and other IRC user. DCC CHAT is like private chat, but it goes directly between two users, +and bypasses the IRC server. DCC CHAT request must be accepted by other side before you can send anything. + +When the chat is accepted, declined, terminated, or some data is received, the *callback* function is called. To be specific, +the callback will be called when: + + * The chat request is accepted; + * The chat request is denied; + * The new chat message is received; + * The chat is terminated by the remote party; + +See the details in :c:type:`irc_dcc_callback_t` declaration. + +**Return value:** + +Return code 0 means the command was sent to the IRC server successfully. This does not mean the operation succeed, and you need to wait +for the appropriate event or for the error code via :c:member:`event_numeric` event. + +Possible error responces for this command from the RFC1459: + - LIBIRC_RFC_ERR_NORECIPIENT + - LIBIRC_RFC_ERR_NOTEXTTOSEND + - LIBIRC_RFC_ERR_CANNOTSENDTOCHAN + - LIBIRC_RFC_ERR_NOTONCHANNEL + - LIBIRC_RFC_ERR_NOTOPLEVEL + - LIBIRC_RFC_ERR_WILDTOPLEVEL + - LIBIRC_RFC_ERR_TOOMANYTARGETS + - LIBIRC_RFC_ERR_NOSUCHNICK + +**Thread safety:** + +This function can be called simultaneously from multiple threads. + + +irc_dcc_msg +*********** + +**Prototype:** + +.. c:function:: int irc_dcc_msg (irc_session_t * session, irc_dcc_t dccid, const char * text) + +**Parameters:** + ++-------------+-------------------------------------------------------------------------------------------------------------------------+ +| *session* | IRC session handle | ++-------------+-------------------------------------------------------------------------------------------------------------------------+ +| *dccid* | DCC session identifier for the DCC CHAT session which is active | ++-------------+-------------------------------------------------------------------------------------------------------------------------+ +| *text* | NULL-terminated message to send | ++-------------+-------------------------------------------------------------------------------------------------------------------------+ + +**Description:** + +This function is used to send the DCC CHAT message to an active DCC CHAT. To be active, DCC CHAT request must be initiated by one side and accepted by another side. + +**Return value:** + +Return code 0 means success. Other value means error, the error code may be obtained through irc_errno(). + +**Thread safety:** + +This function can be called simultaneously from multiple threads. + + +irc_dcc_accept +************** + +**Prototype:** + +.. c:function:: int irc_dcc_accept (irc_session_t * session, irc_dcc_t dccid, void * ctx, irc_dcc_callback_t callback) + +**Parameters:** + ++-------------+-------------------------------------------------------------------------------------------------------------------------+ +| *session* | IRC session handle | ++-------------+-------------------------------------------------------------------------------------------------------------------------+ +| *dccid* | DCC session identifier returned by the callback | ++-------------+-------------------------------------------------------------------------------------------------------------------------+ +| *ctx* | User-defined context which will be passed to the callback. May be NULL | ++-------------+-------------------------------------------------------------------------------------------------------------------------+ +| *callback* | DCC callback which will be used for DCC and chat events | ++-------------+-------------------------------------------------------------------------------------------------------------------------+ + +**Description:** + +This function accepts a remote DCC chat or file transfer request. After the request is accepted the *callback* will be called for the further DCC events, +including the termination of the DCC session. See the :c:type:`DCC callback information `. + +This function should be called only after either :c:member:`event_dcc_chat_req` or :c:member:`event_dcc_send_req` events are received. You don't have to call irc_dcc_accept() +or irc_dcc_decline() immediately in the event processing function - you may just store the *dccid* and return, and call those functions later. However to +prevent memory leaks you must call either irc_dcc_decline() or irc_dcc_accept() for any incoming DCC request within 60 seconds after receiving it. + +**Return value:** + +Return code 0 means success. Other value means error, the error code may be obtained through :c:func:`irc_errno`. + +**Thread safety:** + +This function can be called simultaneously from multiple threads. + + +irc_dcc_decline +*************** + +**Prototype:** + +.. c:function:: int irc_dcc_decline (irc_session_t * session, irc_dcc_t dccid) + +**Parameters:** + ++-------------+-------------------------------------------------------------------------------------------------------------------------+ +| *session* | IRC session handle | ++-------------+-------------------------------------------------------------------------------------------------------------------------+ +| *dccid* | DCC session identifier returned by the callback | ++-------------+-------------------------------------------------------------------------------------------------------------------------+ + +**Description:** + +This function declines a remote DCC chat or file transfer request. + +This function should be called only after either :c:member:`event_dcc_chat_req` or :c:member:`event_dcc_send_req` events are received. You don't have to call irc_dcc_accept() +or irc_dcc_decline() immediately in the event processing function - you may just store the *dccid* and return, and call those functions later. However to +prevent memory leaks you must call either irc_dcc_decline() or irc_dcc_accept() for any incoming DCC request within 60 seconds after receiving it. + +Do not use this function to forecefully close the previously accepted or initiated DCC session. Use :c:func:`irc_dcc_destroy` instead. + +**Return value:** + +Return code 0 means success. Other value means error, the error code may be obtained through :c:func:`irc_errno`. + +**Thread safety:** + +This function can be called simultaneously from multiple threads. + + +irc_dcc_sendfile +**************** + +**Prototype:** + +.. c:function:: int irc_dcc_sendfile (irc_session_t * session, void * ctx, const char * nick, const char * filename, irc_dcc_callback_t callback, irc_dcc_t * dccid) + +**Parameters:** + ++-------------+-------------------------------------------------------------------------------------------------------------------------+ +| *session* | IRC session handle | ++-------------+-------------------------------------------------------------------------------------------------------------------------+ +| *ctx* | User-defined context which will be passed to the callback. May be NULL | ++-------------+-------------------------------------------------------------------------------------------------------------------------+ +| *nick* | Target nick | ++-------------+-------------------------------------------------------------------------------------------------------------------------+ +| *filename* | Full path to the file which will be sent. Must be an existing file | ++-------------+-------------------------------------------------------------------------------------------------------------------------+ +| *callback* | DCC callback which will be used for DCC and chat events | ++-------------+-------------------------------------------------------------------------------------------------------------------------+ +| *dccid* | If this function succeeds, the DCC session identifier is stored in this field | ++-------------+-------------------------------------------------------------------------------------------------------------------------+ + +**Description:** + +This function generates a DCC SEND request to send the file. When it is accepted, the file is sent to the remote party, and the DCC session is +closed. The send operation progress and result can be checked in the callback. See the :c:type:`DCC callback information `. + +**Return value:** + +Return code 0 means the command was sent to the IRC server successfully. This does not mean the operation succeed, and you need to wait +for the appropriate event or for the error code via :c:member:`event_numeric` event. + +Possible error responces for this command from the RFC1459: + - LIBIRC_RFC_ERR_NORECIPIENT + - LIBIRC_RFC_ERR_NOTEXTTOSEND + - LIBIRC_RFC_ERR_CANNOTSENDTOCHAN + - LIBIRC_RFC_ERR_NOTONCHANNEL + - LIBIRC_RFC_ERR_NOTOPLEVEL + - LIBIRC_RFC_ERR_WILDTOPLEVEL + - LIBIRC_RFC_ERR_TOOMANYTARGETS + - LIBIRC_RFC_ERR_NOSUCHNICK + +**Thread safety:** + +This function can be called simultaneously from multiple threads. + + +irc_dcc_destroy +*************** + +**Prototype:** + +.. c:function:: int irc_dcc_destroy (irc_session_t * session, irc_dcc_t dccid) + +**Parameters:** + ++-------------+-------------------------------------------------------------------------------------------------------------------------+ +| *session* | IRC session handle | ++-------------+-------------------------------------------------------------------------------------------------------------------------+ +| *dccid* | DCC session identifier of a session to destroy | ++-------------+-------------------------------------------------------------------------------------------------------------------------+ + +**Description:** + +This function closes the DCC connection (if available), and destroys the DCC session, freeing the used resources. It can be called anytime, even from callbacks or from different threads. + +Note that when DCC session is finished (either with success or failure), you should not destroy it - it will be destroyed automatically. + +**Return value:** + +Return code 0 means success. Other value means error, the error code may be obtained through :c:func:`irc_errno`. + +**Thread safety:** + +This function can be called simultaneously from multiple threads. + + + +Handling the colored messages +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + +irc_color_strip_from_mirc +************************* + +**Prototype:** + +.. c:function:: char * irc_color_strip_from_mirc (const char * message) + +**Parameters:** + ++-------------+-------------------------------------------------------------------------------------------------------------------------+ +| *message* | Original message with colors | ++-------------+-------------------------------------------------------------------------------------------------------------------------+ + +**Description:** + +This function strips all the ANSI color codes from the message, and returns a new message with no color information. Useful for the bots which react to strings, +to make sure the bot is not confused if the string uses colors. + +This function does not modify the message which doesn't use colors. + +**Return value:** + +Returns a new message with stripped color codes. Note that the memory for the new message is allocated using malloc(), so you should free +it using free() when it is not used anymore. If memory allocation failed, returns 0. + +**Thread safety:** + +This function can be called simultaneously from multiple threads. + + +irc_color_convert_from_mirc +*************************** + +**Prototype:** + +.. c:function:: char * irc_color_convert_from_mirc (const char * message) + +**Parameters:** + ++-------------+-------------------------------------------------------------------------------------------------------------------------+ +| *message* | Original message with colors | ++-------------+-------------------------------------------------------------------------------------------------------------------------+ + +**Description:** + +This function converts all the color codes and format options to libircclient internal colors. + +**Return value:** + +Returns a pointer to the new message with converted ANSI color codes and format options. See the irc_color_convert_to_mirc_ help for details. + +Note that the memory for the new message is allocated using malloc(), so you should free it using free() when it is not used anymore. +If memory allocation failed, returns 0. + +**Thread safety:** + +This function can be called simultaneously from multiple threads. + + +irc_color_convert_to_mirc +************************* + +**Prototype:** + +.. c:function:: char * irc_color_convert_to_mirc (const char * message) + +**Parameters:** + ++-------------+-------------------------------------------------------------------------------------------------------------------------+ +| *message* | Original message with colors | ++-------------+-------------------------------------------------------------------------------------------------------------------------+ + +**Description:** + +This function converts all the color codes and format options from internal libircclient colors to ANSI used by mIRC and other IRC clients. + +**Return value:** + +Returns a new message with converted color codes and format options, or 0 if memory could not be allocated. Note that the memory for the +new message is allocated using malloc(), so you should free it using free() when it is not used anymore. + +**Thread safety:** + +This function can be called simultaneously from multiple threads. + +The color system of libircclient is designed to be easy to use, and portable between different IRC clients. Every color or format option +is described using plain text commands written between square brackets. + +The possible codes are: + - [B] ... [/B] - bold format mode. Everything between [B] and [/B] is written in **bold**. + - [I] ... [/I] - italic/reverse format mode. Everything between [I] and [/I] is written in *italic*, or reversed (however, because some clients are incapable of rendering italic text, most clients display this as normal text with the background and foreground colors swapped). + - [U] ... [/U] - underline format mode. Everything between [U] and [/U] is written underlined. + - [COLOR=RED] ... [/COLOR] - write the text using specified foreground color. The color is set by using the COLOR keyword, and equal sign followed by text color code (see below). + - [COLOR=RED/BLUE] ... [/COLOR] - write the text using specified foreground and background color. The color is set by using the COLOR keyword, an equal sign followed by text foreground color code, a dash and a text background color code. + +The following colors are supported: + - WHITE + - BLACK + - DARKBLUE + - DARKGREEN + - RED + - BROWN + - PURPLE + - OLIVE + - YELLOW + - GREEN + - TEAL + - CYAN + - BLUE + - MAGENTA + - DARKGRAY + - LIGHTGRAY + +Examples of color sequences: +:: + + Hello, [B]Tim[/B]. + [U]Arsenal[/U] got a [COLOR=RED]red card[/COLOR] + The tree[U]s[/U] are [COLOR=GREEN/BLACK]green[/COLOR] + + + +Changing the library options +^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +irc_get_version +*************** + +**Prototype:** + +.. c:function:: void irc_get_version (unsigned int * high, unsigned int * low) + +**Parameters:** + ++-------------+-------------------------------------------------------------------------------------------------------------------------+ +| *high* | Stores the high version number | ++-------------+-------------------------------------------------------------------------------------------------------------------------+ +| *low* | Stores the low version number | ++-------------+-------------------------------------------------------------------------------------------------------------------------+ + +**Description:** + +This function returns the libircclient version. You can use the version either to check whether required options are available, or to output the version. +The preferred printf-like format string to output the version is: + +``printf ("Version: %d.%02d", high, low);`` + +**Thread safety:** + +This function can be called simultaneously from multiple threads. + + +irc_set_ctx +*********** + +**Prototype:** + +.. c:function:: void irc_set_ctx (irc_session_t * session, void * ctx) + +**Parameters:** + ++-------------+-------------------------------------------------------------------------------------------------------------------------+ +| *session* | IRC session handle | ++-------------+-------------------------------------------------------------------------------------------------------------------------+ +| *ctx* | User-defined context | ++-------------+-------------------------------------------------------------------------------------------------------------------------+ + +**Description:** + +This function sets the user-defined context for this IRC session. This context is not used by libircclient. Its purpose is to store session-specific +user data, which may be obtained later by calling irc_get_ctx_. Note that libircclient just carries out this pointer. If you allocate some memory, +and store its address in ctx (most common usage), it is your responsibility to free it before calling :c:func:`irc_destroy_session`. + +**Thread safety:** + +This function can be called simultaneously from multiple threads. + + +irc_get_ctx +*********** + +**Prototype:** + +.. c:function:: void * irc_get_ctx (irc_session_t * session) + +**Parameters:** + ++-------------+-------------------------------------------------------------------------------------------------------------------------+ +| *session* | IRC session handle | ++-------------+-------------------------------------------------------------------------------------------------------------------------+ + +**Description:** + +This function returns the IRC session context, which was set by irc_set_ctx_. + +**Return value:** + +If no context was set, this function returns NULL. + +**Thread safety:** + +This function can be called simultaneously from multiple threads. + + +irc_option_set +************** + +**Prototype:** + +.. c:function:: void irc_option_set (irc_session_t * session, unsigned int option) + +**Parameters:** + ++-------------+-------------------------------------------------------------------------------------------------------------------------+ +| *session* | IRC session handle | ++-------------+-------------------------------------------------------------------------------------------------------------------------+ +| *option* | One of the :ref:`Libirc options ` to set | ++-------------+-------------------------------------------------------------------------------------------------------------------------+ + +**Description:** + +This function sets the libircclient option, changing libircclient behavior. See the :ref:`options ` list for the meaning for every option. + +**Thread safety:** + +This function can be called simultaneously from multiple threads. + + +irc_option_reset +**************** + +**Prototype:** + +.. c:function:: void irc_option_reset (irc_session_t * session, unsigned int option) + +**Parameters:** + ++-------------+-------------------------------------------------------------------------------------------------------------------------+ +| *session* | IRC session handle | ++-------------+-------------------------------------------------------------------------------------------------------------------------+ +| *option* | One of the :ref:`Libirc options ` to set | ++-------------+-------------------------------------------------------------------------------------------------------------------------+ + +**Description:** + +This function resets the libircclient option, changing libircclient behavior. See the :ref:`options ` list for the meaning for every option. + +**Thread safety:** + +This function can be called simultaneously from multiple threads. + + +Handling the errors +^^^^^^^^^^^^^^^^^^^ + +irc_errno +********* + +**Prototype:** + +.. c:function:: int irc_errno (irc_session_t * session) + +**Parameters:** + ++-------------+-------------------------------------------------------------------------------------------------------------------------+ +| *session* | IRC session handle | ++-------------+-------------------------------------------------------------------------------------------------------------------------+ + +**Description:** + +This function returns the last error code associated with last operation of this IRC session. Possible error codes are defined in libirc_errors.h + +As usual, typical errno rules apply: + + - irc_errno() should be called ONLY if the called function fails; + - irc_errno() doesn't return 0 if function succeed; actually, the return value will be undefined. + - you should call irc_errno() IMMEDIATELY after function fails, before calling any other libircclient function. + +**Return value:** + +The error code. + +**Thread safety:** + +This function can be called simultaneously from multiple threads. Local error code is per IRC context, not per thread. + + +irc_strerror +************ + +**Prototype:** + +.. c:function:: const char * irc_strerror (int ircerrno) + +**Parameters:** + ++-------------+-------------------------------------------------------------------------------------------------------------------------+ +| *ircerrno* | IRC error code returned by :c:func:`irc_errno` | ++-------------+-------------------------------------------------------------------------------------------------------------------------+ + +**Description:** + +This function returns the text representation of the given error code. + +**Return value:** + +Returns an internal English string with a short description of the error code. + +**Thread safety:** + +This function can be called simultaneously from multiple threads. diff --git a/libircclient/doc/sources/API_reference_types.rst b/libircclient/doc/sources/API_reference_types.rst new file mode 100644 index 0000000..c1b2add --- /dev/null +++ b/libircclient/doc/sources/API_reference_types.rst @@ -0,0 +1,365 @@ + +Types +~~~~~ + +This section describes various types defined by the library. + +irc_session_t +^^^^^^^^^^^^^ + +.. c:type:: typedef struct irc_session_s irc_session_t + +The IRC session handle created by callind :c:func:`irc_create_session`. Most of the library function calls expect this handle as a parameter. You can create as many handles as you want. +Each handle could be used to establish a single IRC connection to an IRC server as a single user. + +Once the handle is not used anymore, it should be destroyed by calling :c:func:`irc_destroy_session`. + + +irc_dcc_session_t +^^^^^^^^^^^^^^^^^ + +.. c:type:: typedef struct irc_dcc_session_s irc_dcc_session_t + +This structure describes a DCC session used by libircclient. Its members are internal to libircclient, and should not be used directly. + + +irc_dcc_t +^^^^^^^^^ + +.. c:type:: typedef unsigned int irc_dcc_t + +This type is a DCC session identifier, used to identify the DCC sessions in callbacks and various functions. + + +irc_callbacks_t +^^^^^^^^^^^^^^^ + +.. c:type:: typedef struct irc_callbacks_t + +:: + + typedef struct + { + irc_event_callback_t event_connect; + irc_event_callback_t event_nick; + irc_event_callback_t event_quit; + irc_event_callback_t event_join; + irc_event_callback_t event_part; + irc_event_callback_t event_mode; + irc_event_callback_t event_umode; + irc_event_callback_t event_topic; + irc_event_callback_t event_kick; + irc_event_callback_t event_channel; + irc_event_callback_t event_privmsg; + irc_event_callback_t event_notice; + irc_event_callback_t event_channel_notice; + irc_event_callback_t event_invite; + irc_event_callback_t event_ctcp_req; + irc_event_callback_t event_ctcp_rep; + irc_event_callback_t event_ctcp_action; + irc_event_callback_t event_unknown; + irc_eventcode_callback_t event_numeric; + irc_event_dcc_chat_t event_dcc_chat_req; + irc_event_dcc_send_t event_dcc_send_req; + } + +Describes the event callbacks structure which is used in registering the callbacks. + +All the communication with the IRC network is based on events. Generally speaking, event is anything generated by someone else in the network, or by the IRC server itself. +"Someone sends you a message", "Someone has joined the channel", "Someone has quits IRC" - all these messages are events. + +Every event has its own event handler, which is called when the appropriate event is received. +You don't have to define all the event handlers; define only the handlers for the events you need to intercept, and set the remaining handler pointers to NULL. + +.. c:member:: event_connect + +This event is triggered when the connection to the IRC server is successfully established, and the MOTD is received. Depending on the server it may also be possible to send the commands before this event. + +This event uses :c:type:`irc_event_callback_t` callback with the following values: + ++-------------+------------------------------------------------------------------+ +| *origin* | Unused, set to NULL | ++-------------+------------------------------------------------------------------+ +| *params* | Unused, set to NULL | ++-------------+------------------------------------------------------------------+ + + +.. c:member:: event_nick + +This event is triggered when the NICK message is received. It happens when one of the users (including you) in one of the channels you are watching (have joined) changed their nick. + +Changing your own nick will also generate this event. Note that the server may change your nick independently, so you must track this event. + +This event uses :c:type:`irc_event_callback_t` callback with the following values: + ++-------------+------------------------------------------------------------------+ +| *origin* | The original nick (may be yours!) | ++-------------+------------------------------------------------------------------+ +| *params* | params[0] contains a new nick. | ++-------------+------------------------------------------------------------------+ + +.. c:member:: event_quit + +This event is triggered when the QUIT message is received. It happens when one of the users in one of the channels you are watching (have joined) disconnected from the IRC server. + +This event uses :c:type:`irc_event_callback_t` callback with the following values: + ++-------------+-------------------------------------------------------------------+ +| *origin* | The user who disconnected | ++-------------+-------------------------------------------------------------------+ +| *params* | params[0] is optional, contains the user-specified reason to quit | ++-------------+-------------------------------------------------------------------+ + + +.. c:member:: event_join + +This event is triggered upon receipt of a JOIN message. It happens when a new user joins the channel you are watching (have joined). It also happens when you joined the new channel. + +Note that you may be "forced" to join the channel (and therefore receive this event) without issuing the JOIN command. A typical case is when the NickServ bot on the server is configured to auto-join you to specific channels. + +This event uses :c:type:`irc_event_callback_t` callback with the following values: + ++-------------+-------------------------------------------------------------------+ +| *origin* | The user who joined the channel (this may be you!) | ++-------------+-------------------------------------------------------------------+ +| *params* | params[0] contains the channel name | ++-------------+-------------------------------------------------------------------+ + + +.. c:member:: event_part + +This event is triggered upon receipt of a PART message. It happens when a user leaves the channel you are watching (have joined). It also happens when you leave a channel. + +This event uses :c:type:`irc_event_callback_t` callback with the following values: + ++-------------+-------------------------------------------------------------------+ +| *origin* | The user who left the channel (this may be you!) | ++-------------+-------------------------------------------------------------------+ +| *params* | params[0] contains the channel name | +| | params[1] is optional and contains the user-specified reason | ++-------------+-------------------------------------------------------------------+ + + +.. c:member:: event_mode + +This event is triggered upon receipt of a channel MODE message. It happens when someone changed the mode(s) of the channel you are watching (have joined). + +This event uses :c:type:`irc_event_callback_t` callback with the following values: + ++-------------+-------------------------------------------------------------------+ +| *origin* | The user who performed the change | ++-------------+-------------------------------------------------------------------+ +| *params* | params[0] contains the channel name | +| | params[1] contains the channel mode changes, such as "+t", "-i" | +| | params[2] optional, contains the argument for the channel mode | +| | (for example, a nick for the +o mode) | ++-------------+-------------------------------------------------------------------+ + + +.. c:member:: event_umode + +This event is triggered upon receipt of a user MODE message. It happens when your user mode is changed. + +This event uses :c:type:`irc_event_callback_t` callback with the following values: + ++-------------+-------------------------------------------------------------------+ +| *origin* | The user who performed the change | ++-------------+-------------------------------------------------------------------+ +| *params* | params[0] contains the channel name | +| | params[1] contains the user mode changes, such as "+t", "-i" | ++-------------+-------------------------------------------------------------------+ + + +.. c:member:: event_topic + +This event is triggered upon receipt of a TOPIC message. It happens when someone changed the topic on the channel you are watching (have joined). + +This event uses :c:type:`irc_event_callback_t` callback with the following values: + ++-------------+-------------------------------------------------------------------+ +| *origin* | The user who performed the change | ++-------------+-------------------------------------------------------------------+ +| *params* | params[0] contains the channel name | +| | params[1] optional, contains the new topic | ++-------------+-------------------------------------------------------------------+ + + +.. c:member:: event_kick + +This event is triggered upon receipt of a KICK message. It happens when someone (including you) kicked someone (including you) from the channel you are watching (have joined). + +It is possible to kick yourself from the channel. + +This event uses :c:type:`irc_event_callback_t` callback with the following values: + ++-------------+-------------------------------------------------------------------+ +| *origin* | The user who performed the action (may be you) | ++-------------+-------------------------------------------------------------------+ +| *params* | params[0] contains the channel name | +| | params[1] optional, contains the nick of the kicked | +| | params[2] optional, contains the reason for the kick | ++-------------+-------------------------------------------------------------------+ + + +.. c:member:: event_channel + +This event is triggered upon receipt of a PRIVMSG message sent to the channel. It happens when someone (but not you) sent a message to the channel you are watching (have joined). + +Your own messages do not trigger this event. However the server can still "force" you to send a message to the channel by generating this event. + +This event uses :c:type:`irc_event_callback_t` callback with the following values: + ++-------------+-------------------------------------------------------------------+ +| *origin* | The user who sent a message | ++-------------+-------------------------------------------------------------------+ +| *params* | params[0] contains the channel name | +| | params[1] optional, contains the message text | ++-------------+-------------------------------------------------------------------+ + + +.. c:member:: event_privmsg + +This event is triggered upon receipt of a PRIVMSG message sent privately to you. It happens when someone sent you a message. + +This event uses :c:type:`irc_event_callback_t` callback with the following values: + ++-------------+-------------------------------------------------------------------+ +| *origin* | The user who sent a message | ++-------------+-------------------------------------------------------------------+ +| *params* | params[0] contains your nick | +| | params[1] optional, contains the message text | ++-------------+-------------------------------------------------------------------+ + + +.. c:member:: event_notice + +This event is triggered upon receipt of a NOTICE message. This message is similar to PRIVMSG and matches the event_privmsg_. +According to RFC 1459, the only difference between NOTICE and PRIVMSG is that you should NEVER automatically reply to NOTICE messages. +Unfortunately, this rule is frequently violated by IRC servers itself - for example, NICKSERV messages require reply, and are sent as NOTICE. + +This event uses :c:type:`irc_event_callback_t` callback with the following values: + ++-------------+-------------------------------------------------------------------+ +| *origin* | The user who sent a message | ++-------------+-------------------------------------------------------------------+ +| *params* | params[0] contains the target nick name | +| | params[1] optional, contains the message text | ++-------------+-------------------------------------------------------------------+ + + +.. c:member:: event_channel_notice + +This event is triggered upon receipt of a NOTICE message. This message is similar to PRIVMSG and matches the event_channel_. +According to RFC 1459, the only difference between NOTICE and PRIVMSG is that you should NEVER automatically reply to NOTICE messages. +Unfortunately, this rule is frequently violated by IRC servers itself - for example, NICKSERV messages require reply, and are sent as NOTICE. + +This event uses :c:type:`irc_event_callback_t` callback with the following values: + ++-------------+-------------------------------------------------------------------+ +| *origin* | The user who sent a message | ++-------------+-------------------------------------------------------------------+ +| *params* | params[0] contains the channel name | +| | params[1] optional, contains the message text | ++-------------+-------------------------------------------------------------------+ + + +.. c:member:: event_invite + +This event is triggered upon receipt of an INVITE message. It happens when someone invited you to a channel which has +i (invite-only) mode. + +This event uses :c:type:`irc_event_callback_t` callback with the following values: + ++-------------+-------------------------------------------------------------------+ +| *origin* | The user who invited you | ++-------------+-------------------------------------------------------------------+ +| *params* | params[0] contains your nick | +| | params[1] optional, contains the channel name | ++-------------+-------------------------------------------------------------------+ + +See also: :c:func:`irc_cmd_invite` + + +.. c:member:: event_ctcp_req + +This event is triggered upon receipt of an CTCP request. By default, the built-in CTCP request handler is used. + +Mirc generates *PING*, *FINGER*, *VERSION*, *TIME* and *ACTION* messages which are automatically handled by the library if this event is not handled by your application. Those messages are replied automatically +except the ACTION message which triggers event_ctcp_action_ event. +If you need to handle more types of the message, define this event handler, and check the source code of ``libirc_event_ctcp_internal`` function to see how to write your own CTCP request handler. +Note that you must support at least CTCP PING to pass the spoof check by some IRC servers. + +Also you may find useful this question in FAQ: \ref faq4 + +This event uses :c:type:`irc_event_callback_t` callback with the following values: + ++-------------+-------------------------------------------------------------------+ +| *origin* | The user who generated the message | ++-------------+-------------------------------------------------------------------+ +| *params* | params[0] contains the complete CTCP message | ++-------------+-------------------------------------------------------------------+ + + +.. c:member:: event_ctcp_rep + +This event is triggered upon receipt of an CTCP response. Thus if you generate the CTCP message and the remote user responded, this event handler will be called. + +This event uses :c:type:`irc_event_callback_t` callback with the following values: + ++-------------+-------------------------------------------------------------------+ +| *origin* | The user who generated the message | ++-------------+-------------------------------------------------------------------+ +| *params* | params[0] contains the complete CTCP message | ++-------------+-------------------------------------------------------------------+ + + +.. c:member:: event_ctcp_action + +This event is triggered upon receipt of an CTCP ACTION message. It is only invoked if you did not define the event_ctcp_req_ event handler. + +Such messages typically look like that in the IRC client: + +:: + [08:32:55] * Michael is having fun + [08:32:55] * Bobby's getting jealous + +This event uses :c:type:`irc_event_callback_t` callback with the following values: + ++-------------+-------------------------------------------------------------------+ +| *origin* | The user who generated the message | ++-------------+-------------------------------------------------------------------+ +| *params* | params[0] contains the content of ACTION message | ++-------------+-------------------------------------------------------------------+ + + +.. c:member:: event_unknown + +This event is triggered upon receipt of an unknown message which is not handled by the library. + +This event uses :c:type:`irc_event_callback_t` callback with the following values: + ++-------------+-------------------------------------------------------------------+ +| *origin* | The user who generated the event | ++-------------+-------------------------------------------------------------------+ +| *params* | Zero or more parameters provided with the event | ++-------------+-------------------------------------------------------------------+ + + +.. c:member:: event_numeric + +This event is triggered upon receipt of every numeric message from the server. The incomplete list of those responses could be found in RFC 1429. This event is necessary to handle for any meaningful client. + +This event uses the dedicated irc_eventcode_callback_t_ callback. See the callback documentation. + + +.. c:member:: event_dcc_chat_req + +This event is triggered when someone attempts to establish the DCC CHAT with you. + +This event uses the dedicated :c:type:`irc_event_dcc_chat_t` callback. See the callback documentation. + + +.. c:member:: event_dcc_send_req + +This event is triggered when someone attempts to send you the file via DCC SEND. + +This event uses the dedicated :c:type:`irc_event_dcc_send_t` callback. See the callback documentation. diff --git a/libircclient/doc/sources/Appendix_FAQ.rst b/libircclient/doc/sources/Appendix_FAQ.rst new file mode 100644 index 0000000..a2b575f --- /dev/null +++ b/libircclient/doc/sources/Appendix_FAQ.rst @@ -0,0 +1,134 @@ + +Frequently asked questions +~~~~~~~~~~~~~~~~~~~~~~~~~~ + +.. _faq_err_socket: + +Why do I get a LIBIRC_ERR_SOCKET error under Win32 when using a static library? +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Because on Win32 you have to initialize the Winsock API before using it: + +.. sourcecode:: c + + WSADATA wsaData; + + if ( WSAStartup ( MAKEWORD (2, 2), &wsaData) != 0 ) + // report an error + + // Now you can use libircclient + + +You have to do it ONCE in your application, and since libircclient does not know whether you already initialized it or not, it does not contain any Winsock initialization code. + + +What does it mean that the IRC protocol is event-based? +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +The IRC protocol itself is asynchronous and server-driven. For you, this means the following: + + - For any IRC command, it is not possible to obtain an immediate response whether the command succeed + or not. Instead the server will send the reply in a short (or long) period of time. + + - For some IRC command there is no ‘success’ response at all. For example, when you send a text + message, IRC server will not send anything to confirm that the message is already sent. + + - You can send several commands to the IRC server, and then receive several replies regarding every + command. The order of the replies you receive is generally undefined. + + - A lot of IRC events sent to you is generated by other users, or the IRC server itself, and are + sent to you just when they are generated. + + - Long lists (for example, channel lists) are also sent as events. Moreover, these events could be + separated by other events (message or notices). And it is your responsibility to separate the data + (using event codes), and use some sort of data structure that will hold it until the data is complete. + It is not possible to simply query the list of channels, and expect that its content will immediately arrive. + + - You may send the request, and not receive a response in case of success (such as when you send a message). + You may send the request and it will only succeed when you receive a response (which may be after you receive + ten more unrelated events). Or you can receive a response without even sending a request, as it is the case + with JOIN - it is possible for the server to JOIN you to a specific channel implicitly. + + - You should be prepared to expect the unexpected from the IRC server. For example, the server can change your + nick (seen on most servers, which use nickserv authentication. You can be “forced” to join the channel, to + say something, to leave a channel, to change your usermode and so on. Listen what IRC server tells you, and do so. + + +Why the irc_cmd_join function does not return an error? +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +A typical example is the :c:func:`irc_cmd_join` call always returns success even when you attempt to join a password-protected +channel. Then some time later the IRC server returns an error. This is because the irc_cmd family of functions return +success when the command is sent to the IRC server. The asynchronous nature of IRC makes it impossible to obtain the +command result immediately. Please read the question above. + + +How to register/auth with NICKSERV? +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +There is no ‘standard’ way. NICKSERV, CHANSERV and so on are not specified by the RFC. They are IRC extensions which +behave exactly like the other IRC users but with more power. Typically their messages are sent via Notice events, so +you can use following algorithm to handle Nickserv registration: + +.. sourcecode:: c + + static void event_notice (irc_session_t * session, const char * event, + const char * origin, const char ** params, unsigned int count) + { + char buf[256]; + + if ( !origin ) + return; + + if ( strcasecmp (origin, "nickserv") ) + return; + + if ( strstr (params[1], "This nick is not registered") == params[1] ) + { + sprintf (buf, "REGISTER %s NOMAIL", gCfg.irc_nickserv_password); + irc_cmd_msg(session, "nickserv", buf); + } + else if ( strstr (params[1], "This nickname is registered and protected") == params[1] ) + { + sprintf (buf, "IDENTIFY %s", gCfg.irc_nickserv_password); + irc_cmd_msg(session, "nickserv", buf); + } + else if ( strstr (params[1], "Password accepted - you are now recognized") == params[1] ) + printf ("Nickserv authentication succeed."); + } + +The idea is to parse the messages sent from NICKSERV, and if they’re matched the specific patterns, react on them appropriately. + +What is CTCP? +^^^^^^^^^^^^^ + +CTCP abbreviature is deciphered as “Client-to-Client Protocol”. It is used between the IRC clients to query the +remote client for some data, or to send some information – for example, /me messages are sent via CTCP. + +There is no standard list of possible CTCP requests, and different IRC clients often add their own CTCP codes. +The built-in handler reacts on TIME, VERSION, PING and FINGER CTCP queries. If you need to react on other requests, +you’ll have to write your own CTCP handler. See the source code of libirc_event_ctcp_internal function to get an +idea how to write it. + + +When I am made a chanop (+o) why do I not receive the event_umode? +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Becoming a channel operator channes the **channel mode**, not user mode. Therefore you will receive :c:member:`event_mode` and not :c:member:`event_umode` + +If you receive the event_umode with +o this means your user is an IRC server operator. + + +.. _faq_epoll: + +What if my application uses epoll? +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +The library only directly supports the select()-based loops for historic reasons, so epoll and other polling methods are not supported directly by the library. +However but if necessart, it could be emulated by converting descriptors between select and epoll as following: + * Call irc_add_select_descriptors with an empty FD_SET + * Extract the descriptors from the fd_set arrays (remember fd_array is a bitarray, not the value array). There may be more than one descriptor in case there are DCC sessions. + * Pass those descriptors to poll/epoll using relevant events (i.e. use the EPOLLIN for the descriptors in the *in_set*) + * For those descriptors which triggered the events, fill up the relevant in_set and out_set structures (again, remember the bitmasks!) and pass them to :c:func:`irc_process_select_descriptors` + +While this is cumbersome, the operations are very simple (basically bitmask operations on a small structure) and will not add any significant slowdown to your application. diff --git a/libircclient/doc/sources/Appendix_LGPL.rst b/libircclient/doc/sources/Appendix_LGPL.rst new file mode 100644 index 0000000..e5ea0ad --- /dev/null +++ b/libircclient/doc/sources/Appendix_LGPL.rst @@ -0,0 +1,68 @@ + +GNU LESSER GENERAL PUBLIC LICENSE +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Version 3, 29 June 2007 + +Copyright © 2007 Free Software Foundation, Inc. + +Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. + +This version of the GNU Lesser General Public License incorporates the terms and conditions of version 3 of the GNU General Public License, supplemented by the additional permissions listed below. + +0. Additional Definitions. + +As used herein, “this License” refers to version 3 of the GNU Lesser General Public License, and the “GNU GPL” refers to version 3 of the GNU General Public License. + +“The Library” refers to a covered work governed by this License, other than an Application or a Combined Work as defined below. + +An “Application” is any work that makes use of an interface provided by the Library, but which is not otherwise based on the Library. Defining a subclass of a class defined by the Library is deemed a mode of using an interface provided by the Library. + +A “Combined Work” is a work produced by combining or linking an Application with the Library. The particular version of the Library with which the Combined Work was made is also called the “Linked Version”. + +The “Minimal Corresponding Source” for a Combined Work means the Corresponding Source for the Combined Work, excluding any source code for portions of the Combined Work that, considered in isolation, are based on the Application, and not on the Linked Version. + +The “Corresponding Application Code” for a Combined Work means the object code and/or source code for the Application, including any data and utility programs needed for reproducing the Combined Work from the Application, but excluding the System Libraries of the Combined Work. +1. Exception to Section 3 of the GNU GPL. + +You may convey a covered work under sections 3 and 4 of this License without being bound by section 3 of the GNU GPL. +2. Conveying Modified Versions. + +If you modify a copy of the Library, and, in your modifications, a facility refers to a function or data to be supplied by an Application that uses the facility (other than as an argument passed when the facility is invoked), then you may convey a copy of the modified version: + + a) under this License, provided that you make a good faith effort to ensure that, in the event an Application does not supply the function or data, the facility still operates, and performs whatever part of its purpose remains meaningful, or + b) under the GNU GPL, with none of the additional permissions of this License applicable to that copy. + +3. Object Code Incorporating Material from Library Header Files. + +The object code form of an Application may incorporate material from a header file that is part of the Library. You may convey such object code under terms of your choice, provided that, if the incorporated material is not limited to numerical parameters, data structure layouts and accessors, or small macros, inline functions and templates (ten or fewer lines in length), you do both of the following: + + a) Give prominent notice with each copy of the object code that the Library is used in it and that the Library and its use are covered by this License. + b) Accompany the object code with a copy of the GNU GPL and this license document. + +4. Combined Works. + +You may convey a Combined Work under terms of your choice that, taken together, effectively do not restrict modification of the portions of the Library contained in the Combined Work and reverse engineering for debugging such modifications, if you also do each of the following: + + a) Give prominent notice with each copy of the Combined Work that the Library is used in it and that the Library and its use are covered by this License. + b) Accompany the Combined Work with a copy of the GNU GPL and this license document. + c) For a Combined Work that displays copyright notices during execution, include the copyright notice for the Library among these notices, as well as a reference directing the user to the copies of the GNU GPL and this license document. + d) Do one of the following: + 0) Convey the Minimal Corresponding Source under the terms of this License, and the Corresponding Application Code in a form suitable for, and under terms that permit, the user to recombine or relink the Application with a modified version of the Linked Version to produce a modified Combined Work, in the manner specified by section 6 of the GNU GPL for conveying Corresponding Source. + 1) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (a) uses at run time a copy of the Library already present on the user's computer system, and (b) will operate properly with a modified version of the Library that is interface-compatible with the Linked Version. + e) Provide Installation Information, but only if you would otherwise be required to provide such information under section 6 of the GNU GPL, and only to the extent that such information is necessary to install and execute a modified version of the Combined Work produced by recombining or relinking the Application with a modified version of the Linked Version. (If you use option 4d0, the Installation Information must accompany the Minimal Corresponding Source and Corresponding Application Code. If you use option 4d1, you must provide the Installation Information in the manner specified by section 6 of the GNU GPL for conveying Corresponding Source.) + +5. Combined Libraries. + +You may place library facilities that are a work based on the Library side by side in a single library together with other library facilities that are not Applications and are not covered by this License, and convey such a combined library under terms of your choice, if you do both of the following: + + a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities, conveyed under the terms of this License. + b) Give prominent notice with the combined library that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. + +6. Revised Versions of the GNU Lesser General Public License. + +The Free Software Foundation may publish revised and/or new versions of the GNU Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Library as you received it specifies that a certain numbered version of the GNU Lesser General Public License “or any later version” applies to it, you have the option of following the terms and conditions either of that published version or of any later version published by the Free Software Foundation. If the Library as you received it does not specify a version number of the GNU Lesser General Public License, you may choose any version of the GNU Lesser General Public License ever published by the Free Software Foundation. + +If the Library as you received it specifies that a proxy can decide whether future versions of the GNU Lesser General Public License shall apply, that proxy's public statement of acceptance of any version is permanent authorization for you to choose that version for the Library. diff --git a/libircclient/doc/sources/Introduction.rst b/libircclient/doc/sources/Introduction.rst new file mode 100644 index 0000000..187dd5d --- /dev/null +++ b/libircclient/doc/sources/Introduction.rst @@ -0,0 +1,58 @@ +===================== +Introduction +===================== + +Overview +~~~~~~~~ + +Libircclient is a small but extremely powerful library which implements the client IRC protocol. It is designed to be small, fast, portable and compatible +with the RFC standards as well as non-standard but popular features. It is perfect for building the IRC clients and bots. + + +Features +~~~~~~~~ + - Comprehensive C API; + - Full coverage of the IRC protocol using providing functions; + - Supports multiple simultaneous connection to different IRC servers or even to the same server; + - Supports both plain and SSL connections to the IRC servers with the optional certificate check; + - Full multi-threading support, the library is thread-safe; + - All the processing could be handled by a single thread even if multiple connections are used; + - Non-blocking, asynchronous event-based interface implemented with callbacks; + - Extra support for the socket-based applications, which use select(); + - CTCP support with optional build-in reply code; + - Supports CTCP PING necessary to pass the “spoof check” implemented by most IRC servers; + - Flexible DCC support, including both DCC chat, and DCC file transfer; + - Can both initiate and react to initiated DCC; + - Can accept or decline DCC sessions asynchronously; + - Written in plain C, very small binary size (around 30K depending on platform); + - Compatible all tested IRC clients; + - Free software licensed under the LGPLv3 license; + - Supports Linux as well as any POSIX-compliant Unix, Mac OS X and Microsoft Windows; + - Supports 32/64bit architectures as well as non-x86 architectures; + - IPv6 support (optional, must be compiled in); + - OpenSSL support (optional, must be compiled in); + - Cocoa interface by Nathan Ollerenshaw; + - Comprehensive documentation, examples and the FAQ; + + +Known issues +~~~~~~~~~~~~ + +Even though possible by using multiple sessions, the library is not suitable to connect to a large number of IRC servers simultaneously. If you still want to use it, you'd have to overcome the following: + + - You cannot use the main loop in :c:func:`irc_run` because it only supports one session. You would have to use :c:func:`irc_add_select_descriptors` + - You'd have to handle reconnections separately by processing the relevant :c:func:`irc_process_select_descriptors` return values + - If you wish to use poll/epoll() instead of select() you'd have to write more logic as it is not directly supported. See the :ref:`FAQ `. + - The library is not optimized to have a low per-connection memory footprint, each non-SSL connection uses at least 4K, with around 32K per connection for SSL. + + +Author +~~~~~~ + +This library is created by George Yunaev, copyright 2004-2016. Please see http://www.ulduzsoft.com/linux/libircclient + + +License +~~~~~~~ + +Libircclient is licensed under Lesser General Public License version 3 or higher. The complete license text is provided in the Appendix. diff --git a/libircclient/doc/sources/Writing_code.rst b/libircclient/doc/sources/Writing_code.rst new file mode 100644 index 0000000..bcc11db --- /dev/null +++ b/libircclient/doc/sources/Writing_code.rst @@ -0,0 +1,608 @@ +===================== +Integration +===================== + + +Requirements +~~~~~~~~~~~~ + +Supported operating systems and compilers +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +The library has been extensively tested on Linux x86 and x86_64. It has also been tested on Solaris x86, Linux on ARM and Linux on MIPS platforms, on Mac OS X on x86 and on various versions of Microsoft Windows. + +Compilation +^^^^^^^^^^^ + +On Linux, FreeBSD and Mac OS X the library has to be compiled and installed before use unless you use a precompiled package provided by your operating system distribution. If it is provided, you are recommended to use it as it would be updated +from the central repository when the bugs are fixed. + +On Microsoft Windows the official library binaries are provided, so you do not have to build it. Unless you have experience building with Cygwin, you're advised not to build from source and use the official binary. + +Required libraries +****************** + +The library depends only on libc (glibc-devel on Linux) and gcc, although the examples require also libstdc++ (libstdc++-devel) and g++. Minimum supported version is glibc 2.2, +although if IPv6 is requested, at least glibc 2.4 is required. + +If the library is built with SSL support, the openssl development package (openssl-devel) needs to be installed. + +On Microsoft Windows the Cygwin with necessary development packages must be installed (and openssl-devel as well). + +Compiling +********* + +The library is configured and built the standard Unix way: + +:: + + ./configure [--enable-openssl] [--enable-ipv6] + make + +Installing +********** + +Although no install is necessary to use the libraries, the install target is provided for convenience and could be invoked via ``sudo make install`` + + +Linking +^^^^^^^ + +Link your application with either libircclient.a or libircclient.so depending on your needs. If you use the system-provided library, please link with libircclient.so. + +If you have built the library with SSL support, you will need to link with OpenSSL libraries; add ``-lcrypto -lssl`` to your LDFLAGS + +On Microsoft Windows please link with libircclient.lib which implicitly links with libircclient.dll + + +Coding +~~~~~~ + +Initialization +^^^^^^^^^^^^^^ + +Include the headers +******************* + +Before using the library you need to include the library header *libircclient.h*. You may also want to include *libirc_rfcnumeric.h* which provides the RFC codes: + +.. sourcecode:: c + + #include "libircclient.h" + #include "libirc_rfcnumeric.h" + + +Create event handlers +********************* + +Unlike most network protocols such as HTTP or SMTP, the IRC protocol is event-based. The events come from server asynchronously. Some events are triggered by your +action (such as joining the channel or changing your nick), some are triggered by other IRC users (such as sending you a message), and some are triggered by the IRC +server itself (such as sending operation notes or invoking NickServ services). + +Libircclient helps handling those events by providing the :c:type:`event handling structure `. It declares the events you can define in your application, +and when such event is received from the server, the appropriate callback will be called. The number of events you need to handle depending on the complexity of your client +and the functionality it supports. + +Generally there are only two events you must handle to provide a bare minimum functionality: :c:member:`event_connect` and :c:member:`event_numeric`. However it is recommended +to create an event dump function and use it for all unused events to make sure you do not miss an important event because you expected a wrong one. See function **dump_event** in +the file examples/irctest.c + +Windows-specific initialization +******************************* + +If you link with the **static** library on Microsoft Windows, you need to initialize the Winsock2 library before calling the library functions. It could be done by following: + +.. sourcecode:: c + + WSADATA wsaData; + + if ( WSAStartup ( MAKEWORD (2, 2), &wsaData) != 0 ) + // report an error + +However if you link with the **dynamic** library (libircclient.dll) which is default if you use the official build, this is not needed because the DLL initializes it automatically on load. + + +Create an IRC session +********************* + +To use the library at least one :c:type:`IRC session ` needs to be created. One session could be used to establish a single connection to one IRC server for one nick. +However more than one session could be created if needed. + +To create a session, call the :c:func:`irc_create_session` function: + +.. sourcecode:: c + + // The IRC callbacks structure + irc_callbacks_t callbacks; + + // Init it + memset ( &callbacks, 0, sizeof(callbacks) ); + + // Set up the mandatory events + callbacks.event_connect = event_connect; + callbacks.event_numeric = event_numeric; + + // Set up the rest of events + + // Now create the session + irc_session_t * session = irc_create_session( &callbacks ); + + if ( !session ) + // Handle the error + +This code could be repeated as many times as needed to create multiple sessions. The same callback structure could be reused for multiple sessions. + +Set options +*********** + +Besides debugging there are two options you may need to use. The :c:macro:`LIBIRC_OPTION_STRIPNICKS` enables automatic parsing of nicknames, +and since it is hard to imagine the case when it should not be enabled, we enable it: + +.. sourcecode:: c + + irc_option_set( session, LIBIRC_OPTION_STRIPNICKS ); + +The second option you may need if you use SSL connections and plan to connect to the servers which use self-signed certificates. See the +documentation for :c:macro:`LIBIRC_OPTION_SSL_NO_VERIFY` + + +Connect to the server +********************* + +To initiate the connection to the IRC server, call the :c:func:`irc_connect` function: + +.. sourcecode:: c + + // Connect to a regular IRC server + if ( irc_connect (session, "irc.example.com", 6667, 0, "mynick", "myusername", "myrealname" ) ) + // Handle the error: irc_strerror() and irc_errno() + +To initiate the connection to the IRC server over SSL, call the :c:func:`irc_connect` function and prefix the host name or IP address with a hash symbol: + +.. sourcecode:: c + + // Connect to the SSL server; #192.168.1.1 is also possible + if ( irc_connect (session, "#irc.example.com", 6669, 0, "mynick", "myusername", "myrealname" ) ) + // Handle the error: irc_strerror() and irc_errno() + +This function only initiates the connection, so when it successfully returns the connection is only initiated, but not established yet. Then one +of the following happens after you invoke the networking handler: + + - If the connection is established, you will receive the :c:member:`event_connect` - this is why it is important to handle it + - If the connection failed, the networking handler function will return failure + + +Connect to the IPv6 server +************************** + +To initiate the connection to the IPv6 server, call the :c:func:`irc_connect6` function: + +.. sourcecode:: c + + if ( irc_connect6 (session, "2001:0db8:85a3:0042:1000:8a2e:0370:7334", 6669, 0, "mynick", "myusername", "myrealname" ) ) + // Handle the error: irc_strerror() and irc_errno() + +The rest of the details, including the return value and the SSL are the same as with regular connect. + + +Start the networking loop +************************* + +To let the library handle the events, there are two scenarios. You can either invoke the built-in networking loop which will handle the networking and +call your events, or you can write your own loop. + +Invoking the build-in networking loop is simpler but limited. Since it loops until the connection terminates, it is not an option for a GUI application +(unless you start the loop in a separate thread which you can do). And since this loop only can handle one session, it is impossible to use it if you want +to handle multiple IRC sessions. In those cases the custom networking loop, described below, should be used. + +To start the event loop call the :c:func:`irc_run` function: + +.. sourcecode:: c + + if ( irc_run (s) ) + // Either the connection to the server could not be established or terminated. See irc_errno() + +Remember that irc_run() call **will not return** until the server connection is not active anymore. + + +Use the custom networking loop +****************************** + +If you use multiple sessions or have your own socket handler, you can use the custom networking loop. In this case your application must be select()-based +(:ref:`see the FAQ ` if you want to use other polling methods). And you need to run the following loop: + +.. sourcecode:: c + + // Make sure that all the IRC sessions are connected + if ( !irc_is_connected(session) ) + // reconnect it, or abort + + // Create the structures for select() + struct timeval tv; + fd_set in_set, out_set; + int maxfd = 0; + + // Wait 0.25 sec for the events - you can wait longer if you want to, but the library has internal timeouts + // so it needs to be called periodically even if there are no network events + tv.tv_usec = 250000; + tv.tv_sec = 0; + + // Initialize the sets + FD_ZERO (&in_set); + FD_ZERO (&out_set); + + // Add your own descriptors you need to wait for, if any + ... + + // Add the IRC session descriptors - call irc_add_select_descriptors() for each active session + irc_add_select_descriptors( session, &in_set, &out_set, &maxfd ); + + // Call select() + if ( select (maxfd + 1, &in_set, &out_set, 0, &tv) < 0 ) + // Error + + // You may also check if any descriptor is active, but again the library needs to handle internal timeouts, + // so you need to call irc_process_select_descriptors() for each session at least once in a few seconds + ... + + // Call irc_process_select_descriptors() for each session with the descriptor set + if ( irc_process_select_descriptors (session, &in_set, &out_set) ) + // The connection failed, or the server disconnected. Handle it. + + // Do it again + + +Channels and users +^^^^^^^^^^^^^^^^^^ + +Before calling any of those functions make sure you have connected to the server. + +Join and leave a channel +************************ + +To join the channel call the :c:func:`irc_cmd_join` function with the channel name: + +.. sourcecode:: c + + // Join the channel #linux + if ( irc_cmd_join( session, "#linux", 0 ) ) + // most likely connection error + + // Join the channel $science protected by the secret key *superpassword* + if ( irc_cmd_join( session, "$science", "superpassword" ) ) + // most likely connection error + +You can join as many channels as you want, although the serer may restrict the number of channels you can join simultaneously. + +If the join was successful you will receive the :c:member:`event_join` event. You need to wait for this event before you can perform any channel operations (such as sending the messages). However you do NOT +have to wait for this event to issue a second JOIN command as shown in the example above. + +If the join was not successful, you will receive the error via :c:member:`event_numeric`. + +To leave the channel call the :c:func:`irc_cmd_part` function with the channel name: + +.. sourcecode:: c + + // Leave the channel #linux + if ( irc_cmd_part( session, "#linux" ) ) + // most likely connection error + + // Leave the channel $science + if ( irc_cmd_part( session, "$science" ) ) + // most likely connection error + + +Send a message to a channel or to a user +**************************************** + +After you have joined the channel, you can send a message to the channel by using the :c:func:`irc_cmd_msg` function with the channel name: + +.. sourcecode:: c + + // Say "Hi!" to everyone in the channel #linux + if ( irc_cmd_msg( session, "#linux", "Hi!" ) ) + // most likely connection error + +Technically the protocol does not require one to join the channel to send the messages into the channel. However most servers by default set +the channel mode which prevents the users who did not join the channel from sending the message into the channel. + +Same function is used to send a "private" message to another user. The "private" messages do not go through the channels, but they still go through +the IRC server (sometime multiple servers) and can be seen or even logged by the IRC network operators. + +.. sourcecode:: c + + // Say "Hi!" to IRC user john + if ( irc_cmd_msg( session, "john", "Hi!" ) ) + // most likely connection error + +If the message was sent successfully you will not receive any confirmation or event. You will only receive the error via :c:member:`event_numeric` +if the message was not sent. + + +Receive messages from a channel or from a user +********************************************** + +You receive the channel messages by handling the :c:member:`event_channel`. Each time someone says something in the channel this event is called. + +You receive the "private" messages from other users by handling the :c:member:`event_privmsg`. + +Those event handlers should be created in your application and passed to the library when you `create an IRC session`_ + + +Send an action message +********************** + +"Action" messages, also called /me messages, are specially formatted CTCP messages. However the library contains a special function to send +them, :c:func:`irc_cmd_me`. Actions sent by other people are handled by the :c:member:`event_ctcp_action` event. + +Same as with sending messages no confirmation is received on success. + + +Send a CTCP request +******************* + +Other CTCP requests such as PING, VERSION etc should be sent by calling :c:func:`irc_cmd_ctcp_request`. If the CTCP response is received, +it is handled by the :c:member:`event_ctcp_rep` event. + + +Handling DCC chat +^^^^^^^^^^^^^^^^^ + +Implementing the DCC callback +***************************** + +No matter whether you plan to initiate DCC chats or respond to them you must implement the :c:type:`DCC callback `: + +.. sourcecode:: c + + void dcc_callback (irc_session_t * session, irc_dcc_t id, int status, void * ctx, const char * data, unsigned int length) + { + if ( status ) + { + // If status is LIBIRC_ERR_CLOSED, the chat has been closed by the remote party. + // Otherwise it is an error; the CHAT either terminated or could not be established. status is the error code; see irc_strerror(status) + } + else if ( length == 0 ) + { + // The remote side has accepted the chat request, send "hello" something to them + irc_dcc_text( session, id, "Hello!" ); + } + else + { + // We have received the chat message from the remote party + printf ("Remote party said: %s\n", data ); + } + } + +This callback should be passed to either :c:func:`irc_dcc_chat` function which initiates the request, or to :c:func:`irc_dcc_accept` function +which accepts the DCC CHAT request initiated by another user. + + +Initiating the DCC CHAT +*********************** + +You can initiate the DCC chat with another user by calling :c:func:`irc_dcc_chat`: + +.. sourcecode:: c + + // The DCC chat session id will be returned in this variable + irc_dcc_t dccid; + + // Initiate the DCC chat with the IRC user "john" + if ( irc_dcc_chat( session, 0, "john", dcc_callback, &dccid ) ) + // report error + +Now you can proceed with other tasks. When John accepts or declines the chat, the dcc_callback() will be called, and it will be possible +to use the :c:func:`irc_dcc_text` function to send the chat messages. The callback will also be called each time a new chat message is +received, or when the chat is finished or terminated because of network error. + + +Responding to DCC CHAT requests +******************************* + +To respond to the DCC CHAT equests your application should implement for the :c:member:`event_dcc_chat_req` event. +The callback could be implemented as following: + +.. sourcecode:: c + + void callback_event_dcc_chat( irc_session_t * session, const char * nick, const char * addr, irc_dcc_t dccid ) + { + // User 'nick' from the IP address 'addr' tries to initiate the DCC chat with us. + // Store this information in the application internal queue together with the dccid so the callback can return + dcc_queue.store( dccid, "CHAT from " + nick + " IP address: " + addr ); + } + +and registered when the IRC session is created. +If your application does not handle DCC at all you can just call the :c:func:`irc_dcc_decline` function inside the callback. + +If it does, we only store this information in the callback, and return. This is because the event processing will stop +until the callback returns, so popping up the dialog asking for the user confirmation would stop further events such as +channel messages from being processed. Even if your application is automatic and doesn't pop up dialogs it is still better to +separate the chat logic from the callback logic. + +Somewhere later the application would check the queue in the GUI thread, get this information, and pop up the dialog asking the user +feedback. Then if the chat request was accepted, the application would call the :c:func:`irc_dcc_accept` function, and if it was +declined, the application would call the :c:func:`irc_dcc_decline` function. Both functions will accept the *dccid* which identifies +this specific request: + +.. sourcecode:: c + + // Somewhere in the GUI thread + if ( !dcc_queue.empty() ) + { + // Get the DCC information and show the dialog to the user + irc_dcc_t dccid = dcc_chat_queue.top().dccid; + + ... + + // React to the user entry + if ( dialog.isAccepted() ) + irc_dcc_accept( session, dccid, 0, dcc_callback ); + else + irc_dcc_decline( session, dccid ); + } + + +Send CHAT messages +****************** + +Once the chat session is established, you can send the chat messages using :c:func:`irc_dcc_text` function. Note that you need to pass the +dcc session id instead of nick: + +.. sourcecode:: c + + irc_dcc_text( session, dccid, "Hello there!" ); + + +Handling DCC file transfer +^^^^^^^^^^^^^^^^^^^^^^^^^^ + +This section covers handling sending and receiving files via DCC. + + +Implementing the callback +************************* + +No matter whether you plan to send or receive files via dcc you must implement the :c:type:`DCC callback `. +While the same callback may be used both for sending and receiving, this is not recommended since the logic is different. Therefore +the suggested implementation would be to use different callbacks as suggested: + +.. sourcecode:: c + + // This callback is used when we send a file to the remote party + void callback_dcc_send_file (irc_session_t * session, irc_dcc_t id, int status, void * ctx, const char * data, unsigned int length) + { + if ( status ) + { + // It is an error; the send operation was either terminated or the connection could not be established. status is the error code; see irc_strerror(status) + } + else + { + // We have sent some data to the remote party, 'length' indicates how much data was sent + printf ("Sent bytes: %d\n", length ); + } + } + + // This callback is used when we receive a file from the remote party + void callback_dcc_recv_file (irc_session_t * session, irc_dcc_t id, int status, void * ctx, const char * data, unsigned int length) + { + if ( status ) + { + // It is an error; the send operation was either terminated or the connection could not be established. status is the error code; see irc_strerror(status) + } + else if ( data == 0 ) + { + // File transfer has been finished + printf ("File has been received successfully\n" ); + } + else + { + // More file content has been received. Store it in memory, write to disk or something + printf ("Received %d bytes of data\n", length ); + } + } + + +This callback should be passed to either :c:func:`irc_dcc_sendfile` function which initiates the request, or to :c:func:`irc_dcc_accept` function +which accepts the DCC RECVFILE request initiated by another user. + + +Sending the file via DCC +************************ + +You can initiate sending the file via DCC to another user by calling :c:func:`irc_dcc_sendfile`: + +.. sourcecode:: c + + // The DCC session id will be returned in this variable + irc_dcc_t dccid; + + // Initiate sending of file "/etc/passwd" via DCC chat to the IRC user "john" + if ( irc_dcc_sendfile( session, 0, "john", "/etc/passwd", callback_dcc_send_file, &dccid ) ) + // report error + +Now you can proceed with other tasks. When John accepts the request, the file will be sent and callback_dcc_send_file() will be called +each time a piece of file is sent. The callback will also be called when the file has been sent, or when sending was terminated +because of network error. + + +Receive a file via DCC +********************** + +To receive the file via DCC a remote user must initiate the DCC request to send you a file. To receive this request your application +should implement the :c:member:`event_dcc_send_req` event. The callback could be implemented as following: + +.. sourcecode:: c + + void callback_event_dcc_file( irc_session_t * session, const char * nick, const char * addr, const char * filename, unsigned long size, irc_dcc_t dccid ) + { + // User 'nick' from the IP address 'addr' tries to initiate the DCC chat with us. + // Store this information in the application internal queue together with the dccid so the callback can return + dcc_queue.store( dccid, "CHAT from " + nick + " IP address: " + addr + ", filename " + filename ); + } + +If your application does not handle DCC at all you can just call the :c:func:`irc_dcc_decline` function inside the callback. + +If it does, we only store this information in the callback, and return. This is because the event processing will stop +until the callback returns, so popping up the dialog asking for the user confirmation would stop further events such as +channel messages from being processed. Even if your application is automatic and doesn't pop up dialogs it is still better to +separate the chat logic from the callback logic. + +Somewhere later the application would check the queue in the GUI thread, get this information, and pop up the dialog asking the user +feedback. Then if the chat request was accepted, the application would call the :c:func:`irc_dcc_accept` function, and if it was +declined, the application would call the :c:func:`irc_dcc_decline` function. Both functions will accept the *dccid* which identifies +this specific request: + +.. sourcecode:: c + + // Somewhere in the GUI thread + if ( !dcc_queue.empty() ) + { + // Get the DCC information and show the dialog to the user + irc_dcc_t dccid = dcc_chat_queue.top().dccid; + + ... + + // React to the user entry + if ( dialog.isAccepted() ) + irc_dcc_accept( session, dccid, 0, dcc_callback ); + else + irc_dcc_decline( session, dccid ); + } + +Note that it is not possible to request a remote user to send you a file. + +Handling colors +^^^^^^^^^^^^^^^ + +.. _color_stripping: + +Stripping colors from the message +********************************* + +If your bot reacts on the text messages, you need to strip down the colors from the text messages before processing them. Otherwise the user sending +the colored message won't get the same reaction as the user who doesn't use colors, and some users use colors by default. + +Use the :c:func:`irc_color_strip_from_mirc` function to strip the ANSI colors from the text message. It does not modify the message which doesn't use colors. + + +Color conversion +**************** + +The library supports color translation, and can convert colors between the ANSI colors used by the IRC clients and their textual representation. +Colors usage is typically limited to the messages and user specified reasons. You cannot use colors as part of your nick or channel name. + +Use the :c:func:`irc_color_convert_from_mirc` function to convert colors from ANSI to the library textual representation, and :c:func:`irc_color_convert_to_mirc` +to convert the library textual representation of colors into ANSI. + +Do not forget to free() the returned pointer once it is not used anymore. + +Miscellaneous +^^^^^^^^^^^^^ + +Tracking user nicks +******************* + +If your application maintains some user-specific quotas, it is important to track the nick changes. Since the nick is the only identifier +available to you, each time the user changes the nick you need to update your quota database. To do so you need to intercept the :c:member:`event_nick` +event. See the examples/censor.c for details. diff --git a/libircclient/examples/Makefile.in b/libircclient/examples/Makefile.in new file mode 100644 index 0000000..f4fb291 --- /dev/null +++ b/libircclient/examples/Makefile.in @@ -0,0 +1,40 @@ +CC = @CC@ +CXX = @CXX@ +CFLAGS = -Wall @CFLAGS@ +LIBS = -L../src/ -lircclient -lpthread @LIBS@ +INCLUDES=-I../include + +EXAMPLES=spammer censor irctest ircftp colors + +all: $(EXAMPLES) + +spammer: spammer.o + $(CC) -o spammer spammer.o $(LIBS) + +colors: colors.o + $(CXX) -o colors colors.o $(LIBS) + +irctest: irctest.o + $(CC) -o irctest irctest.o $(LIBS) + +censor: censor.o + $(CXX) -o censor censor.o $(LIBS) + +ircftp: ircftp.o + $(CXX) -o ircftp ircftp.o $(LIBS) + + +clean: + -rm -f $(EXAMPLES) *.o *.exe + +distclean: clean + -rm -f Makefile *.log + + +.c.o: + @echo "Compiling $<" + @$(CC) $(CFLAGS) $(INCLUDES) -c -o $@ $< + +.cpp.o: + @echo "Compiling $<" + @$(CXX) $(CFLAGS) $(INCLUDES) -c -o $@ $< diff --git a/libircclient/examples/censor.cpp b/libircclient/examples/censor.cpp new file mode 100644 index 0000000..c784040 --- /dev/null +++ b/libircclient/examples/censor.cpp @@ -0,0 +1,213 @@ +/* + * Copyright (C) 2004-2009 Georgy Yunaev gyunaev@ulduzsoft.com + * + * This example is free, and not covered by LGPL license. There is no + * restriction applied to their modification, redistribution, using and so on. + * You can study them, modify them, use them in your own program - either + * completely or partially. By using it you may give me some credits in your + * program, but you don't have to. + * + * + * This example 'guards' the channel against using abusive language. When + * someone says a bad word, it takes some action against him/her, taking + * in account the number of times the person uses it. The first time, it just + * warns the person through a private message, the second time it warns him + * publically in channel, and after the second time it will kicks the insolent + * out of the channel. + * + * To keep it simple, this example reacts only on 'fuck' word, however + * is is easy to add more. + * + * Features used: + * - nickname parsing; + * - handling 'channel' event to track the messages; + * - handling 'nick' event to track nickname changes; + * - generating channel and private messages, and kicking. + */ + +#include +#include + +#include +#include +#include + +#if !defined (_WIN32) + #include +#endif + +#include "libircclient.h" + + +/* + * We store data in IRC session context. + */ +typedef struct +{ + char * channel; + char * nick; + std::map insolents; + +} irc_ctx_t; + + + + +void event_connect (irc_session_t * session, const char * event, const char * origin, const char ** params, unsigned int count) +{ + irc_ctx_t * ctx = (irc_ctx_t *) irc_get_ctx (session); + irc_cmd_join (session, ctx->channel, 0); +} + + +void event_nick (irc_session_t * session, const char * event, const char * origin, const char ** params, unsigned int count) +{ + char nickbuf[128]; + + irc_ctx_t * ctx = (irc_ctx_t *) irc_get_ctx (session); + + if ( !origin || count != 1 ) + return; + + irc_target_get_nick (origin, nickbuf, sizeof(nickbuf)); + + if ( ctx->insolents.find(nickbuf) != ctx->insolents.end() ) + { + printf ("%s has changed its nick to %s to prevent penalties - no way!\n", + nickbuf, params[0]); + ctx->insolents[params[0]] = ctx->insolents[nickbuf]; + ctx->insolents.erase (nickbuf); + } +} + + +void event_channel (irc_session_t * session, const char * event, const char * origin, const char ** params, unsigned int count) +{ + irc_ctx_t * ctx = (irc_ctx_t *) irc_get_ctx (session); + + if ( !origin || count != 2 ) + return; + + if ( strstr (params[1], "fuck") == 0 ) + return; + + char nickbuf[128], text[256]; + + irc_target_get_nick (origin, nickbuf, sizeof(nickbuf)); + + if ( ctx->insolents.find(nickbuf) == ctx->insolents.end() ) + ctx->insolents[nickbuf] = 0; + + ctx->insolents[nickbuf]++; + + printf ("'%s' swears in the channel '%s' %d times\n", + nickbuf, + params[1], + ctx->insolents[nickbuf]); + + switch (ctx->insolents[nickbuf]) + { + case 1: + // Send a private message + sprintf (text, "%s, please do not swear in this channel.", nickbuf); + irc_cmd_msg (session, nickbuf, text); + break; + + case 2: + // Send a channel message + sprintf (text, "%s, do not swear in this channel, or you'll leave it.", nickbuf); + irc_cmd_msg (session, params[0], text); + break; + + default: + // Send a channel notice, and kick the insolent + sprintf (text, "kicked %s from %s for swearing.", nickbuf, params[0]); + irc_cmd_me (session, params[0], text); + irc_cmd_kick (session, nickbuf, params[0], "swearing"); + break; + } +} + + +void event_numeric (irc_session_t * session, unsigned int event, const char * origin, const char ** params, unsigned int count) +{ + if ( event > 400 ) + { + std::string fulltext; + for ( unsigned int i = 0; i < count; i++ ) + { + if ( i > 0 ) + fulltext += " "; + + fulltext += params[i]; + } + + printf ("ERROR %d: %s: %s\n", event, origin ? origin : "?", fulltext.c_str()); + } +} + + +int main (int argc, char **argv) +{ + irc_callbacks_t callbacks; + irc_ctx_t ctx; + unsigned short port = 6667; + + if ( argc != 4 ) + { + printf ("Usage: %s <[#]server[:port]> \n", argv[0]); + return 1; + } + + // Initialize the callbacks + memset (&callbacks, 0, sizeof(callbacks)); + + // Set up the callbacks we will use + callbacks.event_connect = event_connect; + callbacks.event_channel = event_channel; + callbacks.event_nick = event_nick; + callbacks.event_numeric = event_numeric; + + // And create the IRC session; 0 means error + irc_session_t * s = irc_create_session (&callbacks); + + if ( !s ) + { + printf ("Could not create IRC session\n"); + return 1; + } + + ctx.channel = argv[3]; + ctx.nick = argv[2]; + irc_set_ctx (s, &ctx); + + // If the port number is specified in the server string, use the port 0 so it gets parsed + if ( strchr( argv[1], ':' ) != 0 ) + port = 0; + + // To handle the "SSL certificate verify failed" from command line we allow passing ## in front + // of the server name, and in this case tell libircclient not to verify the cert + if ( argv[1][0] == '#' && argv[1][1] == '#' ) + { + // Skip the first character as libircclient needs only one # for SSL support, i.e. #irc.freenode.net + argv[1]++; + + irc_option_set( s, LIBIRC_OPTION_SSL_NO_VERIFY ); + } + + // Initiate the IRC server connection + if ( irc_connect (s, argv[1], port, 0, argv[2], 0, 0) ) + { + printf ("Could not connect: %s\n", irc_strerror (irc_errno(s))); + return 1; + } + + // and run into forever loop, generating events + if ( irc_run (s) ) + { + printf ("Could not connect or I/O error: %s\n", irc_strerror (irc_errno(s))); + return 1; + } + + return 0; +} diff --git a/libircclient/examples/colors.cpp b/libircclient/examples/colors.cpp new file mode 100644 index 0000000..a5eca39 --- /dev/null +++ b/libircclient/examples/colors.cpp @@ -0,0 +1,164 @@ +/* + * Copyright (C) 2004-2009 Georgy Yunaev gyunaev@ulduzsoft.com + * + * This example is free, and not covered by LGPL license. There is no + * restriction applied to their modification, redistribution, using and so on. + * You can study them, modify them, use them in your own program - either + * completely or partially. By using it you may give me some credits in your + * program, but you don't have to. + * + * + * This program will test automatic color replacement features. It uses the + * colors itself, generates colored string in reaction to 'test' word, and + * dumps the de-colored messages. + */ + +#include + +#include +#include +#include +#include + +#include "libircclient.h" + + +/* + * We store data in IRC session context. + */ +typedef struct +{ + char * channel; + char * nick; + +} irc_ctx_t; + + + +void event_join (irc_session_t * session, const char * event, const char * origin, const char ** params, unsigned int count) +{ + char * str = irc_color_convert_to_mirc ("[B]Hi[/B] [U]all[/U]. Could someone say 'test'?"); + irc_cmd_msg (session, params[0], str); + free (str); +} + + +void event_connect (irc_session_t * session, const char * event, const char * origin, const char ** params, unsigned int count) +{ + irc_ctx_t * ctx = (irc_ctx_t *) irc_get_ctx (session); + irc_cmd_join (session, ctx->channel, 0); +} + + +void event_channel (irc_session_t * session, const char * event, const char * origin, const char ** params, unsigned int count) +{ + printf ("'%s' said in channel %s: %s\n", + origin ? origin : "someone", + params[0], params[1] ); + + char * stripped = irc_color_strip_from_mirc (params[1]); + irc_cmd_msg (session, params[0], stripped); + free (stripped); + + stripped = irc_color_convert_from_mirc (params[1]); + irc_cmd_msg (session, params[0], stripped); + free (stripped); + + if ( !strcmp (params[1], "test") ) + { + char * str = irc_color_convert_to_mirc ("normal, [B]bold[/B], [I]reverse[/I], [U]underline[/U], [COLOR=RED]red on white[/COLOR], [COLOR=YELLOW/BLACK]yellow on black[/COLOR]"); + irc_cmd_msg (session, params[0], str); + free (str); + } + + if ( strstr (params[1], "testme") == params[1] ) + { + char * str = irc_color_convert_to_mirc (params[1] + 7); + irc_cmd_msg (session, params[0], str); + free (str); + } + +} + + +void event_numeric (irc_session_t * session, unsigned int event, const char * origin, const char ** params, unsigned int count) +{ + if ( event > 400 ) + { + std::string fulltext; + for ( unsigned int i = 0; i < count; i++ ) + { + if ( i > 0 ) + fulltext += " "; + + fulltext += params[i]; + } + + printf ("ERROR %d: %s: %s\n", event, origin ? origin : "?", fulltext.c_str()); + } +} + + +int main (int argc, char **argv) +{ + irc_callbacks_t callbacks; + irc_ctx_t ctx; + irc_session_t * s; + unsigned short port = 6667; + + if ( argc != 4 ) + { + printf ("Usage: %s \n", argv[0]); + return 1; + } + + memset (&callbacks, 0, sizeof(callbacks)); + + callbacks.event_connect = event_connect; + callbacks.event_join = event_join; + callbacks.event_channel = event_channel; + callbacks.event_numeric = event_numeric; + + s = irc_create_session (&callbacks); + + if ( !s ) + { + printf ("Could not create session\n"); + return 1; + } + + ctx.channel = argv[3]; + ctx.nick = argv[2]; + + irc_set_ctx (s, &ctx); + + // If the port number is specified in the server string, use the port 0 so it gets parsed + if ( strchr( argv[1], ':' ) != 0 ) + port = 0; + + // To handle the "SSL certificate verify failed" from command line we allow passing ## in front + // of the server name, and in this case tell libircclient not to verify the cert + if ( argv[1][0] == '#' && argv[1][1] == '#' ) + { + // Skip the first character as libircclient needs only one # for SSL support, i.e. #irc.freenode.net + argv[1]++; + + irc_option_set( s, LIBIRC_OPTION_SSL_NO_VERIFY ); + } + + // Initiate the IRC server connection + if ( irc_connect (s, argv[1], port, 0, argv[2], 0, 0) ) + { + printf ("Could not connect: %s\n", irc_strerror (irc_errno(s))); + return 1; + } + + // and run into forever loop, generating events + if ( irc_run (s) ) + { + printf ("Could not connect or I/O error: %s\n", irc_strerror (irc_errno(s))); + return 1; + } + + return 1; +} diff --git a/libircclient/examples/ircftp.cpp b/libircclient/examples/ircftp.cpp new file mode 100644 index 0000000..3e8a20b --- /dev/null +++ b/libircclient/examples/ircftp.cpp @@ -0,0 +1,191 @@ +/* + * Copyright (C) 2004-2009 Georgy Yunaev gyunaev@ulduzsoft.com + * + * This example is free, and not covered by LGPL license. There is no + * restriction applied to their modification, redistribution, using and so on. + * You can study them, modify them, use them in your own program - either + * completely or partially. By using it you may give me some credits in your + * program, but you don't have to. + * + * + * This example emulates a simple file server. Only 'list' and 'get' commands + * are supported. + * + * Features used: + * - automatic nickname parsing using LIBIRC_OPTION_STRIPNICKS; + * - handling privmsg events to parse commands; + * - generating listings and DCC file transfer; + * + * $Id: ircftp.cpp 94 2012-01-18 08:04:49Z gyunaev $ + */ + +#include +#include + +#include +#include +#include +#include +#include + +#include "libircclient.h" + + +#define FILES_DIR "." + +/* + * We store data in IRC session context. + */ +typedef struct +{ + std::string channel; + std::string nick; + +} irc_ctx_t; + + + +void dcc_callback (irc_session_t * session, irc_dcc_t id, int status, void * ctx, const char * data, unsigned int length) +{ + if ( status == 0 && length == 0 ) + { + printf ("File sent successfully\n"); + } + else if ( status ) + { + printf ("File sent error: %s (%d)\n", irc_strerror(status), status); + } + else + { + printf ("File sent progress: %d\n", length); + } +} + + +void event_connect (irc_session_t * session, const char * event, const char * origin, const char ** params, unsigned int count) +{ + irc_ctx_t * ctx = (irc_ctx_t *) irc_get_ctx (session); + irc_cmd_join (session, ctx->channel.c_str(), 0); +} + + +void event_privmsg (irc_session_t * session, const char * event, const char * origin, const char ** params, unsigned int count) +{ + if ( !origin || count != 2 ) + return; + + if ( !strcasecmp (params[1], "list") ) + { + dirent *d; + DIR *dir = opendir(FILES_DIR); + + if ( !dir ) + return; + + while ( (d = readdir (dir)) != 0 ) + { + if ( !strcmp (d->d_name, ".") ) + continue; + + irc_cmd_msg (session, origin, d->d_name); + } + + closedir (dir); + } + else if ( strstr (params[1], "get ") == params[1] ) + { + irc_dcc_t dccid; + + if ( irc_dcc_sendfile (session, 0, origin, params[1] + 4, dcc_callback, &dccid) ) + irc_cmd_msg (session, origin, "Could not send this file"); + } + else + { + irc_cmd_msg (session, origin, "Commands: send | list"); + } +} + + +void event_numeric (irc_session_t * session, unsigned int event, const char * origin, const char ** params, unsigned int count) +{ + if ( event > 400 ) + { + std::string fulltext; + for ( unsigned int i = 0; i < count; i++ ) + { + if ( i > 0 ) + fulltext += " "; + + fulltext += params[i]; + } + + printf ("ERROR %d: %s: %s\n", event, origin ? origin : "?", fulltext.c_str()); + } +} + + +int main (int argc, char **argv) +{ + irc_callbacks_t callbacks; + irc_ctx_t ctx; + unsigned short port = 6667; + + if ( argc != 4 ) + { + printf ("Usage: %s \n", argv[0]); + return 1; + } + + // Initialize the callbacks + memset (&callbacks, 0, sizeof(callbacks)); + + // Set up the callbacks we will use + callbacks.event_connect = event_connect; + callbacks.event_privmsg = event_privmsg; + callbacks.event_numeric = event_numeric; + + // And create the IRC session; 0 means error + irc_session_t * s = irc_create_session (&callbacks); + + if ( !s ) + { + printf ("Could not create IRC session\n"); + return 1; + } + + ctx.channel = argv[3]; + ctx.nick = argv[2]; + + irc_set_ctx (s, &ctx); + irc_option_set (s, LIBIRC_OPTION_STRIPNICKS); + + // If the port number is specified in the server string, use the port 0 so it gets parsed + if ( strchr( argv[1], ':' ) != 0 ) + port = 0; + + // To handle the "SSL certificate verify failed" from command line we allow passing ## in front + // of the server name, and in this case tell libircclient not to verify the cert + if ( argv[1][0] == '#' && argv[1][1] == '#' ) + { + // Skip the first character as libircclient needs only one # for SSL support, i.e. #irc.freenode.net + argv[1]++; + + irc_option_set( s, LIBIRC_OPTION_SSL_NO_VERIFY ); + } + + // Initiate the IRC server connection + if ( irc_connect (s, argv[1], port, 0, argv[2], 0, 0) ) + { + printf ("Could not connect: %s\n", irc_strerror (irc_errno(s))); + return 1; + } + + // and run into forever loop, generating events + if ( irc_run (s) ) + { + printf ("Could not connect or I/O error: %s\n", irc_strerror (irc_errno(s))); + return 1; + } + + return 1; +} diff --git a/libircclient/examples/irctest.c b/libircclient/examples/irctest.c new file mode 100644 index 0000000..de66734 --- /dev/null +++ b/libircclient/examples/irctest.c @@ -0,0 +1,343 @@ +/* + * Copyright (C) 2004-2009 Georgy Yunaev gyunaev@ulduzsoft.com + * + * This example is free, and not covered by LGPL license. There is no + * restriction applied to their modification, redistribution, using and so on. + * You can study them, modify them, use them in your own program - either + * completely or partially. By using it you may give me some credits in your + * program, but you don't have to. + * + * + * This example tests most features of libirc. It can join the specific + * channel, welcoming all the people there, and react on some messages - + * 'help', 'quit', 'dcc chat', 'dcc send', 'ctcp'. Also it can reply to + * CTCP requests, receive DCC files and accept DCC chats. + * + * Features used: + * - nickname parsing; + * - handling 'channel' event to track the messages; + * - handling dcc and ctcp events; + * - using internal ctcp rely procedure; + * - generating channel messages; + * - handling dcc send and dcc chat events; + * - initiating dcc send and dcc chat. + * + * $Id: irctest.c 124 2013-11-28 05:44:10Z gyunaev $ + */ + +#include +#include +#include +#include + +#include "libircclient.h" + + +/* + * We store data in IRC session context. + */ +typedef struct +{ + char * channel; + char * nick; + +} irc_ctx_t; + + +void addlog (const char * fmt, ...) +{ + FILE * fp; + char buf[1024]; + va_list va_alist; + + va_start (va_alist, fmt); +#if defined (_WIN32) + _vsnprintf (buf, sizeof(buf), fmt, va_alist); +#else + vsnprintf (buf, sizeof(buf), fmt, va_alist); +#endif + va_end (va_alist); + + printf ("%s\n", buf); + + if ( (fp = fopen ("irctest.log", "ab")) != 0 ) + { + fprintf (fp, "%s\n", buf); + fclose (fp); + } +} + + +void dump_event (irc_session_t * session, const char * event, const char * origin, const char ** params, unsigned int count) +{ + char buf[512]; + int cnt; + + buf[0] = '\0'; + + for ( cnt = 0; cnt < count; cnt++ ) + { + if ( cnt ) + strcat (buf, "|"); + + strcat (buf, params[cnt]); + } + + + addlog ("Event \"%s\", origin: \"%s\", params: %d [%s]", event, origin ? origin : "NULL", cnt, buf); +} + + +void event_join (irc_session_t * session, const char * event, const char * origin, const char ** params, unsigned int count) +{ + dump_event (session, event, origin, params, count); + irc_cmd_user_mode (session, "+i"); + irc_cmd_msg (session, params[0], "Hi all"); +} + + +void event_connect (irc_session_t * session, const char * event, const char * origin, const char ** params, unsigned int count) +{ + irc_ctx_t * ctx = (irc_ctx_t *) irc_get_ctx (session); + dump_event (session, event, origin, params, count); + + irc_cmd_join (session, ctx->channel, 0); +} + + +void event_privmsg (irc_session_t * session, const char * event, const char * origin, const char ** params, unsigned int count) +{ + dump_event (session, event, origin, params, count); + + printf ("'%s' said me (%s): %s\n", + origin ? origin : "someone", + params[0], params[1] ); +} + + +void dcc_recv_callback (irc_session_t * session, irc_dcc_t id, int status, void * ctx, const char * data, unsigned int length) +{ + static int count = 1; + char buf[12]; + + switch (status) + { + case LIBIRC_ERR_CLOSED: + printf ("DCC %d: chat closed\n", id); + break; + + case 0: + if ( !data ) + { + printf ("DCC %d: chat connected\n", id); + irc_dcc_msg (session, id, "Hehe"); + } + else + { + printf ("DCC %d: %s\n", id, data); + sprintf (buf, "DCC [%d]: %d", id, count++); + irc_dcc_msg (session, id, buf); + } + break; + + default: + printf ("DCC %d: error %s\n", id, irc_strerror(status)); + break; + } +} + + +void dcc_file_recv_callback (irc_session_t * session, irc_dcc_t id, int status, void * ctx, const char * data, unsigned int length) +{ + if ( status == 0 && length == 0 ) + { + printf ("File sent successfully\n"); + + if ( ctx ) + fclose ((FILE*) ctx); + } + else if ( status ) + { + printf ("File sent error: %d\n", status); + + if ( ctx ) + fclose ((FILE*) ctx); + } + else + { + if ( ctx ) + fwrite (data, 1, length, (FILE*) ctx); + printf ("File sent progress: %d\n", length); + } +} + + +void event_channel (irc_session_t * session, const char * event, const char * origin, const char ** params, unsigned int count) +{ + char nickbuf[128]; + + if ( count != 2 ) + return; + + printf ("'%s' said in channel %s: %s\n", + origin ? origin : "someone", + params[0], params[1] ); + + if ( !origin ) + return; + + irc_target_get_nick (origin, nickbuf, sizeof(nickbuf)); + + if ( !strcmp (params[1], "quit") ) + irc_cmd_quit (session, "of course, Master!"); + + if ( !strcmp (params[1], "help") ) + { + irc_cmd_msg (session, params[0], "quit, help, dcc chat, dcc send, ctcp"); + } + + if ( !strcmp (params[1], "ctcp") ) + { + irc_cmd_ctcp_request (session, nickbuf, "PING 223"); + irc_cmd_ctcp_request (session, nickbuf, "FINGER"); + irc_cmd_ctcp_request (session, nickbuf, "VERSION"); + irc_cmd_ctcp_request (session, nickbuf, "TIME"); + } + + if ( !strcmp (params[1], "dcc chat") ) + { + irc_dcc_t dccid; + irc_dcc_chat (session, 0, nickbuf, dcc_recv_callback, &dccid); + printf ("DCC chat ID: %d\n", dccid); + } + + if ( !strcmp (params[1], "dcc send") ) + { + irc_dcc_t dccid; + irc_dcc_sendfile (session, 0, nickbuf, "irctest.c", dcc_file_recv_callback, &dccid); + printf ("DCC send ID: %d\n", dccid); + } + + if ( !strcmp (params[1], "topic") ) + irc_cmd_topic (session, params[0], 0); + else if ( strstr (params[1], "topic ") == params[1] ) + irc_cmd_topic (session, params[0], params[1] + 6); + + if ( strstr (params[1], "mode ") == params[1] ) + irc_cmd_channel_mode (session, params[0], params[1] + 5); + + if ( strstr (params[1], "nick ") == params[1] ) + irc_cmd_nick (session, params[1] + 5); + + if ( strstr (params[1], "whois ") == params[1] ) + irc_cmd_whois (session, params[1] + 5); +} + + +void irc_event_dcc_chat (irc_session_t * session, const char * nick, const char * addr, irc_dcc_t dccid) +{ + printf ("DCC chat [%d] requested from '%s' (%s)\n", dccid, nick, addr); + + irc_dcc_accept (session, dccid, 0, dcc_recv_callback); +} + + +void irc_event_dcc_send (irc_session_t * session, const char * nick, const char * addr, const char * filename, unsigned long size, irc_dcc_t dccid) +{ + FILE * fp; + printf ("DCC send [%d] requested from '%s' (%s): %s (%lu bytes)\n", dccid, nick, addr, filename, size); + + if ( (fp = fopen ("file", "wb")) == 0 ) + abort(); + + irc_dcc_accept (session, dccid, fp, dcc_file_recv_callback); +} + +void event_numeric (irc_session_t * session, unsigned int event, const char * origin, const char ** params, unsigned int count) +{ + char buf[24]; + sprintf (buf, "%d", event); + + dump_event (session, buf, origin, params, count); +} + + +int main (int argc, char **argv) +{ + irc_callbacks_t callbacks; + irc_ctx_t ctx; + irc_session_t * s; + unsigned short port = 6667; + + if ( argc != 4 ) + { + printf ("Usage: %s \n", argv[0]); + return 1; + } + + memset (&callbacks, 0, sizeof(callbacks)); + + callbacks.event_connect = event_connect; + callbacks.event_join = event_join; + callbacks.event_nick = dump_event; + callbacks.event_quit = dump_event; + callbacks.event_part = dump_event; + callbacks.event_mode = dump_event; + callbacks.event_topic = dump_event; + callbacks.event_kick = dump_event; + callbacks.event_channel = event_channel; + callbacks.event_privmsg = event_privmsg; + callbacks.event_notice = dump_event; + callbacks.event_invite = dump_event; + callbacks.event_umode = dump_event; + callbacks.event_ctcp_rep = dump_event; + callbacks.event_ctcp_action = dump_event; + callbacks.event_unknown = dump_event; + callbacks.event_numeric = event_numeric; + + callbacks.event_dcc_chat_req = irc_event_dcc_chat; + callbacks.event_dcc_send_req = irc_event_dcc_send; + + s = irc_create_session (&callbacks); + + if ( !s ) + { + printf ("Could not create session\n"); + return 1; + } + + ctx.channel = argv[3]; + ctx.nick = argv[2]; + + irc_set_ctx (s, &ctx); + + // If the port number is specified in the server string, use the port 0 so it gets parsed + if ( strchr( argv[1], ':' ) != 0 ) + port = 0; + + // To handle the "SSL certificate verify failed" from command line we allow passing ## in front + // of the server name, and in this case tell libircclient not to verify the cert + if ( argv[1][0] == '#' && argv[1][1] == '#' ) + { + // Skip the first character as libircclient needs only one # for SSL support, i.e. #irc.freenode.net + argv[1]++; + + irc_option_set( s, LIBIRC_OPTION_SSL_NO_VERIFY ); + } + + // Initiate the IRC server connection + if ( irc_connect (s, argv[1], port, 0, argv[2], 0, 0) ) + { + printf ("Could not connect: %s\n", irc_strerror (irc_errno(s))); + return 1; + } + + // and run into forever loop, generating events + if ( irc_run (s) ) + { + printf ("Could not connect or I/O error: %s\n", irc_strerror (irc_errno(s))); + return 1; + } + + return 1; +} diff --git a/libircclient/examples/spammer.c b/libircclient/examples/spammer.c new file mode 100644 index 0000000..2a0861b --- /dev/null +++ b/libircclient/examples/spammer.c @@ -0,0 +1,213 @@ +/* + * Copyright (C) 2004-2009 Georgy Yunaev gyunaev@ulduzsoft.com + * + * This example is free, and not covered by LGPL license. There is no + * restriction applied to their modification, redistribution, using and so on. + * You can study them, modify them, use them in your own program - either + * completely or partially. By using it you may give me some credits in your + * program, but you don't have to. + * + * + * This example spams the specified channels with words 'HAHA', 'HEHE' and + * 'HUHU' using three threads. Its main purpose is to test multithreading + * support of libircclient. + */ + +#include +#include +#include + +#if defined (_WIN32) + #include + + #define CREATE_THREAD(id,func,param) (CreateThread(0, 0, func, param, 0, id) == 0) + #define THREAD_FUNCTION(funcname) static DWORD WINAPI funcname (LPVOID arg) + #define thread_id_t DWORD + #define sleep(a) Sleep (a*1000) +#else + #include + #include + + #define CREATE_THREAD(id,func,param) (pthread_create (id, 0, func, (void *) param) != 0) + #define THREAD_FUNCTION(funcname) static void * funcname (void * arg) + #define thread_id_t pthread_t +#endif + +#include "libircclient.h" + + +/* + * We store data in IRC session context. + */ +typedef struct +{ + char * channel; + char * nick; + +} irc_ctx_t; + + +/* + * Params that we give to our threads. + */ +typedef struct +{ + irc_session_t * session; + const char * phrase; + const char * channel; + int timer; + +} spam_params_t; + + +THREAD_FUNCTION(gen_spam) +{ + spam_params_t * sp = (spam_params_t *) arg; + + while ( 1 ) + { + if ( irc_cmd_msg (sp->session, sp->channel, sp->phrase) ) + break; + + sleep(sp->timer); + } + + return 0; +} + + + +void event_join (irc_session_t * session, const char * event, const char * origin, const char ** params, unsigned int count) +{ + irc_ctx_t * ctx = (irc_ctx_t *) irc_get_ctx (session); + + if ( !origin ) + return; + + // We need to know whether WE are joining the channel, or someone else. + // To do this, we compare the origin with our nick. + // Note that we have set LIBIRC_OPTION_STRIPNICKS to obtain 'parsed' nicks. + if ( !strcmp(origin, ctx->nick) ) + { + static spam_params_t spam1; + static spam_params_t spam2; + static spam_params_t spam3; + thread_id_t tid; + + spam1.session = spam2.session = spam3.session = session; + spam1.channel = spam2.channel = spam3.channel = ctx->channel; + + spam1.phrase = "HEHE"; + spam2.phrase = "HAHA"; + spam3.phrase = "HUHU"; + + spam1.timer = 2; + spam2.timer = 3; + spam3.timer = 4; + + printf ("We just joined the channel %s; starting the spam threads\n", params[1]); + + if ( CREATE_THREAD (&tid, gen_spam, &spam1) + || CREATE_THREAD (&tid, gen_spam, &spam2) + || CREATE_THREAD (&tid, gen_spam, &spam3) ) + printf ("CREATE_THREAD failed: %s\n", strerror(errno)); + else + printf ("Spammer thread was started successfully.\n"); + } + else + { + char textbuf[168]; + sprintf (textbuf, "Hey, %s, hi!", origin); + irc_cmd_msg (session, params[0], textbuf); + } +} + + +void event_connect (irc_session_t * session, const char * event, const char * origin, const char ** params, unsigned int count) +{ + irc_ctx_t * ctx = (irc_ctx_t *) irc_get_ctx (session); + irc_cmd_join (session, ctx->channel, 0); +} + + +void event_numeric (irc_session_t * session, unsigned int event, const char * origin, const char ** params, unsigned int count) +{ + if ( event > 400 ) + { + printf ("ERROR %d: %s: %s %s %s %s\n", + event, + origin ? origin : "unknown", + params[0], + count > 1 ? params[1] : "", + count > 2 ? params[2] : "", + count > 3 ? params[3] : ""); + } +} + + +int main (int argc, char **argv) +{ + irc_callbacks_t callbacks; + irc_ctx_t ctx; + irc_session_t * s; + unsigned short port = 6667; + + if ( argc != 4 ) + { + printf ("Usage: %s \n", argv[0]); + return 1; + } + + // Initialize the callbacks + memset (&callbacks, 0, sizeof(callbacks)); + + // Set up the callbacks we will use + callbacks.event_connect = event_connect; + callbacks.event_join = event_join; + callbacks.event_numeric = event_numeric; + + ctx.channel = argv[3]; + ctx.nick = argv[2]; + + // And create the IRC session; 0 means error + s = irc_create_session (&callbacks); + + if ( !s ) + { + printf ("Could not create IRC session\n"); + return 1; + } + + irc_set_ctx (s, &ctx); + irc_option_set (s, LIBIRC_OPTION_STRIPNICKS); + + // If the port number is specified in the server string, use the port 0 so it gets parsed + if ( strchr( argv[1], ':' ) != 0 ) + port = 0; + + // To handle the "SSL certificate verify failed" from command line we allow passing ## in front + // of the server name, and in this case tell libircclient not to verify the cert + if ( argv[1][0] == '#' && argv[1][1] == '#' ) + { + // Skip the first character as libircclient needs only one # for SSL support, i.e. #irc.freenode.net + argv[1]++; + + irc_option_set( s, LIBIRC_OPTION_SSL_NO_VERIFY ); + } + + // Initiate the IRC server connection + if ( irc_connect (s, argv[1], port, 0, argv[2], 0, 0) ) + { + printf ("Could not connect: %s\n", irc_strerror (irc_errno(s))); + return 1; + } + + // and run into forever loop, generating events + if ( irc_run (s) ) + { + printf ("Could not connect or I/O error: %s\n", irc_strerror (irc_errno(s))); + return 1; + } + + return 1; +} diff --git a/libircclient/include/libirc_errors.h b/libircclient/include/libirc_errors.h new file mode 100644 index 0000000..f627fbb --- /dev/null +++ b/libircclient/include/libirc_errors.h @@ -0,0 +1,235 @@ +/* + * Copyright (C) 2004-2012 George Yunaev gyunaev@ulduzsoft.com + * + * This library is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; either version 3 of the License, or (at your + * option) any later version. + * + * This library 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 Lesser General Public + * License for more details. + */ + +#ifndef INCLUDE_IRC_ERRORS_H +#define INCLUDE_IRC_ERRORS_H + +#ifndef IN_INCLUDE_LIBIRC_H + #error This file should not be included directly, include just libircclient.h +#endif + + +/*! brief No error + * \ingroup errorcodes + */ +#define LIBIRC_ERR_OK 0 + + +/*! \brief Invalid argument + * + * An invalid value was given for one of the arguments to a function. + * For example, supplying the NULL value for \a channel argument of + * irc_cmd_join() produces LIBIRC_ERR_INVAL error. You should fix the code. + * + * \ingroup errorcodes + */ +#define LIBIRC_ERR_INVAL 1 + + +/*! \brief Could not resolve host. + * + * The host name supplied for irc_connect() function could not be resolved + * into valid IP address. Usually means that host name is invalid. + * + * \ingroup errorcodes + */ +#define LIBIRC_ERR_RESOLV 2 + + +/*! \brief Could not create socket. + * + * The new socket could not be created or made non-blocking. Usually means + * that the server is out of resources, or (rarely :) a bug in libircclient. + * + * \ingroup errorcodes + */ +#define LIBIRC_ERR_SOCKET 3 + + +/*! \brief Could not connect. + * + * The socket could not connect to the IRC server, or to the destination DCC + * part. Usually means that either the IRC server is down or its address is + * invalid. For DCC the reason usually is the firewall on your or destination + * computer, which refuses DCC transfer. + * + * \sa irc_run irc_connect + * \ingroup errorcodes + */ +#define LIBIRC_ERR_CONNECT 4 + + +/*! \brief Connection closed by remote peer. + * + * The IRC connection was closed by the IRC server (which could mean that an + * IRC operator just have banned you from the server :)), or the DCC connection + * was closed by remote peer - for example, the other side just quits his mIrc. + * Usually it is not an error. + * + * \sa irc_run irc_connect irc_dcc_callback_t + * \ingroup errorcodes + */ +#define LIBIRC_ERR_CLOSED 5 + + +/*! \brief Out of memory + * + * There are two possible reasons for this error. First is that memory could + * not be allocated for libircclient use, and this error usually is fatal. + * Second reason is that the command queue (which keeps command ready to be + * sent to the IRC server) is full, and could not accept more commands yet. + * In this case you should just wait, and repeat the command later. + * + * \ingroup errorcodes + */ +#define LIBIRC_ERR_NOMEM 6 + + +/*! \brief Could not accept new connection + * + * A DCC chat/send connection from the remote peer could not be accepted. + * Either the connection was just terminated before it is accepted, or there + * is a bug in libircclient. + * + * \ingroup errorcodes + */ +#define LIBIRC_ERR_ACCEPT 7 + + +/*! \brief Could not send this + * + * A \a filename supplied to irc_dcc_sendfile() could not be sent. Either is + * is not a file (a directory or a socket, for example), or it is not readable. * + * + * \sa LIBIRC_ERR_OPENFILE + * \ingroup errorcodes + */ +#define LIBIRC_ERR_NODCCSEND 9 + + +/*! \brief Could not read DCC file or socket + * + * Either a DCC file could not be read (for example, was truncated during + * sending), or a DCC socket returns a read error, which usually means that + * the network connection is terminated. + * + * \ingroup errorcodes + */ +#define LIBIRC_ERR_READ 10 + + +/*! \brief Could not write DCC file or socket + * + * Either a DCC file could not be written (for example, there is no free space + * on disk), or a DCC socket returns a write error, which usually means that + * the network connection is terminated. + * + * \ingroup errorcodes + */ +#define LIBIRC_ERR_WRITE 11 + + +/*! \brief Invalid state + * + * The function is called when it is not allowed to be called. For example, + * irc_cmd_join() was called before the connection to IRC server succeed, and + * ::event_connect is called. + * + * \ingroup errorcodes + */ +#define LIBIRC_ERR_STATE 12 + + +/*! \brief Operation timed out + * + * The DCC request is timed out. + * There is a timer for each DCC request, which tracks connecting, accepting + * and non-accepted/declined DCC requests. For every request this timer + * is currently 60 seconds. If the DCC request was not connected, accepted + * or declined during this time, it will be terminated with this error. + * + * \ingroup errorcodes + */ +#define LIBIRC_ERR_TIMEOUT 13 + + +/*! \brief Could not open file for DCC send + * + * The file specified in irc_dcc_sendfile() could not be opened. + * + * \ingroup errorcodes + */ +#define LIBIRC_ERR_OPENFILE 14 + + +/*! \brief IRC server connection terminated + * + * The connection to the IRC server was terminated - possibly, by network + * error. Try to irc_connect() again. + * + * \ingroup errorcodes + */ +#define LIBIRC_ERR_TERMINATED 15 + + +/*! \brief IPv6 not supported + * + * The function which requires IPv6 support was called, but the IPv6 support was not compiled + * into the application + * + * \ingroup errorcodes + */ +#define LIBIRC_ERR_NOIPV6 16 + + +/*! \brief SSL not supported + * + * The SSL connection was required but the library was not compiled with SSL support + * + * \ingroup errorcodes + */ +#define LIBIRC_ERR_SSL_NOT_SUPPORTED 17 + + +/*! \brief SSL initialization failed + * + * The SSL connection was required but the library was not compiled with SSL support + * + * \ingroup errorcodes + */ +#define LIBIRC_ERR_SSL_INIT_FAILED 18 + + +/*! \brief SSL connection failed + * + * SSL handshare failed when attempting to connect to the server. Typically this means you're trying + * to use SSL but attempting to connect to a non-SSL port. + * \ingroup errorcodes + */ +#define LIBIRC_ERR_CONNECT_SSL_FAILED 19 + + +/*! \brief SSL certificate verify failed + * + * The server is using the self-signed certificate. Use LIBIRC_OPTION_SSL_NO_VERIFY option to connect to it. + * \ingroup errorcodes + */ +#define LIBIRC_ERR_SSL_CERT_VERIFY_FAILED 20 + + +// Internal max error value count. +// If you added more errors, add them to errors.c too! +#define LIBIRC_ERR_MAX 21 + +#endif /* INCLUDE_IRC_ERRORS_H */ diff --git a/libircclient/include/libirc_events.h b/libircclient/include/libirc_events.h new file mode 100644 index 0000000..15711f7 --- /dev/null +++ b/libircclient/include/libirc_events.h @@ -0,0 +1,389 @@ +/* + * Copyright (C) 2004-2012 George Yunaev gyunaev@ulduzsoft.com + * + * This library is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; either version 3 of the License, or (at your + * option) any later version. + * + * This library 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 Lesser General Public + * License for more details. + */ + + +#ifndef INCLUDE_IRC_EVENTS_H +#define INCLUDE_IRC_EVENTS_H + + +#ifndef IN_INCLUDE_LIBIRC_H + #error This file should not be included directly, include just libircclient.h +#endif + + + +/*! + * \fn typedef void (*irc_event_callback_t) (irc_session_t * session, const char * event, const char * origin, const char ** params, unsigned int count) + * \brief A most common event callback + * + * \param session the session, which generates an event + * \param event the text name of the event. Useful in case you use a single + * event handler for several events simultaneously. + * \param origin the originator of the event. See the note below. + * \param params a list of event params. Depending on the event nature, it + * could have zero or more params. The actual number of params + * is specified in count. None of the params can be NULL, but + * 'params' pointer itself could be NULL for some events. + * \param count the total number of params supplied. + * + * Every event generates a callback. This callback is generated by most events. + * Depending on the event nature, it can provide zero or more params. For each + * event, the number of provided params is fixed, and their meaning is + * described. + * + * Every event has origin, though the \a origin variable may be NULL, which + * means that event origin is unknown. The origin usually looks like + * nick!host\@ircserver, i.e. like tim!home\@irc.krasnogorsk.ru. Such origins + * can not be used in IRC commands, and need to be stripped (i.e. host and + * server part should be cut off) before using. This can be done either + * explicitly, by calling irc_target_get_nick(), or implicitly for all the + * events - by setting the #LIBIRC_OPTION_STRIPNICKS option with irc_option_set(). + * + * \ingroup events + */ +typedef void (*irc_event_callback_t) (irc_session_t * session, const char * event, const char * origin, const char ** params, unsigned int count); + + +/*! + * \fn typedef void (*irc_eventcode_callback_t) (irc_session_t * session, unsigned int event, const char * origin, const char ** params, unsigned int count) + * \brief A numeric event callback + * + * \param session the session, which generates an event + * \param event the numeric code of the event. Useful in case you use a + * single event handler for several events simultaneously. + * \param origin the originator of the event. See the note below. + * \param params a list of event params. Depending on the event nature, it + * could have zero or more params. The actual number of params + * is specified in count. None of the params can be NULL, but + * 'params' pointer itself could be NULL for some events. + * \param count the total number of params supplied. + * + * Most times in reply to your actions the IRC server generates numeric + * callbacks. Most of them are error codes, and some of them mark list start + * and list stop markers. Every code has its own set of params; for details + * you can either experiment, or read RFC 1459. + * + * Every event has origin, though the \a origin variable may be NULL, which + * means that event origin is unknown. The origin usually looks like + * nick!host\@ircserver, i.e. like tim!home\@irc.krasnogorsk.ru. Such origins + * can not be used in IRC commands, and need to be stripped (i.e. host and + * server part should be cut off) before using. This can be done either + * explicitly, by calling irc_target_get_nick(), or implicitly for all the + * events - by setting the #LIBIRC_OPTION_STRIPNICKS option with irc_option_set(). + * + * \ingroup events + */ +typedef void (*irc_eventcode_callback_t) (irc_session_t * session, unsigned int event, const char * origin, const char ** params, unsigned int count); + + +/*! + * \fn typedef void (*irc_event_dcc_chat_t) (irc_session_t * session, const char * nick, const char * addr, irc_dcc_t dccid) + * \brief A remote DCC CHAT request callback + * + * \param session the session, which generates an event + * \param nick the person who requested DCC CHAT with you. + * \param addr the person's IP address in decimal-dot notation. + * \param dccid an id associated with this request. Use it in calls to + * irc_dcc_accept() or irc_dcc_decline(). + * + * This callback is called when someone requests DCC CHAT with you. In respond + * you should call either irc_dcc_accept() to accept chat request, or + * irc_dcc_decline() to decline chat request. + * + * \sa irc_dcc_accept or irc_dcc_decline + * \ingroup events + */ +typedef void (*irc_event_dcc_chat_t) (irc_session_t * session, const char * nick, const char * addr, irc_dcc_t dccid); + + +/*! + * \fn typedef void (*irc_event_dcc_send_t) (irc_session_t * session, const char * nick, const char * addr, const char * filename, unsigned long size, irc_dcc_t dccid) + * \brief A remote DCC CHAT request callback + * + * \param session the session, which generates an event + * \param nick the person who requested DCC CHAT with you. + * \param addr the person's IP address in decimal-dot notation. + * \param filename the sent filename. + * \param size the filename size. + * \param dccid an id associated with this request. Use it in calls to + * irc_dcc_accept() or irc_dcc_decline(). + * + * This callback is called when someone wants to send a file to you using + * DCC SEND. As with chat, in respond you should call either irc_dcc_accept() + * to accept this request and receive the file, or irc_dcc_decline() to + * decline this request. + * + * \sa irc_dcc_accept or irc_dcc_decline + * \ingroup events + */ +typedef void (*irc_event_dcc_send_t) (irc_session_t * session, const char * nick, const char * addr, const char * filename, unsigned long size, irc_dcc_t dccid); + + +/*! \brief Event callbacks structure. + * + * All the communication with the IRC network is based on events. Generally + * speaking, event is anything generated by someone else in the network, + * or by the IRC server itself. "Someone sends you a message", "Someone + * has joined the channel", "Someone has quits IRC" - all these messages + * are events. + * + * Every event has its own event handler, which is called when the + * appropriate event is received. You don't have to define all the event + * handlers; define only the handlers for the events you need to intercept. + * + * Most event callbacks are the types of ::irc_event_callback_t. There are + * also events, which generate ::irc_eventcode_callback_t, + * ::irc_event_dcc_chat_t and ::irc_event_dcc_send_t callbacks. + * + * \ingroup events + */ +typedef struct +{ + /*! + * The "on_connect" event is triggered when the client successfully + * connects to the server, and could send commands to the server. + * No extra params supplied; \a params is 0. + */ + irc_event_callback_t event_connect; + + /*! + * The "nick" event is triggered when the client receives a NICK message, + * meaning that someone (including you) on a channel with the client has + * changed their nickname. + * + * \param origin the person, who changes the nick. Note that it can be you! + * \param params[0] mandatory, contains the new nick. + */ + irc_event_callback_t event_nick; + + /*! + * The "quit" event is triggered upon receipt of a QUIT message, which + * means that someone on a channel with the client has disconnected. + * + * \param origin the person, who is disconnected + * \param params[0] optional, contains the reason message (user-specified). + */ + irc_event_callback_t event_quit; + + /*! + * The "join" event is triggered upon receipt of a JOIN message, which + * means that someone has entered a channel that the client is on. + * + * \param origin the person, who joins the channel. By comparing it with + * your own nickname, you can check whether your JOIN + * command succeed. + * \param params[0] mandatory, contains the channel name. + */ + irc_event_callback_t event_join; + + /*! + * The "part" event is triggered upon receipt of a PART message, which + * means that someone has left a channel that the client is on. + * + * \param origin the person, who leaves the channel. By comparing it with + * your own nickname, you can check whether your PART + * command succeed. + * \param params[0] mandatory, contains the channel name. + * \param params[1] optional, contains the reason message (user-defined). + */ + irc_event_callback_t event_part; + + /*! + * The "mode" event is triggered upon receipt of a channel MODE message, + * which means that someone on a channel with the client has changed the + * channel's parameters. + * + * \param origin the person, who changed the channel mode. + * \param params[0] mandatory, contains the channel name. + * \param params[1] mandatory, contains the changed channel mode, like + * '+t', '-i' and so on. + * \param params[2] optional, contains the mode argument (for example, a + * key for +k mode, or user who got the channel operator status for + * +o mode) + */ + irc_event_callback_t event_mode; + + /*! + * The "umode" event is triggered upon receipt of a user MODE message, + * which means that your user mode has been changed. + * + * \param origin the person, who changed the channel mode. + * \param params[0] mandatory, contains the user changed mode, like + * '+t', '-i' and so on. + */ + irc_event_callback_t event_umode; + + /*! + * The "topic" event is triggered upon receipt of a TOPIC message, which + * means that someone on a channel with the client has changed the + * channel's topic. + * + * \param origin the person, who changes the channel topic. + * \param params[0] mandatory, contains the channel name. + * \param params[1] optional, contains the new topic. + */ + irc_event_callback_t event_topic; + + /*! + * The "kick" event is triggered upon receipt of a KICK message, which + * means that someone on a channel with the client (or possibly the + * client itself!) has been forcibly ejected. + * + * \param origin the person, who kicked the poor. + * \param params[0] mandatory, contains the channel name. + * \param params[0] optional, contains the nick of kicked person. + * \param params[1] optional, contains the kick text + */ + irc_event_callback_t event_kick; + + /*! + * The "channel" event is triggered upon receipt of a PRIVMSG message + * to an entire channel, which means that someone on a channel with + * the client has said something aloud. Your own messages don't trigger + * PRIVMSG event. + * + * \param origin the person, who generates the message. + * \param params[0] mandatory, contains the channel name. + * \param params[1] optional, contains the message text + */ + irc_event_callback_t event_channel; + + /*! + * The "privmsg" event is triggered upon receipt of a PRIVMSG message + * which is addressed to one or more clients, which means that someone + * is sending the client a private message. + * + * \param origin the person, who generates the message. + * \param params[0] mandatory, contains your nick. + * \param params[1] optional, contains the message text + */ + irc_event_callback_t event_privmsg; + + /*! + * The "notice" event is triggered upon receipt of a NOTICE message + * which means that someone has sent the client a public or private + * notice. According to RFC 1459, the only difference between NOTICE + * and PRIVMSG is that you should NEVER automatically reply to NOTICE + * messages. Unfortunately, this rule is frequently violated by IRC + * servers itself - for example, NICKSERV messages require reply, and + * are NOTICEs. + * + * \param origin the person, who generates the message. + * \param params[0] mandatory, contains the target nick name. + * \param params[1] optional, contains the message text + */ + irc_event_callback_t event_notice; + + /*! + * The "channel_notice" event is triggered upon receipt of a NOTICE + * message which means that someone has sent the client a public + * notice. According to RFC 1459, the only difference between NOTICE + * and PRIVMSG is that you should NEVER automatically reply to NOTICE + * messages. Unfortunately, this rule is frequently violated by IRC + * servers itself - for example, NICKSERV messages require reply, and + * are NOTICEs. + * + * \param origin the person, who generates the message. + * \param params[0] mandatory, contains the channel name. + * \param params[1] optional, contains the message text + */ + irc_event_callback_t event_channel_notice; + + /*! + * The "invite" event is triggered upon receipt of an INVITE message, + * which means that someone is permitting the client's entry into a +i + * channel. + * + * \param origin the person, who INVITEs you. + * \param params[0] mandatory, contains your nick. + * \param params[1] mandatory, contains the channel name you're invited into. + * + * \sa irc_cmd_invite irc_cmd_chanmode_invite + */ + irc_event_callback_t event_invite; + + /*! + * The "ctcp" event is triggered when the client receives the CTCP + * request. By default, the built-in CTCP request handler is used. The + * build-in handler automatically replies on most CTCP messages, so you + * will rarely need to override it. + * + * \param origin the person, who generates the message. + * \param params[0] mandatory, the complete CTCP message, including its + * arguments. + * + * Mirc generates PING, FINGER, VERSION, TIME and ACTION messages, + * check the source code of \c libirc_event_ctcp_internal function to + * see how to write your own CTCP request handler. Also you may find + * useful this question in FAQ: \ref faq4 + */ + irc_event_callback_t event_ctcp_req; + + /*! + * The "ctcp" event is triggered when the client receives the CTCP reply. + * + * \param origin the person, who generates the message. + * \param params[0] mandatory, the CTCP message itself with its arguments. + */ + irc_event_callback_t event_ctcp_rep; + + /*! + * The "action" event is triggered when the client receives the CTCP + * ACTION message. These messages usually looks like:\n + * \code + * [23:32:55] * Tim gonna sleep. + * \endcode + * + * \param origin the person, who generates the message. + * \param params[0] mandatory, the ACTION message. + */ + irc_event_callback_t event_ctcp_action; + + /*! + * The "unknown" event is triggered upon receipt of any number of + * unclassifiable miscellaneous messages, which aren't handled by the + * library. + */ + irc_event_callback_t event_unknown; + + /*! + * The "numeric" event is triggered upon receipt of any numeric response + * from the server. There is a lot of such responses, see the full list + * here: \ref rfcnumbers. + * + * See the params in ::irc_eventcode_callback_t specification. + */ + irc_eventcode_callback_t event_numeric; + + /*! + * The "dcc chat" event is triggered when someone requests a DCC CHAT from + * you. + * + * See the params in ::irc_event_dcc_chat_t specification. + */ + irc_event_dcc_chat_t event_dcc_chat_req; + + /*! + * The "dcc chat" event is triggered when someone wants to send a file + * to you via DCC SEND request. + * + * See the params in ::irc_event_dcc_send_t specification. + */ + irc_event_dcc_send_t event_dcc_send_req; + + +} irc_callbacks_t; + + +#endif /* INCLUDE_IRC_EVENTS_H */ diff --git a/libircclient/include/libirc_options.h b/libircclient/include/libirc_options.h new file mode 100644 index 0000000..7494f23 --- /dev/null +++ b/libircclient/include/libirc_options.h @@ -0,0 +1,56 @@ +/* + * Copyright (C) 2004-2012 George Yunaev gyunaev@ulduzsoft.com + * + * This library is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; either version 3 of the License, or (at your + * option) any later version. + * + * This library 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 Lesser General Public + * License for more details. + */ + +#ifndef INCLUDE_IRC_OPTIONS_H +#define INCLUDE_IRC_OPTIONS_H + +#ifndef IN_INCLUDE_LIBIRC_H + #error This file should not be included directly, include just libircclient.h +#endif + +/*! + * enables additional debug output + * \ingroup options + */ +#define LIBIRC_OPTION_DEBUG (1 << 1) + +/*! \brief allows to strip origins automatically. + * + * For every IRC server event, the event origin is sent in standard form: + * nick!host\@ircserver, i.e. like tim!home\@irc.freenet.org. Such origins + * can not be used in IRC commands, and need to be stripped (i.e. host and + * server part should be cut off) before using. This can be done either + * explicitly, by calling irc_target_get_nick(), or implicitly for all the + * events - by setting this option with irc_option_set(). + * \ingroup options + */ +#define LIBIRC_OPTION_STRIPNICKS (1 << 2) + + +/*! \brief Disables the certificate verification for SSL connections + * + * By default the SSL connection authenticy is ensured by verifying that the certificate + * presented by the server is signed by a known trusted certificate authority. Since those + * typically cost money, some IRC servers use the self-signed certificates. They provide the + * benefits of the SSL connection but since they are not signed by the Certificate Authority, + * their authencity cannot be verified. This option, if set, disables the certificate + * verification - the library will accept any certificate presented by the server. + * + * This option must be set before the irc_connect function is called. + * \ingroup options + */ +#define LIBIRC_OPTION_SSL_NO_VERIFY (1 << 3) + + +#endif /* INCLUDE_IRC_OPTIONS_H */ diff --git a/libircclient/include/libirc_rfcnumeric.h b/libircclient/include/libirc_rfcnumeric.h new file mode 100644 index 0000000..02c1337 --- /dev/null +++ b/libircclient/include/libirc_rfcnumeric.h @@ -0,0 +1,1255 @@ +/* + * Copyright (C) 2004-2012 George Yunaev gyunaev@ulduzsoft.com + * + * This library is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; either version 3 of the License, or (at your + * option) any later version. + * + * This library 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 Lesser General Public + * License for more details. + */ + +/*! + * \file libirc_rfcnumeric.h + * \author Georgy Yunaev + * \version 1.0 + * \date 09.2004 + * \brief This file defines RFC numeric reply codes, which should be used in + * ::event_numeric callback. Every code also has a comment regarding its + * arguments. + */ + +#ifndef INCLUDE_IRC_RFCNUMERIC_H +#define INCLUDE_IRC_RFCNUMERIC_H + + +/*! \brief 001 Welcome to the Internet Relay Network + \!\\@\ + * + * The server sends replies 001 to 004 to a user upon successful registration. + * + * \ingroup rfcnumbers + */ +#define LIBIRC_RFC_RPL_WELCOME 001 + + +/*! \brief 002 Your host is \, running version \ + * + * The server sends replies 001 to 004 to a user upon successful registration. + * + * \ingroup rfcnumbers + */ +#define LIBIRC_RFC_RPL_YOURHOST 002 + + +/*! \brief 003 This server was created \ + * + * The server sends replies 001 to 004 to a user upon successful registration. + * + * \ingroup rfcnumbers + */ +#define LIBIRC_RFC_RPL_CREATED 003 + + +/*! \brief 004 \ \ \ + \ + * + * The server sends replies 001 to 004 to a user upon successful registration. + * + * \ingroup rfcnumbers + */ +#define LIBIRC_RFC_RPL_MYINFO 004 + + +/*! \brief 005 Try server \, port \ + * + * Sent by the server to a user to suggest an alternative server. This is often used when the connection is refused because the server is already full. + * + * \ingroup rfcnumbers + */ +#define LIBIRC_RFC_RPL_BOUNCE 005 + + +/*! \brief 302 :*1\ *( + * + * No description available in RFC + * + * \ingroup rfcnumbers + */ +#define LIBIRC_RFC_RPL_USERHOST 302 + + +/*! \brief 303 :*1\ *( + * + * No description available in RFC + * + * \ingroup rfcnumbers + */ +#define LIBIRC_RFC_RPL_ISON 303 + + +/*! \brief 301 \ :\ + * + * No description available in RFC + * + * \ingroup rfcnumbers + */ +#define LIBIRC_RFC_RPL_AWAY 301 + + +/*! \brief 305 :You are no longer marked as being away + * + * No description available in RFC + * + * \ingroup rfcnumbers + */ +#define LIBIRC_RFC_RPL_UNAWAY 305 + + +/*! \brief 306 :You have been marked as being away + * + * These replies are used with the AWAY command (if allowed). RPL_AWAY is sent to any client sending a PRIVMSG to a client which is away. RPL_AWAY is only sent by the server to which the client is connected. Replies RPL_UNAWAY and RPL_NOWAWAY are sent when the client removes and sets an AWAY message. + * + * \ingroup rfcnumbers + */ +#define LIBIRC_RFC_RPL_NOWAWAY 306 + + +/*! \brief 311 \ \ \ * :\ + * + * No description available in RFC + * + * \ingroup rfcnumbers + */ +#define LIBIRC_RFC_RPL_WHOISUSER 311 + + +/*! \brief 312 \ \ :\ + * + * No description available in RFC + * + * \ingroup rfcnumbers + */ +#define LIBIRC_RFC_RPL_WHOISSERVER 312 + + +/*! \brief 313 \ :is an IRC operator + * + * No description available in RFC + * + * \ingroup rfcnumbers + */ +#define LIBIRC_RFC_RPL_WHOISOPERATOR 313 + + +/*! \brief 317 \ \ :seconds idle + * + * No description available in RFC + * + * \ingroup rfcnumbers + */ +#define LIBIRC_RFC_RPL_WHOISIDLE 317 + + +/*! \brief 318 \ :End of WHOIS list + * + * No description available in RFC + * + * \ingroup rfcnumbers + */ +#define LIBIRC_RFC_RPL_ENDOFWHOIS 318 + + +/*! \brief 319 " :*( ( "\@" / "+" ) \ " " )" + * + * No description available in RFC + * + * \ingroup rfcnumbers + */ +#define LIBIRC_RFC_RPL_WHOISCHANNELS 319 + + +/*! \brief 314 \ \ \ * :\ + * + * No description available in RFC + * + * \ingroup rfcnumbers + */ +#define LIBIRC_RFC_RPL_WHOWASUSER 314 + + +/*! \brief 369 \ :End of WHOWAS + * + * When replying to a WHOWAS message, a server MUST use the replies RPL_WHOWASUSER, RPL_WHOISSERVER or ERR_WASNOSUCHNICK for each nickname in the presented list. At the end of all reply batches, there MUST be RPL_ENDOFWHOWAS (even if there was only one reply and it was an error). + * + * \ingroup rfcnumbers + */ +#define LIBIRC_RFC_RPL_ENDOFWHOWAS 369 + + +/*! \brief 322 \ \<# visible\> :\ + * + * No description available in RFC + * + * \ingroup rfcnumbers + */ +#define LIBIRC_RFC_RPL_LIST 322 + + +/*! \brief 323 :End of LIST + * + * Replies RPL_LIST, RPL_LISTEND mark the actual replies with data and end of the server's response to a LIST command. If there are no channels available to return, only the end reply MUST be sent. + * + * \ingroup rfcnumbers + */ +#define LIBIRC_RFC_RPL_LISTEND 323 + + +/*! \brief 325 \ \ + * + * No description available in RFC + * + * \ingroup rfcnumbers + */ +#define LIBIRC_RFC_RPL_UNIQOPIS 325 + + +/*! \brief 324 \ \ \ + * + * No description available in RFC + * + * \ingroup rfcnumbers + */ +#define LIBIRC_RFC_RPL_CHANNELMODEIS 324 + + +/*! \brief 331 \ :No topic is set + * + * No description available in RFC + * + * \ingroup rfcnumbers + */ +#define LIBIRC_RFC_RPL_NOTOPIC 331 + + +/*! \brief 332 \ :\ + * + * When sending a TOPIC message to determine the channel topic, one of two replies is sent. If the topic is set, RPL_TOPIC is sent back else RPL_NOTOPIC. + * + * \ingroup rfcnumbers + */ +#define LIBIRC_RFC_RPL_TOPIC 332 + + +/*! \brief 341 \ \ + * + * Returned by the server to indicate that the attempted INVITE message was successful and is being passed onto the end client. + * + * \ingroup rfcnumbers + */ +#define LIBIRC_RFC_RPL_INVITING 341 + + +/*! \brief 342 \ :Summoning user to IRC + * + * Returned by a server answering a SUMMON message to indicate that it is summoning that user. + * + * \ingroup rfcnumbers + */ +#define LIBIRC_RFC_RPL_SUMMONING 342 + + +/*! \brief 346 \ \ + * + * No description available in RFC + * + * \ingroup rfcnumbers + */ +#define LIBIRC_RFC_RPL_INVITELIST 346 + + +/*! \brief 347 \ :End of channel invite list + * + * When listing the 'invitations masks' for a given channel, a server is required to send the list back using the RPL_INVITELIST and RPL_ENDOFINVITELIST messages. A separate RPL_INVITELIST is sent for each active mask. After the masks have been listed (or if none present) a RPL_ENDOFINVITELIST MUST be sent. + * + * \ingroup rfcnumbers + */ +#define LIBIRC_RFC_RPL_ENDOFINVITELIST 347 + + +/*! \brief 348 \ \ + * + * No description available in RFC + * + * \ingroup rfcnumbers + */ +#define LIBIRC_RFC_RPL_EXCEPTLIST 348 + + +/*! \brief 349 \ :End of channel exception list + * + * When listing the 'exception masks' for a given channel, a server is required to send the list back using the RPL_EXCEPTLIST and RPL_ENDOFEXCEPTLIST messages. A separate RPL_EXCEPTLIST is sent for each active mask. After the masks have been listed (or if none present) a RPL_ENDOFEXCEPTLIST MUST be sent. + * + * \ingroup rfcnumbers + */ +#define LIBIRC_RFC_RPL_ENDOFEXCEPTLIST 349 + + +/*! \brief 351 \.\ \ :\ + * + * Reply by the server showing its version details. The \ is the version of the software being used (including any patchlevel revisions) and the \ is used to indicate if the server is running in "debug mode". The "comments" field may contain any comments about the version or further version details. + * + * \ingroup rfcnumbers + */ +#define LIBIRC_RFC_RPL_VERSION 351 + + +/*! \brief 352 \ \ \ \ \ + ( "H + * + * No description available in RFC + * + * \ingroup rfcnumbers + */ +#define LIBIRC_RFC_RPL_WHOREPLY 352 + + +/*! \brief 315 \ :End of WHO list + * + * The RPL_WHOREPLY and RPL_ENDOFWHO pair are used to answer a WHO message. The RPL_WHOREPLY is only sent if there is an appropriate match to the WHO query. If there is a list of parameters supplied with a WHO message, a RPL_ENDOFWHO MUST be sent after processing each list item with \ being the item. + * + * \ingroup rfcnumbers + */ +#define LIBIRC_RFC_RPL_ENDOFWHO 315 + + +/*! \brief 353 ( "= + * + * No description available in RFC + * + * \ingroup rfcnumbers + */ +#define LIBIRC_RFC_RPL_NAMREPLY 353 + + +/*! \brief 366 \ :End of NAMES list + * + * To reply to a NAMES message, a reply pair consisting of RPL_NAMREPLY and RPL_ENDOFNAMES is sent by the server back to the client. If there is no channel found as in the query, then only RPL_ENDOFNAMES is returned. The exception to this is when a NAMES message is sent with no parameters and all visible channels and contents are sent back in a series of RPL_NAMEREPLY messages with a RPL_ENDOFNAMES to mark the end. + * + * \ingroup rfcnumbers + */ +#define LIBIRC_RFC_RPL_ENDOFNAMES 366 + + +/*! \brief 364 \ \ :\ \ + * + * No description available in RFC + * + * \ingroup rfcnumbers + */ +#define LIBIRC_RFC_RPL_LINKS 364 + + +/*! \brief 365 \ :End of LINKS list + * + * In replying to the LINKS message, a server MUST send replies back using the RPL_LINKS numeric and mark the end of the list using an RPL_ENDOFLINKS reply. + * + * \ingroup rfcnumbers + */ +#define LIBIRC_RFC_RPL_ENDOFLINKS 365 + + +/*! \brief 367 \ \ + * + * No description available in RFC + * + * \ingroup rfcnumbers + */ +#define LIBIRC_RFC_RPL_BANLIST 367 + + +/*! \brief 368 \ :End of channel ban list + * + * When listing the active 'bans' for a given channel, a server is required to send the list back using the RPL_BANLIST and RPL_ENDOFBANLIST messages. A separate RPL_BANLIST is sent for each active banmask. After the banmasks have been listed (or if none present) a RPL_ENDOFBANLIST MUST be sent. + * + * \ingroup rfcnumbers + */ +#define LIBIRC_RFC_RPL_ENDOFBANLIST 368 + + +/*! \brief 371 :\ + * + * No description available in RFC + * + * \ingroup rfcnumbers + */ +#define LIBIRC_RFC_RPL_INFO 371 + + +/*! \brief 374 :End of INFO list + * + * A server responding to an INFO message is required to send all its 'info' in a series of RPL_INFO messages with a RPL_ENDOFINFO reply to indicate the end of the replies. + * + * \ingroup rfcnumbers + */ +#define LIBIRC_RFC_RPL_ENDOFINFO 374 + + +/*! \brief 375 :- \ Message of the day - + * + * No description available in RFC + * + * \ingroup rfcnumbers + */ +#define LIBIRC_RFC_RPL_MOTDSTART 375 + + +/*! \brief 372 :- \ + * + * No description available in RFC + * + * \ingroup rfcnumbers + */ +#define LIBIRC_RFC_RPL_MOTD 372 + + +/*! \brief 376 :End of MOTD command + * + * When responding to the MOTD message and the MOTD file is found, the file is displayed line by line, with each line no longer than 80 characters, using RPL_MOTD format replies. These MUST be surrounded by a RPL_MOTDSTART (before the RPL_MOTDs) and an RPL_ENDOFMOTD (after). + * + * \ingroup rfcnumbers + */ +#define LIBIRC_RFC_RPL_ENDOFMOTD 376 + + +/*! \brief 381 :You are now an IRC operator + * + * RPL_YOUREOPER is sent back to a client which has just successfully issued an OPER message and gained operator status. + * + * \ingroup rfcnumbers + */ +#define LIBIRC_RFC_RPL_YOUREOPER 381 + + +/*! \brief 382 \ :Rehashing + * + * If the REHASH option is used and an operator sends a REHASH message, an RPL_REHASHING is sent back to the operator. + * + * \ingroup rfcnumbers + */ +#define LIBIRC_RFC_RPL_REHASHING 382 + + +/*! \brief 383 You are service \ + * + * Sent by the server to a service upon successful registration. + * + * \ingroup rfcnumbers + */ +#define LIBIRC_RFC_RPL_YOURESERVICE 383 + + +/*! \brief 391 \ :\ + * + * When replying to the TIME message, a server MUST send the reply using the RPL_TIME format above. The string showing the time need only contain the correct day and time there. There is no further requirement for the time string. + * + * \ingroup rfcnumbers + */ +#define LIBIRC_RFC_RPL_TIME 391 + + +/*! \brief 392 :UserID Terminal Host + * + * No description available in RFC + * + * \ingroup rfcnumbers + */ +#define LIBIRC_RFC_RPL_USERSSTART 392 + + +/*! \brief 393 :\ \ \ + * + * No description available in RFC + * + * \ingroup rfcnumbers + */ +#define LIBIRC_RFC_RPL_USERS 393 + + +/*! \brief 394 :End of users + * + * No description available in RFC + * + * \ingroup rfcnumbers + */ +#define LIBIRC_RFC_RPL_ENDOFUSERS 394 + + +/*! \brief 395 :Nobody logged in + * + * If the USERS message is handled by a server, the replies RPL_USERSTART, RPL_USERS, RPL_ENDOFUSERS and RPL_NOUSERS are used. RPL_USERSSTART MUST be sent first, following by either a sequence of RPL_USERS or a single RPL_NOUSER. Following this is RPL_ENDOFUSERS. + * + * \ingroup rfcnumbers + */ +#define LIBIRC_RFC_RPL_NOUSERS 395 + + +/*! \brief 200 Link \ \ + \ V\ + \ \ + \ + * + * No description available in RFC + * + * \ingroup rfcnumbers + */ +#define LIBIRC_RFC_RPL_TRACELINK 200 + + +/*! \brief 201 Try. \ \ + * + * No description available in RFC + * + * \ingroup rfcnumbers + */ +#define LIBIRC_RFC_RPL_TRACECONNECTING 201 + + +/*! \brief 202 H.S. \ \ + * + * No description available in RFC + * + * \ingroup rfcnumbers + */ +#define LIBIRC_RFC_RPL_TRACEHANDSHAKE 202 + + +/*! \brief 203 ???? \ [\] + * + * No description available in RFC + * + * \ingroup rfcnumbers + */ +#define LIBIRC_RFC_RPL_TRACEUNKNOWN 203 + + +/*! \brief 204 Oper \ \ + * + * No description available in RFC + * + * \ingroup rfcnumbers + */ +#define LIBIRC_RFC_RPL_TRACEOPERATOR 204 + + +/*! \brief 205 User \ \ + * + * No description available in RFC + * + * \ingroup rfcnumbers + */ +#define LIBIRC_RFC_RPL_TRACEUSER 205 + + +/*! \brief 206 Serv \ \S \C \ + \\@\ V\ + * + * No description available in RFC + * + * \ingroup rfcnumbers + */ +#define LIBIRC_RFC_RPL_TRACESERVER 206 + + +/*! \brief 207 Service \ \ \ \ + * + * No description available in RFC + * + * \ingroup rfcnumbers + */ +#define LIBIRC_RFC_RPL_TRACESERVICE 207 + + +/*! \brief 208 \ 0 \ + * + * No description available in RFC + * + * \ingroup rfcnumbers + */ +#define LIBIRC_RFC_RPL_TRACENEWTYPE 208 + + +/*! \brief 209 Class \ \ + * + * No description available in RFC + * + * \ingroup rfcnumbers + */ +#define LIBIRC_RFC_RPL_TRACECLASS 209 + + +/*! \brief 261 File \ \ + * + * No description available in RFC + * + * \ingroup rfcnumbers + */ +#define LIBIRC_RFC_RPL_TRACELOG 261 + + +/*! \brief 262 \ \ :End of TRACE + * + * The RPL_TRACE* are all returned by the server in response to the TRACE message. How many are returned is dependent on the TRACE message and whether it was sent by an operator or not. There is no predefined order for which occurs first. Replies RPL_TRACEUNKNOWN, RPL_TRACECONNECTING and RPL_TRACEHANDSHAKE are all used for connections which have not been fully established and are either unknown, still attempting to connect or in the process of completing the 'server handshake'. RPL_TRACELINK is sent by any server which handles a TRACE message and has to pass it on to another server. The list of RPL_TRACELINKs sent in response to a TRACE command traversing the IRC network should reflect the actual connectivity of the servers themselves along that path. RPL_TRACENEWTYPE is to be used for any connection which does not fit in the other categories but is being displayed anyway. RPL_TRACEEND is sent to indicate the end of the list. + * + * \ingroup rfcnumbers + */ +#define LIBIRC_RFC_RPL_TRACEEND 262 + + +/*! \brief 211 \ \ \ + \ \ + \ \