./PaxHeaders.13636/libircclient-1.80000644000000000000000000000013212333235446015111 xustar000000000000000030 mtime=1399667494.716956931 30 atime=1399667494.701956932 30 ctime=1399667494.716956931 libircclient-1.8/0000755000175000001440000000000012333235446014042 5ustar00timusers00000000000000libircclient-1.8/PaxHeaders.13636/build-release.sh0000644000000000000000000000012412333235434020100 xustar000000000000000027 mtime=1399667484.128957 27 atime=1399667494.702956 30 ctime=1399667494.702956932 libircclient-1.8/build-release.sh0000755000175000001440000000430112333235434017111 0ustar00timusers00000000000000#!/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 && make latexpdf) || exit 1 # Package the documentations cp $BUILDDIR/doc/_build/latex/Libircclient.pdf $RELEASEDIR/$PKGDIR.pdf || exit 1 (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-pc-mingw32 && 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.pdf "$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-pc-mingw32 --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!" libircclient-1.8/PaxHeaders.13636/man0000644000000000000000000000013212333235446015527 xustar000000000000000030 mtime=1399667494.717956931 30 atime=1399667494.715956931 30 ctime=1399667494.717956931 libircclient-1.8/man/0000755000175000001440000000000012333235446014615 5ustar00timusers00000000000000libircclient-1.8/man/PaxHeaders.13636/libircclient.10000644000000000000000000000013212333235446020331 xustar000000000000000030 mtime=1399667494.718956931 30 atime=1399667494.717956931 30 ctime=1399667494.718956931 libircclient-1.8/man/libircclient.10000644000175000001440000040320112333235446017342 0ustar00timusers00000000000000.TH "LIBIRCCLIENT" "1" "May 09, 2014" "1.7" "Libircclient" .SH NAME libircclient \- Libircclient Documentation . .nr rst2man-indent-level 0 . .de1 rstReportMargin \\$1 \\n[an-margin] level \\n[rst2man-indent-level] level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] - \\n[rst2man-indent0] \\n[rst2man-indent1] \\n[rst2man-indent2] .. .de1 INDENT .\" .rstReportMargin pre: . RS \\$1 . nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin] . nr rst2man-indent-level +1 .\" .rstReportMargin post: .. .de UNINDENT . RE .\" indent \\n[an-margin] .\" old: \\n[rst2man-indent\\n[rst2man-indent-level]] .nr rst2man-indent-level -1 .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. .\" Man page generated from reStructuredText. . .SH INTRODUCTION .SS Introduction .SS Overview .sp 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. .SS Features .INDENT 0.0 .INDENT 3.5 .INDENT 0.0 .IP \(bu 2 Comprehensive C API; .IP \(bu 2 Full coverage of the IRC protocol using providing functions; .IP \(bu 2 Supports multiple simultaneous connection to different IRC servers or even to the same server; .IP \(bu 2 Supports both plain and SSL connections to the IRC servers with the optional certificate check; .IP \(bu 2 Full multi\-threading support, the library is thread\-safe; .IP \(bu 2 All the processing could be handled by a single thread even if multiple connections are used; .IP \(bu 2 Non\-blocking, asynchronous event\-based interface implemented with callbacks; .IP \(bu 2 Extra support for the socket\-based applications, which use select(); .IP \(bu 2 CTCP support with optional build\-in reply code; .IP \(bu 2 Supports CTCP PING necessary to pass the “spoof check” implemented by most IRC servers; .IP \(bu 2 Flexible DCC support, including both DCC chat, and DCC file transfer; .IP \(bu 2 Can both initiate and react to initiated DCC; .IP \(bu 2 Can accept or decline DCC sessions asynchronously; .IP \(bu 2 Written in plain C, very small binary size (around 30K depending on platform); .IP \(bu 2 Compatible all tested IRC clients; .IP \(bu 2 Free software licensed under the LGPLv3 license; .IP \(bu 2 Supports Linux as well as any POSIX\-compliant Unix, Mac OS X and Microsoft Windows; .IP \(bu 2 Supports 32/64bit architectures as well as non\-x86 architectures; .IP \(bu 2 IPv6 support (optional, must be compiled in); .IP \(bu 2 OpenSSL support (optional, must be compiled in); .IP \(bu 2 Cocoa interface by Nathan Ollerenshaw; .IP \(bu 2 Comprehensive documentation, examples and the FAQ; .UNINDENT .UNINDENT .UNINDENT .SS Known issues .sp 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\(aqd have to overcome the following: .INDENT 0.0 .INDENT 3.5 .INDENT 0.0 .IP \(bu 2 You cannot use the main loop in \fBirc_run()\fP because it only supports one session. You would have to use \fBirc_add_select_descriptors()\fP .IP \(bu 2 You\(aqd have to handle reconnections separately by processing the relevant \fBirc_process_select_descriptors()\fP return values .IP \(bu 2 If you wish to use poll/epoll() instead of select() you\(aqd have to write more logic as it is not directly supported. See the \fIFAQ\fP. .IP \(bu 2 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. .UNINDENT .UNINDENT .UNINDENT .SS Author .sp This library is created by George Yunaev, copyright 2004\-2013. .SS License .sp Libircclient is licensed under Lesser General Public License version 3 or higher. The complete license text is provided in the Appendix. .SH INTEGRATION .SS Integration .SS Requirements .SS Supported operating systems and compilers .sp 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. .SS Compilation .sp 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. .sp 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\(aqre advised not to build from source and use the official binary. .SS Required libraries .sp 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. .sp If the library is built with SSL support, the openssl development package (openssl\-devel) needs to be installed. .sp On Microsoft Windows the Cygwin with necessary development packages must be installed (and openssl\-devel as well). .SS Compiling .sp The library is configured and built the standard Unix way: .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C \&./configure [\-\-enable\-openssl] [\-\-enable\-ipv6] make .ft P .fi .UNINDENT .UNINDENT .SS Installing .sp Although no install is necessary to use the libraries, the install target is provided for convenience and could be invoked via \fBsudo make install\fP .SS Linking .sp 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. .sp If you have built the library with SSL support, you will need to link with OpenSSL libraries; add \fB\-lcrypto \-lssl\fP to your LDFLAGS .sp On Microsoft Windows please link with libircclient.lib which implicitly links with libircclient.dll .SS Coding .SS Initialization .SS Include the headers .sp Before using the library you need to include the library header \fIlibircclient.h\fP. You may also want to include \fIlibirc_rfcnumeric.h\fP which provides the RFC codes: .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C #include "libircclient.h" #include "libirc_rfcnumeric.h" .ft P .fi .UNINDENT .UNINDENT .SS Create event handlers .sp 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). .sp Libircclient helps handling those events by providing the \fBevent handling structure\fP. 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. .sp Generally there are only two events you must handle to provide a bare minimum functionality: \fBevent_connect\fP and \fBevent_numeric\fP. 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 \fBdump_event\fP in the file examples/irctest.c .SS Windows\-specific initialization .sp If you link with the \fBstatic\fP library on Microsoft Windows, you need to initialize the Winsock2 library before calling the library functions. It could be done by following: .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C WSADATA wsaData; if ( WSAStartup ( MAKEWORD (2, 2), &wsaData) != 0 ) // report an error .ft P .fi .UNINDENT .UNINDENT .sp However if you link with the \fBdynamic\fP library (libircclient.dll) which is default if you use the official build, this is not needed because the DLL initializes it automatically on load. .SS Create an IRC session .sp To use the library at least one \fBIRC session\fP 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. .sp To create a session, call the \fBirc_create_session()\fP function: .INDENT 0.0 .INDENT 3.5 .sp .nf .ft 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 .ft P .fi .UNINDENT .UNINDENT .sp This code could be repeated as many times as needed to create multiple sessions. The same callback structure could be reused for multiple sessions. .SS Set options .sp Besides debugging there are two options you may need to use. The \fBLIBIRC_OPTION_STRIPNICKS\fP enables automatic parsing of nicknames, and since it is hard to imagine the case when it should not be enabled, we enable it: .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C irc_option_set( session, LIBIRC_OPTION_STRIPNICKS ); .ft P .fi .UNINDENT .UNINDENT .sp 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 \fBLIBIRC_OPTION_SSL_NO_VERIFY\fP .SS Connect to the server .sp To initiate the connection to the IRC server, call the \fBirc_connect()\fP function: .INDENT 0.0 .INDENT 3.5 .sp .nf .ft 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() .ft P .fi .UNINDENT .UNINDENT .sp To initiate the connection to the IRC server over SSL, call the \fBirc_connect()\fP function and prefix the host name or IP address with a hash symbol: .INDENT 0.0 .INDENT 3.5 .sp .nf .ft 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() .ft P .fi .UNINDENT .UNINDENT .sp 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: .INDENT 0.0 .INDENT 3.5 .INDENT 0.0 .IP \(bu 2 If the connection is established, you will receive the \fBevent_connect\fP \- this is why it is important to handle it .IP \(bu 2 If the connection failed, the networking handler function will return failure .UNINDENT .UNINDENT .UNINDENT .SS Connect to the IPv6 server .sp To initiate the connection to the IPv6 server, call the \fBirc_connect6()\fP function: .INDENT 0.0 .INDENT 3.5 .sp .nf .ft 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() .ft P .fi .UNINDENT .UNINDENT .sp The rest of the details, including the return value and the SSL are the same as with regular connect. .SS Start the networking loop .sp 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. .sp 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. .sp To start the event loop call the \fBirc_run()\fP function: .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C if ( irc_run (s) ) // Either the connection to the server could not be established or terminated. See irc_errno() .ft P .fi .UNINDENT .UNINDENT .sp Remember that irc_run() call \fBwill not return\fP until the server connection is not active anymore. .SS Use the custom networking loop .sp 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 (\fIsee the FAQ\fP if you want to use other polling methods). And you need to run the following loop: .INDENT 0.0 .INDENT 3.5 .sp .nf .ft 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 .ft P .fi .UNINDENT .UNINDENT .SS Channels and users .sp Before calling any of those functions make sure you have connected to the server. .SS Join and leave a channel .sp To join the channel call the \fBirc_cmd_join()\fP function with the channel name: .INDENT 0.0 .INDENT 3.5 .sp .nf .ft 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 .ft P .fi .UNINDENT .UNINDENT .sp You can join as many channels as you want, although the serer may restrict the number of channels you can join simultaneously. .sp If the join was successful you will receive the \fBevent_join\fP 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. .sp If the join was not successful, you will receive the error via \fBevent_numeric\fP. .sp To leave the channel call the \fBirc_cmd_part()\fP function with the channel name: .INDENT 0.0 .INDENT 3.5 .sp .nf .ft 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 .ft P .fi .UNINDENT .UNINDENT .SS Send a message to a channel or to a user .sp After you have joined the channel, you can send a message to the channel by using the \fBirc_cmd_msg()\fP function with the channel name: .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C // Say "Hi!" to everyone in the channel #linux if ( irc_cmd_msg( session, "#linux", "Hi!" ) ) // most likely connection error .ft P .fi .UNINDENT .UNINDENT .sp 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. .sp 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. .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C // Say "Hi!" to IRC user john if ( irc_cmd_msg( session, "john", "Hi!" ) ) // most likely connection error .ft P .fi .UNINDENT .UNINDENT .sp If the message was sent successfully you will not receive any confirmation or event. You will only receive the error via \fBevent_numeric\fP if the message was not sent. .SS Receive messages from a channel or from a user .sp You receive the channel messages by handling the \fBevent_channel\fP. Each time someone says something in the channel this event is called. .sp You receive the "private" messages from other users by handling the \fBevent_privmsg\fP. .sp Those event handlers should be created in your application and passed to the library when you \fI\%create an IRC session\fP .SS Send an action message .sp "Action" messages, also called /me messages, are specially formatted CTCP messages. However the library contains a special function to send them, \fBirc_cmd_me()\fP. Actions sent by other people are handled by the \fBevent_ctcp_action\fP event. .sp Same as with sending messages no confirmation is received on success. .SS Send a CTCP request .sp Other CTCP requests such as PING, VERSION etc should be sent by calling \fBirc_cmd_ctcp_request()\fP. If the CTCP response is received, it is handled by the \fBevent_ctcp_rep\fP event. .SS Handling DCC chat .SS Implementing the DCC callback .sp No matter whether you plan to initiate DCC chats or respond to them you must implement the \fBDCC callback\fP: .INDENT 0.0 .INDENT 3.5 .sp .nf .ft 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\en", data ); } } .ft P .fi .UNINDENT .UNINDENT .sp This callback should be passed to either \fBirc_dcc_chat()\fP function which initiates the request, or to \fBirc_dcc_accept()\fP function which accepts the DCC CHAT request initiated by another user. .SS Initiating the DCC CHAT .sp You can initiate the DCC chat with another user by calling \fBirc_dcc_chat()\fP: .INDENT 0.0 .INDENT 3.5 .sp .nf .ft 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 .ft P .fi .UNINDENT .UNINDENT .sp 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 \fBirc_dcc_text()\fP 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. .SS Responding to DCC CHAT requests .sp To respond to the DCC CHAT equests your application should implement for the \fBevent_dcc_chat_req\fP event. The callback could be implemented as following: .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C void callback_event_dcc_chat( irc_session_t * session, const char * nick, const char * addr, irc_dcc_t dccid ) { // User \(aqnick\(aq from the IP address \(aqaddr\(aq 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 ); } .ft P .fi .UNINDENT .UNINDENT .sp and registered when the IRC session is created. If your application does not handle DCC at all you can just call the \fBirc_dcc_decline()\fP function inside the callback. .sp 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\(aqt pop up dialogs it is still better to separate the chat logic from the callback logic. .sp 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 \fBirc_dcc_accept()\fP function, and if it was declined, the application would call the \fBirc_dcc_decline()\fP function. Both functions will accept the \fIdccid\fP which identifies this specific request: .INDENT 0.0 .INDENT 3.5 .sp .nf .ft 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 ); } .ft P .fi .UNINDENT .UNINDENT .SS Send CHAT messages .sp Once the chat session is established, you can send the chat messages using \fBirc_dcc_text()\fP function. Note that you need to pass the dcc session id instead of nick: .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C irc_dcc_text( session, dccid, "Hello there!" ); .ft P .fi .UNINDENT .UNINDENT .SS Handling DCC file transfer .sp This section covers handling sending and receiving files via DCC. .SS Implementing the callback .sp No matter whether you plan to send or receive files via dcc you must implement the \fBDCC callback\fP. 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: .INDENT 0.0 .INDENT 3.5 .sp .nf .ft 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, \(aqlength\(aq indicates how much data was sent printf ("Sent bytes: %d\en", 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\en" ); } else { // More file content has been received. Store it in memory, write to disk or something printf ("Received %d bytes of data\en", length ); } } .ft P .fi .UNINDENT .UNINDENT .sp This callback should be passed to either \fBirc_dcc_sendfile()\fP function which initiates the request, or to \fBirc_dcc_accept()\fP function which accepts the DCC RECVFILE request initiated by another user. .SS Sending the file via DCC .sp You can initiate sending the file via DCC to another user by calling \fBirc_dcc_sendfile()\fP: .INDENT 0.0 .INDENT 3.5 .sp .nf .ft 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 .ft P .fi .UNINDENT .UNINDENT .sp 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. .SS Receive a file via DCC .sp 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 \fBevent_dcc_send_req\fP event. The callback could be implemented as following: .INDENT 0.0 .INDENT 3.5 .sp .nf .ft 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 \(aqnick\(aq from the IP address \(aqaddr\(aq 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 ); } .ft P .fi .UNINDENT .UNINDENT .sp If your application does not handle DCC at all you can just call the \fBirc_dcc_decline()\fP function inside the callback. .sp 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\(aqt pop up dialogs it is still better to separate the chat logic from the callback logic. .sp 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 \fBirc_dcc_accept()\fP function, and if it was declined, the application would call the \fBirc_dcc_decline()\fP function. Both functions will accept the \fIdccid\fP which identifies this specific request: .INDENT 0.0 .INDENT 3.5 .sp .nf .ft 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 ); } .ft P .fi .UNINDENT .UNINDENT .sp Note that it is not possible to request a remote user to send you a file. .SS Handling colors .SS Stripping colors from the message .sp 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\(aqt get the same reaction as the user who doesn\(aqt use colors, and some users use colors by default. .sp Use the \fBirc_color_strip_from_mirc()\fP function to strip the ANSI colors from the text message. It does not modify the message which doesn\(aqt use colors. .SS Color conversion .sp 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. .sp Use the \fBirc_color_convert_from_mirc()\fP function to convert colors from ANSI to the library textual representation, and \fBirc_color_convert_to_mirc()\fP to convert the library textual representation of colors into ANSI. .sp Do not forget to free() the returned pointer once it is not used anymore. .SS Miscellaneous .SS Tracking user nicks .sp 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 \fBevent_nick\fP event. See the examples/censor.c for details. .SH API REFERENCE .SS Callbacks .sp This section describes the callbacks supported by the library. .SS irc_event_callback_t .sp \fBPrototype:\fP .INDENT 0.0 .TP .B typedef void (*irc_event_callback_t)(irc_session_t *\fI\ session\fP, const char *\fI\ event\fP, const char *\fI\ origin\fP, const char **\fI\ params\fP, unsigned int\fI\ count\fP) .UNINDENT .sp \fBParameters:\fP .TS center; |l|l|. _ T{ \fIsession\fP T} T{ The IRC session, which generated the event T} _ T{ \fIevent\fP T} T{ The text name of the event. Useful in case a single event handler is used to handle multiple events T} _ T{ \fIorigin\fP T} T{ The originator of the event. Depends on the event. T} _ T{ \fIparams\fP T} T{ 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 \fIparams\fP pointer itself could be NULL for some events. T} _ T{ \fIcount\fP T} T{ The number of entries in the \fIparams\fP argument supplied. T} _ .TE .sp \fBDescription:\fP .sp 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 \fBirc_callbacks_t\fP structure. .sp Every event has an origin (i.e. who originated the event). In some cases the \fIorigin\fP variable may be NULL, which indicates that event origin is unknown. The origin usually looks like \fInick!host@ircserver\fP, i.e. like \fItim!home@irc.server.net\fP. 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 \fBirc_target_get_nick()\fP, or automatically for all the events \- by setting the \fBLIBIRC_OPTION_STRIPNICKS\fP option with \fBirc_option_set()\fP. .SS irc_event_dcc_chat_t .sp \fBPrototype:\fP .INDENT 0.0 .TP .B typedef void (*irc_event_dcc_chat_t)(irc_session_t *\fI\ session\fP, const char *\fI\ nick\fP, const char *\fI\ addr\fP, irc_dcc_t\fI\ dccid\fP) .UNINDENT .sp \fBParameters:\fP .TS center; |l|l|. _ T{ \fIsession\fP T} T{ IRC session, which generates an event (the one returned by irc_create_session) T} _ T{ \fInick\fP T} T{ User who requested the chat T} _ T{ \fIaddr\fP T} T{ IP address of the person such as 189.12.34.56 T} _ T{ \fIdccid\fP T} T{ Identifier associated with this request which should be passed to the \fBirc_dcc_accept()\fP / \fBirc_dcc_decline()\fP functions T} _ .TE .sp \fBDescription:\fP .sp 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. .sp You must respond to the chat request either by calling \fBirc_dcc_accept()\fP to accept it, or by calling \fBirc_dcc_decline()\fP to decline it. .SS irc_event_dcc_send_t .sp \fBPrototype:\fP .INDENT 0.0 .TP .B typedef void (*irc_event_dcc_send_t)(irc_session_t *\fI\ session\fP, const char *\fI\ nick\fP, const char *\fI\ addr\fP, const char *\fI\ filename\fP, unsigned long\fI\ size\fP, irc_dcc_t\fI\ dccid\fP) .UNINDENT .sp \fBParameters:\fP .TS center; |l|l|. _ T{ \fIsession\fP T} T{ The IRC session, which generates an event (the one returned by irc_create_session) T} _ T{ \fInick\fP T} T{ The user who requested the chat T} _ T{ \fIaddr\fP T} T{ The IP address of the person such as 189.12.34.56 T} _ T{ \fIfilename\fP T} T{ The name of the file the user is trying to send you T} _ T{ \fIsize\fP T} T{ The size of the file T} _ T{ \fIdccid\fP T} T{ Identifier associated with this request which should be passed to the \fBirc_dcc_accept()\fP / \fBirc_dcc_decline()\fP functions T} _ .TE .sp \fBDescription:\fP .sp 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. .sp You must respond to the chat request either by calling \fBirc_dcc_accept()\fP to accept it, or by calling \fBirc_dcc_decline()\fP to decline it. .SS irc_dcc_callback_t .sp \fBPrototype:\fP .INDENT 0.0 .TP .B typedef void (*irc_dcc_callback_t)(irc_session_t *\fI\ session\fP, irc_dcc_t\fI\ id\fP, int\fI\ status\fP, void *\fI\ ctx\fP, const char *\fI\ data\fP, unsigned int\fI\ length\fP) .UNINDENT .sp \fBParameters:\fP .TS center; |l|l|. _ T{ \fIsession\fP T} T{ The IRC session, which generates an event (the one returned by irc_create_session) T} _ T{ \fIid\fP T} T{ The DCC session id T} _ T{ \fIstatus\fP T} T{ The DCC connection status. 0 means there is no error, otherwise contains an error code T} _ T{ \fIctx\fP T} T{ The user\-provided context T} _ T{ \fIdata\fP T} T{ Data received (if available), otherwise NULL T} _ T{ \fIlength\fP T} T{ Size of the data received if any data T} _ .TE .sp \fBDescription:\fP .sp This callback is called for all DCC functions when state change occurs. .INDENT 0.0 .TP .B For DCC CHAT, the callback is called as following: .INDENT 7.0 .IP \(bu 2 \fIstatus\fP is \fBLIBIRC_ERR_CLOSED\fP: connection is closed by remote peer. After returning from the callback, the DCC session is automatically destroyed .IP \(bu 2 \fIstatus\fP is nonzero but not \fBLIBIRC_ERR_CLOSED\fP: socket I/O error (connect error, accept error, recv error, send error). After returning from the callback, the DCC session is automatically destroyed .IP \(bu 2 \fIstatus\fP is zero and \fIlength\fP is zero: the remote side accepted the chat request .IP \(bu 2 \fIstatus\fP is zero and \fIlength\fP is nonzero: new chat message received, \fIdata\fP contains the message (a null\-terminated string), \fIlength\fP contains the string length without null terminator .UNINDENT .TP .B For DCC SEND, while file is being sent, the callback is called as following: .INDENT 7.0 .IP \(bu 2 \fIstatus\fP 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 .IP \(bu 2 \fIstatus\fP is zero: another data packet has been sent, \fIlength\fP contains the total amount of data sent so far, \fIdata\fP is NULL .UNINDENT .TP .B For DCC RECV, while file is being sending, callback called as following: .INDENT 7.0 .IP \(bu 2 \fIstatus\fP 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. .IP \(bu 2 \fIstatus\fP is zero, and \fIdata\fP is NULL: the file has been received successfully. After returning from the callback, the DCC session is automatically destroyed. .IP \(bu 2 \fIstatus\fP is zero, and \fIdata\fP is not NULL: new data received, \fIdata\fP contains the data received, \fIlength\fP contains the amount of data received. .UNINDENT .UNINDENT .SS irc_eventcode_callback_t .sp \fBPrototype:\fP .INDENT 0.0 .TP .B typedef void (*irc_eventcode_callback_t)(irc_session_t *\fI\ session\fP, unsigned int\fI\ event\fP, const char *\fI\ origin\fP, const char **\fI\ params\fP, unsigned int\fI\ count\fP) .UNINDENT .sp \fBParameters:\fP .TS center; |l|l|. _ T{ \fIsession\fP T} T{ The IRC session, which generates an event (the one returned by irc_create_session) T} _ T{ \fIevent\fP T} T{ The numeric code of the event. Useful in case a single event handler is used to handle multiple events T} _ T{ \fIorigin\fP T} T{ The originator of the event. Depends on the event. T} _ T{ \fIparams\fP T} T{ 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 \fIparams\fP pointer itself could be NULL for some events. T} _ T{ \fIcount\fP T} T{ The number of entries in the \fIparams\fP argument supplied. T} _ .TE .sp \fBDescription:\fP .sp 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\(aqt expect servers to follow it closely though). .sp Every event has an origin (i.e. who originated the event). In some cases the \fIorigin\fP variable may be NULL, which indicates that event origin is unknown. The origin usually looks like \fInick!host@ircserver\fP, i.e. like \fItim!home@irc.server.net\fP. 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 \fBirc_target_get_nick()\fP, or automatically for all the events \- by setting the \fBLIBIRC_OPTION_STRIPNICKS\fP option with \fBirc_option_set()\fP. .SS Functions .sp This section describes the functions defined in the library which are grouped by the purpose. .SS Library initialization and shutdown .SS irc_create_session .sp \fBPrototype:\fP .INDENT 0.0 .TP .B irc_session_t * irc_create_session(irc_callbacks_t *\fI\ callbacks\fP) .UNINDENT .sp \fBParameters:\fP .TS center; |l|. _ T{ \fIcallbacks\fP | Event callbacks structure, which defines several callbacks, which will be called on appropriate events. Cannot be NULL. T} _ .TE .sp \fBDescription:\fP .sp 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. .sp When it is not needed anymore, the session must be destroyed by calling the \fBirc_destroy_session()\fP function. .sp \fBReturn value:\fP .sp An \fBirc_session_t\fP object, or 0 if creation failed. Usually, failure is caused by out of memory error. .sp \fBThread safety:\fP .sp This function can be called simultaneously from multiple threads. Same callback structure may be reused by multiple threads. .SS irc_destroy_session .sp \fBPrototype:\fP .INDENT 0.0 .TP .B void irc_destroy_session(irc_session_t *\fI\ session\fP) .UNINDENT .sp \fBParameters:\fP .TS center; |l|. _ T{ \fIsession\fP | The IRC session handle T} _ .TE .sp \fBDescription:\fP .sp 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. .sp \fBThread safety:\fP .sp This function can be called simultaneously from multiple threads. .SS Connecting, disconnecting and running the main event loop .SS irc_connect6 .sp \fBPrototype:\fP .INDENT 0.0 .TP .B int irc_connect6(irc_session_t *\fI\ session\fP, const char *\fI\ server\fP, unsigned short\fI\ port\fP, const char *\fI\ password\fP, const char *\fI\ nick\fP, const char *\fI\ username\fP, const char *\fI\ realname\fP) .UNINDENT .SS irc_connect .sp \fBPrototype:\fP .INDENT 0.0 .TP .B int irc_connect(irc_session_t *\fI\ session\fP, const char *\fI\ server\fP, unsigned short\fI\ port\fP, const char *\fI\ password\fP, const char *\fI\ nick\fP, const char *\fI\ username\fP, const char *\fI\ realname\fP) .UNINDENT .sp \fBParameters:\fP .TS center; |l|l|. _ T{ \fIsession\fP T} T{ IRC session handle T} _ T{ \fIserver\fP T} T{ 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 T} _ T{ \fIport\fP T} T{ Port number to connect to, usually 6667 T} _ T{ \fIpassword\fP T} T{ 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 T} _ T{ \fInick\fP T} T{ Nick which will be used to log into the IRC server. Cannot be NULL T} _ T{ \fIusername\fP T} T{ 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 T} _ T{ \fIrealname\fP T} T{ 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 T} _ .TE .sp \fBDescription:\fP .sp 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. .sp If the library was built with the OpenSSL support, and the IP address or the host name is prefixed by a hash, such as \fB"#irc.example.com"\fP, the library attempts to establish the SSL connection. .sp The connection is established asynchronously, and the \fBevent_connect\fP is called once the connection is established. .sp 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. .sp \fBReturn value:\fP .sp Returns 0 if the connection is initiated successfully. This doesn\(aqt mean the connection is established \- the \fBevent_connect\fP is called when it happens. If the connection cannot be established, either \fBirc_run()\fP or \fBirc_process_select_descriptors()\fP will return an error. .sp \fBThread safety:\fP .sp This function can be called simultaneously from multiple threads, but not using the same session object. .SS irc_disconnect .sp \fBPrototype:\fP .INDENT 0.0 .TP .B void irc_disconnect(irc_session_t *\fI\ session\fP) .UNINDENT .sp \fBParameters:\fP .TS center; |l|. _ T{ \fIsession\fP | IRC session handle T} _ .TE .sp \fBDescription:\fP .sp This function closes the IRC connection. After that connection is closed, if the libirc was looped in the \fBirc_run()\fP loop, it automatically leaves the loop and \fBirc_run()\fP returns. .sp \fBThread safety:\fP .sp This function can be called simultaneously from multiple threads, but not using the same session object. .SS irc_is_connected .sp \fBPrototype:\fP .INDENT 0.0 .TP .B int irc_is_connected(irc_session_t *\fI\ session\fP) .UNINDENT .sp \fBParameters:\fP .TS center; |l|l|. _ T{ \fIsession\fP T} T{ IRC session handle T} _ .TE .sp \fBReturn value:\fP .sp This function returns 1 if the connection to the IRC server is established or 0 if it is not. .sp \fBThread safety:\fP .sp This function can be called simultaneously from multiple threads. .SS irc_run .sp \fBPrototype:\fP .INDENT 0.0 .TP .B int irc_run(irc_session_t *\fI\ session\fP) .UNINDENT .sp \fBParameters:\fP .TS center; |l|l|. _ T{ \fIsession\fP T} T{ IRC session handle T} _ .TE .sp \fBDescription:\fP .sp 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 \fBirc_cmd_quit\fP. This function should only be used if you use a single IRC session and don\(aqt need asynchronous request processing (i.e. your bot just reacts on the events, and doesn\(aqt generate it asynchronously). Even in last case, you still can call this function and start the asynchronous thread in \fBevent_connect\fP handler. See the examples. .sp \fBReturn value:\fP .sp This function returns a nonzero value if the connection to the IRC server could not be established, or was terminated. .sp \fBThread safety:\fP .sp This function cannot be called from multiple threads. Use \fBirc_add_select_descriptors()\fP and \fBirc_process_select_descriptors()\fP instead. .SS irc_add_select_descriptors .sp \fBPrototype:\fP .INDENT 0.0 .TP .B int irc_add_select_descriptors(irc_session_t *\fI\ session\fP, fd_set\fI\ *in_set\fP, fd_set\fI\ *out_set\fP, int *\fI\ maxfd\fP) .UNINDENT .sp \fBParameters:\fP .TS center; |l|l|. _ T{ \fIsession\fP T} T{ IRC session handle T} _ T{ \fIin_set\fP T} T{ fd_set input descriptor set for select() T} _ T{ \fIout_set\fP T} T{ fd_set output descriptor set for select() T} _ T{ \fImaxfd\fP T} T{ Largest descriptor already in all the sets. Will be updated if libirc adds larger number to the FD_SET array T} _ .TE .sp \fBDescription:\fP .sp This function should be used after you called \fBirc_connect()\fP. 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 \fBirc_process_select_descriptors()\fP which will handle the events and calls your callbacks(!). Then you can process your sockets events from set. See the example. .sp What if you use epoll? \fISee the FAQ\fP .sp \fBReturn value:\fP .sp This function returns a nonzero value if the \fBirc_connect()\fP was not called before calling this function. .sp \fBThread safety:\fP .sp This function can be called simultaneously from multiple threads, but it rarely makes sense. .SS irc_process_select_descriptors .sp \fBPrototype:\fP .INDENT 0.0 .TP .B int irc_process_select_descriptors(irc_session_t *\fI\ session\fP, fd_set\fI\ *in_set\fP, fd_set\fI\ *out_set\fP) .UNINDENT .sp \fBParameters:\fP .TS center; |l|l|. _ T{ \fIsession\fP T} T{ IRC session handle T} _ T{ \fIin_set\fP T} T{ fd_set input descriptor set for select() T} _ T{ \fIout_set\fP T} T{ fd_set output descriptor set for select() T} _ .TE .sp \fBDescription:\fP .sp This function should be used in pair with \fBirc_add_select_descriptors()\fP function, which documentation describes how they work together. .sp 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. .sp \fBReturn value:\fP .sp Return code 0 means success. Other value means error, the error code may be obtained through irc_errno(). .sp \fBThread safety:\fP .sp This function can be called simultaneously from multiple threads for different IRC session objects only. .SS Managing the IRC channels: joining, leaving, inviting .SS irc_cmd_join .sp \fBPrototype:\fP .INDENT 0.0 .TP .B int irc_cmd_join(irc_session_t *\fI\ session\fP, const char *\fI\ channel\fP, const char *\fI\ key\fP) .UNINDENT .sp \fBParameters:\fP .TS center; |l|l|. _ T{ \fIsession\fP T} T{ IRC session handle T} _ T{ \fIchannel\fP T} T{ Channel name to join. Cannot be NULL. T} _ T{ \fIkey\fP T} T{ Secret key for the channel. Can be NULL if not needed T} _ .TE .sp \fBDescription:\fP .sp 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 \fBevent_join\fP will be called (with your nick as the origin), then typically the \fBevent_topic\fP 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. .sp \fBReturn value:\fP .sp 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 \fBevent_numeric\fP event. .INDENT 0.0 .TP .B Possible error responces for this command from the RFC1459: .INDENT 7.0 .IP \(bu 2 LIBIRC_RFC_ERR_BANNEDFROMCHAN .IP \(bu 2 LIBIRC_RFC_ERR_INVITEONLYCHAN .IP \(bu 2 LIBIRC_RFC_ERR_BADCHANNELKEY .IP \(bu 2 LIBIRC_RFC_ERR_CHANNELISFULL .IP \(bu 2 LIBIRC_RFC_ERR_BADCHANMASK .IP \(bu 2 LIBIRC_RFC_ERR_NOSUCHCHANNEL .IP \(bu 2 LIBIRC_RFC_ERR_TOOMANYCHANNELS .UNINDENT .UNINDENT .sp \fBThread safety:\fP .sp This function can be called simultaneously from multiple threads. .SS irc_cmd_part .sp \fBPrototype:\fP .INDENT 0.0 .TP .B int irc_cmd_part(irc_session_t *\fI\ session\fP, const char *\fI\ channel\fP) .UNINDENT .sp \fBParameters:\fP .TS center; |l|l|. _ T{ \fIsession\fP T} T{ IRC session handle T} _ T{ \fIchannel\fP T} T{ Channel name to leave. Cannot be NULL. T} _ .TE .sp \fBDescription:\fP .sp Use this function to leave the IRC channel you\(aqve already joined to. An attempt to leave the channel you aren\(aqt in results a LIBIRC_RFC_ERR_NOTONCHANNEL server error. .sp \fBReturn value:\fP .sp 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 \fBevent_numeric\fP event. .INDENT 0.0 .TP .B Possible error responces for this command from the RFC1459: .INDENT 7.0 .IP \(bu 2 LIBIRC_RFC_ERR_NOSUCHCHANNEL .IP \(bu 2 LIBIRC_RFC_ERR_NOTONCHANNEL .UNINDENT .UNINDENT .sp \fBThread safety:\fP .sp This function can be called simultaneously from multiple threads. .SS irc_cmd_invite .sp \fBPrototype:\fP .INDENT 0.0 .TP .B int irc_cmd_invite(irc_session_t *\fI\ session\fP, const char *\fI\ nick\fP, const char *\fI\ channel\fP) .UNINDENT .sp \fBParameters:\fP .TS center; |l|l|. _ T{ \fIsession\fP T} T{ IRC session handle T} _ T{ \fInick\fP T} T{ Nick name of the user to invite T} _ T{ \fIchannel\fP T} T{ Channel name to join. Cannot be NULL T} _ .TE .sp \fBDescription:\fP .sp 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 \fBevent_invite\fP event. Note that you must be a channel operator to invite the users. .sp \fBReturn value:\fP .sp 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 \fBevent_numeric\fP event. .INDENT 0.0 .TP .B On success one of the following replies returned: .INDENT 7.0 .IP \(bu 2 LIBIRC_RFC_RPL_INVITING .IP \(bu 2 LIBIRC_RFC_RPL_AWAY .UNINDENT .TP .B Possible error responces for this command from the RFC1459: .INDENT 7.0 .IP \(bu 2 LIBIRC_RFC_ERR_NEEDMOREPARAMS .IP \(bu 2 LIBIRC_RFC_ERR_NOSUCHNICK .IP \(bu 2 LIBIRC_RFC_ERR_NOTONCHANNEL .IP \(bu 2 LIBIRC_RFC_ERR_ERR_USERONCHANNEL .IP \(bu 2 LIBIRC_RFC_ERR_ERR_CHANOPRIVSNEEDED .UNINDENT .UNINDENT .sp \fBThread safety:\fP .sp This function can be called simultaneously from multiple threads. .SS irc_cmd_names .sp \fBPrototype:\fP .INDENT 0.0 .TP .B int irc_cmd_names (irc_session_t * session, const char * channel); .UNINDENT .sp \fBParameters:\fP .TS center; |l|l|. _ T{ \fIsession\fP T} T{ IRC session handle T} _ T{ \fIchannel\fP T} T{ A channel name(s) to obtain user list. Multiple channel names must be separated by a comma T} _ .TE .sp \fBDescription:\fP .sp 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. .sp \fBReturn value:\fP .sp 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 \fBevent_numeric\fP event. .INDENT 0.0 .TP .B The channel names are returned by \fBevent_numeric\fP event using the following reply codes: .INDENT 7.0 .IP \(bu 2 LIBIRC_RFC_RPL_NAMREPLY .IP \(bu 2 LIBIRC_RFC_RPL_ENDOFNAMES .UNINDENT .UNINDENT .sp \fBThread safety:\fP .sp This function can be called simultaneously from multiple threads. .SS irc_cmd_list .sp \fBPrototype:\fP .INDENT 0.0 .TP .B int irc_cmd_list(irc_session_t *\fI\ session\fP, const char *\fI\ channel\fP) .UNINDENT .sp \fBParameters:\fP .TS center; |l|l|. _ T{ \fIsession\fP T} T{ IRC session handle T} _ T{ \fIchannel\fP T} T{ A channel name(s) to list. Multiple channel names must be separated by a comma. If NULL, all channels are listed T} _ .TE .sp \fBDescription:\fP .sp 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. .sp \fBReturn value:\fP .sp 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 \fBevent_numeric\fP event. .INDENT 0.0 .TP .B The list of channels is returned by \fBevent_numeric\fP event using the following reply codes: .INDENT 7.0 .IP \(bu 2 LIBIRC_RFC_RPL_LISTSTART .IP \(bu 2 LIBIRC_RFC_RPL_LISTEND .IP \(bu 2 LIBIRC_RFC_RPL_LIST .UNINDENT .UNINDENT .sp \fBThread safety:\fP .sp This function can be called simultaneously from multiple threads. .SS irc_cmd_topic .sp \fBPrototype:\fP .INDENT 0.0 .TP .B int irc_cmd_topic(irc_session_t *\fI\ session\fP, const char *\fI\ channel\fP, const char *\fI\ topic\fP) .UNINDENT .sp \fBParameters:\fP .TS center; |l|l|. _ T{ \fIsession\fP T} T{ IRC session handle T} _ T{ \fIchannel\fP T} T{ A channel name T} _ T{ \fItopic\fP T} T{ A new channel topic. If NULL, the old topic would be returned and nothing would change. To set the empty topic use "" T} _ .TE .sp \fBDescription:\fP .sp This function is used to change or view the topic (title) of a channel. Note that depending on \fI+t\fP channel mode, you may be required to be a channel operator to change the channel topic. .sp 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. .sp \fBReturn value:\fP .sp 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 \fBevent_numeric\fP event. .INDENT 0.0 .TP .B The topic information is returned using one of following reply codes: .INDENT 7.0 .IP \(bu 2 LIBIRC_RFC_RPL_NOTOPIC .IP \(bu 2 LIBIRC_RFC_RPL_TOPIC .UNINDENT .UNINDENT .sp If the topic change was requested and it was successfully changed, the \fBevent_topic\fP is generated as well. .INDENT 0.0 .TP .B Possible error responces for this command from the RFC1459: .INDENT 7.0 .IP \(bu 2 LIBIRC_RFC_ERR_NEEDMOREPARAMS .IP \(bu 2 LIBIRC_RFC_ERR_CHANOPRIVSNEEDED .IP \(bu 2 LIBIRC_RFC_ERR_NOTONCHANNEL .UNINDENT .UNINDENT .sp \fBThread safety:\fP .sp This function can be called simultaneously from multiple threads. .SS irc_cmd_channel_mode .sp \fBPrototype:\fP .INDENT 0.0 .TP .B int irc_cmd_channel_mode(irc_session_t *\fI\ session\fP, const char *\fI\ channel\fP, const char *\fI\ mode\fP) .UNINDENT .sp \fBParameters:\fP .TS center; |l|l|. _ T{ \fIsession\fP T} T{ IRC session handle T} _ T{ \fIchannel\fP T} T{ A channel name T} _ T{ \fImode\fP T} T{ A mode to change. If NULL, the channel mode is not changed but the old mode is returned T} _ .TE .sp \fBDescription:\fP .sp 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. .sp 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. .sp Here is the list of \(aqstandard\(aq channel modes: .TS center; |l|l|. _ T{ o nickname T} T{ gives (+o nickname) to, or takes (\-o nickname) the channel operator privileges from a \fInickname\fP. This mode affects the users in channel, not the channel itself. Examples: "+o tim", "\-o watson" T} _ T{ p T} T{ sets (+p) or resets (\-p) private channel flag. Private channels are shown in channel list as \(aqPrv\(aq, without the topic T} _ T{ s T} T{ sets (+s) or resets (\-s) secret channel flag. Secret channels aren\(aqt shown in channel list at all T} _ T{ i T} T{ sets (+i) or resets (\-i) invite\-only channel flag. When the flag is set, only the people who are invited by the \fBirc_cmd_invite()\fP can join this channel T} _ T{ t T} 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 T} _ T{ n T} T{ 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 T} _ T{ m T} T{ 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 T} _ T{ v nickname T} T{ gives (+v nick) or takes (\-v nick) from user the ability to speak on a moderated channel. Examples: "+v bob", "\-v joy" T} _ T{ l number T} T{ 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 T} _ T{ k key T} T{ 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 T} _ T{ b mask T} T{ sets (+b \fI!*@\fP.mil) or removes (\-b \fI!*@\fP.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". T} _ .TE .sp 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\(aqt listed here \- please contact me .sp \fBReturn value:\fP .sp 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 \fBevent_numeric\fP event. .INDENT 0.0 .TP .B The old mode information is returned by using following numeric codes: .INDENT 7.0 .IP \(bu 2 LIBIRC_RFC_RPL_CHANNELMODEIS .IP \(bu 2 LIBIRC_RFC_RPL_BANLIST .IP \(bu 2 LIBIRC_RFC_RPL_ENDOFBANLIST .UNINDENT .TP .B Possible error responces for this command from the RFC1459: .INDENT 7.0 .IP \(bu 2 LIBIRC_RFC_ERR_NEEDMOREPARAMS .IP \(bu 2 LIBIRC_RFC_ERR_CHANOPRIVSNEEDED .IP \(bu 2 LIBIRC_RFC_ERR_NOSUCHNICK .IP \(bu 2 LIBIRC_RFC_ERR_NOTONCHANNEL .IP \(bu 2 LIBIRC_RFC_ERR_KEYSET .IP \(bu 2 LIBIRC_RFC_ERR_UNKNOWNMODE .IP \(bu 2 LIBIRC_RFC_ERR_NOSUCHCHANNEL .UNINDENT .UNINDENT .sp \fBThread safety:\fP .sp This function can be called simultaneously from multiple threads. .SS irc_cmd_user_mode .sp \fBPrototype:\fP .INDENT 0.0 .TP .B int irc_cmd_user_mode(irc_session_t *\fI\ session\fP, const char *\fI\ mode\fP) .UNINDENT .sp \fBParameters:\fP .TS center; |l|l|. _ T{ \fIsession\fP T} T{ IRC session handle T} _ T{ \fImode\fP T} T{ A mode to change. If NULL, the user mode is not changed but the old mode is returned T} _ .TE .sp \fBDescription:\fP .sp This function is used to change or view the user modes. Note that, unlike channel modes, some user modes cannot be changed at all. .sp 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. .sp Here is the list of \(aqstandard\(aq user modes: .TS center; |l|l|. _ T{ o T} T{ represents an IRC operator status. Could not be set directly (but can be reset though), to set it use the IRC a OPER command T} _ T{ i T} T{ if set, marks a user as \(aqinvisible\(aq \- that is, not seen by lookups if the user is not in a channel T} _ T{ w T} T{ if set, marks a user as \(aqreceiving wallops\(aq \- special messages generated by IRC operators using WALLOPS command T} _ T{ s T} T{ if set, marks a user for receipt of server notices T} _ T{ r T} T{ NON\-STANDARD MODE. If set, user has been authenticated with the NickServ IRC service T} _ T{ x T} T{ NON\-STANDARD MODE. If set, user\(aqs real IP is masked by the IRC server T} _ .TE .sp 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\(aqt mentioned here \- please contact me. .sp \fBReturn value:\fP .sp 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 \fBevent_numeric\fP event. .sp The old mode information is returned by using the numeric code LIBIRC_RFC_RPL_UMODEIS: .INDENT 0.0 .TP .B Possible error responces for this command from the RFC1459: .INDENT 7.0 .IP \(bu 2 LIBIRC_RFC_ERR_NEEDMOREPARAMS .IP \(bu 2 LIBIRC_RFC_ERR_NOSUCHNICK .IP \(bu 2 LIBIRC_RFC_ERR_UNKNOWNMODE .IP \(bu 2 LIBIRC_RFC_ERR_USERSDONTMATCH .IP \(bu 2 LIBIRC_RFC_ERR_UMODEUNKNOWNFLAG .UNINDENT .UNINDENT .sp \fBThread safety:\fP .sp This function can be called simultaneously from multiple threads. .SS irc_cmd_kick .sp \fBPrototype:\fP .INDENT 0.0 .TP .B int irc_cmd_kick (irc_session_t * session, const char * nick, const char * channel, const char * reason); .UNINDENT .sp \fBParameters:\fP .TS center; |l|l|. _ T{ \fIsession\fP T} T{ IRC session handle T} _ T{ \fInick\fP T} T{ The nick to kick T} _ T{ \fIchannel\fP T} T{ The channel to kick the nick from T} _ T{ \fInick\fP T} T{ If not NULL, the reason to kick the user T} _ .TE .sp \fBDescription:\fP .sp 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. .sp \fBReturn value:\fP .sp 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 \fBevent_numeric\fP event. .sp If the command succeed, the \fBevent_kick\fP will be generated. .INDENT 0.0 .TP .B If the command failed, one of the following \fBevent_numeric\fP responses will be generated: .INDENT 7.0 .IP \(bu 2 LIBIRC_RFC_ERR_NEEDMOREPARAMS .IP \(bu 2 LIBIRC_RFC_ERR_BADCHANMASK .IP \(bu 2 LIBIRC_RFC_ERR_NOSUCHCHANNEL .IP \(bu 2 LIBIRC_RFC_ERR_NOTONCHANNEL .IP \(bu 2 LIBIRC_RFC_ERR_CHANOPRIVSNEEDED .UNINDENT .UNINDENT .sp \fBThread safety:\fP .sp This function can be called simultaneously from multiple threads. .SS Sending the messages, notices, /me messages and working with CTCP .SS irc_cmd_msg .sp \fBPrototype:\fP .INDENT 0.0 .TP .B int irc_cmd_msg(irc_session_t *\fI\ session\fP, const char *\fI\ nch\fP, const char *\fI\ text\fP) .UNINDENT .sp \fBParameters:\fP .TS center; |l|l|. _ T{ \fIsession\fP T} T{ IRC session handle T} _ T{ \fInch\fP T} T{ Target nick or target channel T} _ T{ \fItext\fP T} T{ Message text T} _ .TE .sp \fBDescription:\fP .sp 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 \fInch\fP 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. .sp 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. .sp \fBReturn value:\fP .sp 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 \fBevent_numeric\fP event. .sp If the command succeed, no event is typically generated except the possibility of LIBIRC_RFC_RPL_AWAY. .INDENT 0.0 .TP .B However if the command failed, one of the following numeric events may be generated: .INDENT 7.0 .IP \(bu 2 LIBIRC_RFC_ERR_NORECIPIENT .IP \(bu 2 LIBIRC_RFC_ERR_NOTEXTTOSEND .IP \(bu 2 LIBIRC_RFC_ERR_CANNOTSENDTOCHAN .IP \(bu 2 LIBIRC_RFC_ERR_NOTONCHANNEL .IP \(bu 2 LIBIRC_RFC_ERR_NOTOPLEVEL .IP \(bu 2 LIBIRC_RFC_ERR_WILDTOPLEVEL .IP \(bu 2 LIBIRC_RFC_ERR_TOOMANYTARGETS .IP \(bu 2 LIBIRC_RFC_ERR_NOSUCHNICK .UNINDENT .UNINDENT .sp \fBThread safety:\fP .sp This function can be called simultaneously from multiple threads. .SS irc_cmd_me .sp \fBPrototype:\fP .INDENT 0.0 .TP .B int irc_cmd_me(irc_session_t *\fI\ session\fP, const char *\fI\ nch\fP, const char *\fI\ text\fP) .UNINDENT .sp \fBParameters:\fP .TS center; |l|l|. _ T{ \fIsession\fP T} T{ IRC session handle T} _ T{ \fInch\fP T} T{ Target nick or target channel T} _ T{ \fItext\fP T} T{ Message text T} _ .TE .sp \fBDescription:\fP .sp 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 \fInch\fP 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. .sp 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. .sp \fBReturn value:\fP .sp 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 \fBevent_numeric\fP event. .sp If the command succeed, no event is typically generated except the possibility of LIBIRC_RFC_RPL_AWAY. .INDENT 0.0 .TP .B However if the command failed, one of the following numeric events may be generated: .INDENT 7.0 .IP \(bu 2 LIBIRC_RFC_ERR_NORECIPIENT .IP \(bu 2 LIBIRC_RFC_ERR_NOTEXTTOSEND .IP \(bu 2 LIBIRC_RFC_ERR_CANNOTSENDTOCHAN .IP \(bu 2 LIBIRC_RFC_ERR_NOTONCHANNEL .IP \(bu 2 LIBIRC_RFC_ERR_NOTOPLEVEL .IP \(bu 2 LIBIRC_RFC_ERR_WILDTOPLEVEL .IP \(bu 2 LIBIRC_RFC_ERR_TOOMANYTARGETS .IP \(bu 2 LIBIRC_RFC_ERR_NOSUCHNICK .UNINDENT .UNINDENT .sp \fBThread safety:\fP .sp This function can be called simultaneously from multiple threads. .SS irc_cmd_notice .sp \fBPrototype:\fP .INDENT 0.0 .TP .B int irc_cmd_notice(irc_session_t *\fI\ session\fP, const char *\fI\ nch\fP, const char *\fI\ text\fP) .UNINDENT .sp \fBParameters:\fP .TS center; |l|l|. _ T{ \fIsession\fP T} T{ IRC session handle T} _ T{ \fInch\fP T} T{ Target nick or target channel T} _ T{ \fItext\fP T} T{ Message text T} _ .TE .sp \fBDescription:\fP .sp 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 \fInch\fP 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. .sp 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. .sp The only difference between a message and a notice is that the RFC explicitly says the automatic bots must not reply to NOTICE automatically. .sp \fBReturn value:\fP .sp 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 \fBevent_numeric\fP event. .sp If the command succeed, no event is typically generated except the possibility of LIBIRC_RFC_RPL_AWAY. .INDENT 0.0 .TP .B However if the command failed, one of the following numeric events may be generated: .INDENT 7.0 .IP \(bu 2 LIBIRC_RFC_ERR_NORECIPIENT .IP \(bu 2 LIBIRC_RFC_ERR_NOTEXTTOSEND .IP \(bu 2 LIBIRC_RFC_ERR_CANNOTSENDTOCHAN .IP \(bu 2 LIBIRC_RFC_ERR_NOTONCHANNEL .IP \(bu 2 LIBIRC_RFC_ERR_NOTOPLEVEL .IP \(bu 2 LIBIRC_RFC_ERR_WILDTOPLEVEL .IP \(bu 2 LIBIRC_RFC_ERR_TOOMANYTARGETS .IP \(bu 2 LIBIRC_RFC_ERR_NOSUCHNICK .UNINDENT .UNINDENT .sp \fBThread safety:\fP .sp This function can be called simultaneously from multiple threads. .SS irc_cmd_ctcp_request .sp \fBPrototype:\fP .INDENT 0.0 .TP .B int irc_cmd_ctcp_request(irc_session_t *\fI\ session\fP, const char *\fI\ nick\fP, const char *\fI\ request\fP) .UNINDENT .sp \fBParameters:\fP .TS center; |l|l|. _ T{ \fIsession\fP T} T{ IRC session handle T} _ T{ \fInick\fP T} T{ Target nick T} _ T{ \fIrequest\fP T} T{ CTCP request tex T} _ .TE .sp \fBDescription:\fP .sp This function is used to send a CTCP request. There are four CTCP requests supported by most IRC clients: .INDENT 0.0 .INDENT 3.5 .INDENT 0.0 .IP \(bu 2 VERSION \- get the client software name and version .IP \(bu 2 FINGER \- get the client username, host and real name. .IP \(bu 2 PING \- get the client delay. .IP \(bu 2 TIME \- get the client local time. .UNINDENT .UNINDENT .UNINDENT .sp Some clients may support other requests. The RFC does not list the requests and does not mandate any CTCP support. .sp If you send the CTCP request, make sure you define the handler for the \fBevent_ctcp_rep\fP to process the reply; .sp \fBReturn value:\fP .sp 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 \fBevent_numeric\fP event. .INDENT 0.0 .TP .B Possible error responces for this command from the RFC1459: .INDENT 7.0 .IP \(bu 2 LIBIRC_RFC_ERR_NORECIPIENT .IP \(bu 2 LIBIRC_RFC_ERR_NOTEXTTOSEND .IP \(bu 2 LIBIRC_RFC_ERR_CANNOTSENDTOCHAN .IP \(bu 2 LIBIRC_RFC_ERR_NOTONCHANNEL .IP \(bu 2 LIBIRC_RFC_ERR_NOTOPLEVEL .IP \(bu 2 LIBIRC_RFC_ERR_WILDTOPLEVEL .IP \(bu 2 LIBIRC_RFC_ERR_TOOMANYTARGETS .IP \(bu 2 LIBIRC_RFC_ERR_NOSUCHNICK .UNINDENT .UNINDENT .sp \fBThread safety:\fP .sp This function can be called simultaneously from multiple threads. .SS irc_cmd_ctcp_reply .sp \fBPrototype:\fP .INDENT 0.0 .TP .B int irc_cmd_ctcp_reply(irc_session_t *\fI\ session\fP, const char *\fI\ nick\fP, const char *\fI\ reply\fP) .UNINDENT .sp \fBParameters:\fP .TS center; |l|l|. _ T{ \fIsession\fP T} T{ IRC session handle T} _ T{ \fInick\fP T} T{ Target nick T} _ T{ \fIreply\fP T} T{ CTCP reply T} _ .TE .sp \fBDescription:\fP .sp This function is used to send a reply to the CTCP request received from \fBevent_ctcp_req\fP event. Note that you will not receive this event unless you specify your own handler during the IRC session initialization. .sp \fBReturn value:\fP .sp 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 \fBevent_numeric\fP event. .INDENT 0.0 .TP .B Possible error responces for this command from the RFC1459: .INDENT 7.0 .IP \(bu 2 LIBIRC_RFC_ERR_NORECIPIENT .IP \(bu 2 LIBIRC_RFC_ERR_NOTEXTTOSEND .IP \(bu 2 LIBIRC_RFC_ERR_CANNOTSENDTOCHAN .IP \(bu 2 LIBIRC_RFC_ERR_NOTONCHANNEL .IP \(bu 2 LIBIRC_RFC_ERR_NOTOPLEVEL .IP \(bu 2 LIBIRC_RFC_ERR_WILDTOPLEVEL .IP \(bu 2 LIBIRC_RFC_ERR_TOOMANYTARGETS .IP \(bu 2 LIBIRC_RFC_ERR_NOSUCHNICK .UNINDENT .UNINDENT .sp \fBThread safety:\fP .sp This function can be called simultaneously from multiple threads. .SS Miscellaneous: library version, raw data, changing nick, quitting .SS irc_cmd_nick .sp \fBPrototype:\fP .INDENT 0.0 .TP .B int irc_cmd_nick(irc_session_t *\fI\ session\fP, const char *\fI\ newnick\fP) .UNINDENT .sp \fBParameters:\fP .TS center; |l|l|. _ T{ \fIsession\fP T} T{ IRC session handle T} _ T{ \fInick\fP T} T{ New nick T} _ .TE .sp \fBDescription:\fP .sp 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. .sp \fBReturn value:\fP .sp 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 \fBevent_numeric\fP event. .INDENT 0.0 .TP .B If the operation succeed, the server will send the \fBevent_nick\fP event. If not, it will send a numeric error. Possible error responces for this command from the RFC1459: .INDENT 7.0 .IP \(bu 2 LIBIRC_RFC_ERR_NONICKNAMEGIVEN .IP \(bu 2 LIBIRC_RFC_ERR_ERRONEUSNICKNAME .IP \(bu 2 LIBIRC_RFC_ERR_NICKNAMEINUSE .IP \(bu 2 LIBIRC_RFC_ERR_NICKCOLLISION .UNINDENT .UNINDENT .sp \fBThread safety:\fP .sp This function can be called simultaneously from multiple threads. .SS irc_cmd_whois .sp \fBPrototype:\fP .INDENT 0.0 .TP .B int irc_cmd_whois(irc_session_t *\fI\ session\fP, const char *\fI\ nick\fP) .UNINDENT .sp \fBParameters:\fP .TS center; |l|l|. _ T{ \fIsession\fP T} T{ IRC session handle T} _ T{ \fInick\fP T} T{ Nick or comma\-separated list of nicks to query the information about T} _ .TE .sp \fBDescription:\fP .sp 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. .sp \fBReturn value:\fP .sp 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 \fBevent_numeric\fP event. .INDENT 0.0 .TP .B If the request succeed, the information is returned through the following numeric codes which return the information: .INDENT 7.0 .IP \(bu 2 LIBIRC_RFC_RPL_WHOISUSER .IP \(bu 2 LIBIRC_RFC_RPL_WHOISCHANNELS .IP \(bu 2 LIBIRC_RFC_RPL_WHOISSERVER .IP \(bu 2 LIBIRC_RFC_RPL_AWAY .IP \(bu 2 LIBIRC_RFC_RPL_WHOISOPERATOR .IP \(bu 2 LIBIRC_RFC_RPL_WHOISIDLE .IP \(bu 2 LIBIRC_RFC_RPL_ENDOFWHOIS \- this event terminates the WHOIS information .UNINDENT .TP .B Possible error responces for this command from the RFC1459: .INDENT 7.0 .IP \(bu 2 LIBIRC_RFC_ERR_NOSUCHSERVER .IP \(bu 2 LIBIRC_RFC_ERR_NOSUCHNICK .IP \(bu 2 LIBIRC_RFC_ERR_NONICKNAMEGIVEN .UNINDENT .UNINDENT .sp \fBThread safety:\fP .sp This function can be called simultaneously from multiple threads. .SS irc_cmd_quit .sp \fBPrototype:\fP .INDENT 0.0 .TP .B int irc_cmd_quit(irc_session_t *\fI\ session\fP, const char *\fI\ reason\fP) .UNINDENT .sp \fBParameters:\fP .TS center; |l|l|. _ T{ \fIsession\fP T} T{ IRC session handle T} _ T{ \fIreason\fP T} T{ If not NULL, the reason to quit T} _ .TE .sp \fBDescription:\fP 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. .sp 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. .sp \fBReturn value:\fP .sp 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 \fBevent_numeric\fP event. .sp \fBThread safety:\fP .sp This function can be called simultaneously from multiple threads. .SS irc_send_raw .sp \fBPrototype:\fP .INDENT 0.0 .TP .B int irc_send_raw (irc_session_t * session, const char * format, ...); .UNINDENT .sp \fBParameters:\fP .TS center; |l|l|. _ T{ \fIsession\fP T} T{ IRC session handle T} _ T{ \fIformat\fP T} T{ printf\-type formatting string followed by the format arguments T} _ .TE .sp \fBDescription:\fP .sp 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. .sp \fBReturn value:\fP .sp 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 \fBevent_numeric\fP event. .sp \fBThread safety:\fP .sp This function can be called simultaneously from multiple threads. .SS irc_target_get_nick .sp \fBPrototype:\fP .INDENT 0.0 .TP .B void irc_target_get_nick(const char *\fI\ origin\fP, char\fI\ *nick\fP, size_t\fI\ size\fP) .UNINDENT .sp \fBParameters:\fP .TS center; |l|l|. _ T{ \fIorigin\fP T} T{ Nick in the common IRC server format such as tim!root@mycomain.com T} _ T{ \fInick\fP T} T{ Buffer to retrieve the parsed nick name T} _ T{ \fIsize\fP T} T{ Size of the \fInick\fP buffer. If the parsed nick is larger than the buffer size it will be truncated T} _ .TE .sp \fBDescription:\fP .sp For most events IRC server returns \(aqorigin\(aq (i.e. the person, who generated this event) in so\-called "common" form, like \fI\%nick!host@domain\fP. 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. .sp A buffer of size 128 should be enough for most nicks. .sp \fBThread safety:\fP .sp This function can be called simultaneously from multiple threads. .SS irc_target_get_host .sp \fBPrototype:\fP .INDENT 0.0 .TP .B void irc_target_get_host(const char *\fI\ target\fP, char\fI\ *host\fP, size_t\fI\ size\fP) .UNINDENT .sp \fBParameters:\fP .TS center; |l|l|. _ T{ \fIorigin\fP T} T{ Nick in the common IRC server format such as tim!root@mycomain.com T} _ T{ \fIhost\fP T} T{ Buffer to retrieve the parsed hostname T} _ T{ \fIsize\fP T} T{ Size of the \fIhost\fP buffer. If the parsed nick is larger than the buffer size it will be truncated T} _ .TE .sp \fBDescription:\fP .sp For most events IRC server returns \(aqorigin\(aq (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. .sp \fBThread safety:\fP .sp This function can be called simultaneously from multiple threads. .SS DCC initiating and accepting chat sessions, sending and receiving files .SS irc_dcc_chat .sp \fBPrototype:\fP .INDENT 0.0 .TP .B int irc_dcc_chat(irc_session_t *\fI\ session\fP, void *\fI\ ctx\fP, const char *\fI\ nick\fP, irc_dcc_callback_t\fI\ callback\fP, irc_dcc_t *\fI\ dccid\fP) .UNINDENT .sp \fBParameters:\fP .TS center; |l|l|. _ T{ \fIsession\fP T} T{ IRC session handle T} _ T{ \fIctx\fP T} T{ User\-defined context which will be passed to the callback. May be NULL T} _ T{ \fInick\fP T} T{ Target nick T} _ T{ \fIcallback\fP T} T{ DCC callback which will be used for DCC and chat events T} _ T{ \fIdccid\fP T} T{ If this function succeeds, the DCC session identifier is stored in this field T} _ .TE .sp \fBDescription:\fP .sp 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. .sp When the chat is accepted, declined, terminated, or some data is received, the \fIcallback\fP function is called. To be specific, the callback will be called when: .INDENT 0.0 .INDENT 3.5 .INDENT 0.0 .IP \(bu 2 The chat request is accepted; .IP \(bu 2 The chat request is denied; .IP \(bu 2 The new chat message is received; .IP \(bu 2 The chat is terminated by the remote party; .UNINDENT .UNINDENT .UNINDENT .sp See the details in \fBirc_dcc_callback_t\fP declaration. .sp \fBReturn value:\fP .sp 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 \fBevent_numeric\fP event. .INDENT 0.0 .TP .B Possible error responces for this command from the RFC1459: .INDENT 7.0 .IP \(bu 2 LIBIRC_RFC_ERR_NORECIPIENT .IP \(bu 2 LIBIRC_RFC_ERR_NOTEXTTOSEND .IP \(bu 2 LIBIRC_RFC_ERR_CANNOTSENDTOCHAN .IP \(bu 2 LIBIRC_RFC_ERR_NOTONCHANNEL .IP \(bu 2 LIBIRC_RFC_ERR_NOTOPLEVEL .IP \(bu 2 LIBIRC_RFC_ERR_WILDTOPLEVEL .IP \(bu 2 LIBIRC_RFC_ERR_TOOMANYTARGETS .IP \(bu 2 LIBIRC_RFC_ERR_NOSUCHNICK .UNINDENT .UNINDENT .sp \fBThread safety:\fP .sp This function can be called simultaneously from multiple threads. .SS irc_dcc_msg .sp \fBPrototype:\fP .INDENT 0.0 .TP .B int irc_dcc_msg(irc_session_t *\fI\ session\fP, irc_dcc_t\fI\ dccid\fP, const char *\fI\ text\fP) .UNINDENT .sp \fBParameters:\fP .TS center; |l|l|. _ T{ \fIsession\fP T} T{ IRC session handle T} _ T{ \fIdccid\fP T} T{ DCC session identifier for the DCC CHAT session which is active T} _ T{ \fItext\fP T} T{ NULL\-terminated message to send T} _ .TE .sp \fBDescription:\fP .sp 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. .sp \fBReturn value:\fP .sp Return code 0 means success. Other value means error, the error code may be obtained through irc_errno(). .sp \fBThread safety:\fP .sp This function can be called simultaneously from multiple threads. .SS irc_dcc_accept .sp \fBPrototype:\fP .INDENT 0.0 .TP .B int irc_dcc_accept(irc_session_t *\fI\ session\fP, irc_dcc_t\fI\ dccid\fP, void *\fI\ ctx\fP, irc_dcc_callback_t\fI\ callback\fP) .UNINDENT .sp \fBParameters:\fP .TS center; |l|l|. _ T{ \fIsession\fP T} T{ IRC session handle T} _ T{ \fIdccid\fP T} T{ DCC session identifier returned by the callback T} _ T{ \fIctx\fP T} T{ User\-defined context which will be passed to the callback. May be NULL T} _ T{ \fIcallback\fP T} T{ DCC callback which will be used for DCC and chat events T} _ .TE .sp \fBDescription:\fP .sp This function accepts a remote DCC chat or file transfer request. After the request is accepted the \fIcallback\fP will be called for the further DCC events, including the termination of the DCC session. See the \fBDCC callback information\fP. .sp This function should be called only after either \fBevent_dcc_chat_req\fP or \fBevent_dcc_send_req\fP events are received. You don\(aqt have to call irc_dcc_accept() or irc_dcc_decline() immediately in the event processing function \- you may just store the \fIdccid\fP 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. .sp \fBReturn value:\fP .sp Return code 0 means success. Other value means error, the error code may be obtained through \fBirc_errno()\fP. .sp \fBThread safety:\fP .sp This function can be called simultaneously from multiple threads. .SS irc_dcc_decline .sp \fBPrototype:\fP .INDENT 0.0 .TP .B int irc_dcc_decline(irc_session_t *\fI\ session\fP, irc_dcc_t\fI\ dccid\fP) .UNINDENT .sp \fBParameters:\fP .TS center; |l|l|. _ T{ \fIsession\fP T} T{ IRC session handle T} _ T{ \fIdccid\fP T} T{ DCC session identifier returned by the callback T} _ .TE .sp \fBDescription:\fP .sp This function declines a remote DCC chat or file transfer request. .sp This function should be called only after either \fBevent_dcc_chat_req\fP or \fBevent_dcc_send_req\fP events are received. You don\(aqt have to call irc_dcc_accept() or irc_dcc_decline() immediately in the event processing function \- you may just store the \fIdccid\fP 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. .sp Do not use this function to forecefully close the previously accepted or initiated DCC session. Use \fBirc_dcc_destroy()\fP instead. .sp \fBReturn value:\fP .sp Return code 0 means success. Other value means error, the error code may be obtained through \fBirc_errno()\fP. .sp \fBThread safety:\fP .sp This function can be called simultaneously from multiple threads. .SS irc_dcc_sendfile .sp \fBPrototype:\fP .INDENT 0.0 .TP .B int irc_dcc_sendfile(irc_session_t *\fI\ session\fP, void *\fI\ ctx\fP, const char *\fI\ nick\fP, const char *\fI\ filename\fP, irc_dcc_callback_t\fI\ callback\fP, irc_dcc_t *\fI\ dccid\fP) .UNINDENT .sp \fBParameters:\fP .TS center; |l|l|. _ T{ \fIsession\fP T} T{ IRC session handle T} _ T{ \fIctx\fP T} T{ User\-defined context which will be passed to the callback. May be NULL T} _ T{ \fInick\fP T} T{ Target nick T} _ T{ \fIfilename\fP T} T{ Full path to the file which will be sent. Must be an existing file T} _ T{ \fIcallback\fP T} T{ DCC callback which will be used for DCC and chat events T} _ T{ \fIdccid\fP T} T{ If this function succeeds, the DCC session identifier is stored in this field T} _ .TE .sp \fBDescription:\fP .sp 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 \fBDCC callback information\fP. .sp \fBReturn value:\fP .sp 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 \fBevent_numeric\fP event. .INDENT 0.0 .TP .B Possible error responces for this command from the RFC1459: .INDENT 7.0 .IP \(bu 2 LIBIRC_RFC_ERR_NORECIPIENT .IP \(bu 2 LIBIRC_RFC_ERR_NOTEXTTOSEND .IP \(bu 2 LIBIRC_RFC_ERR_CANNOTSENDTOCHAN .IP \(bu 2 LIBIRC_RFC_ERR_NOTONCHANNEL .IP \(bu 2 LIBIRC_RFC_ERR_NOTOPLEVEL .IP \(bu 2 LIBIRC_RFC_ERR_WILDTOPLEVEL .IP \(bu 2 LIBIRC_RFC_ERR_TOOMANYTARGETS .IP \(bu 2 LIBIRC_RFC_ERR_NOSUCHNICK .UNINDENT .UNINDENT .sp \fBThread safety:\fP .sp This function can be called simultaneously from multiple threads. .SS irc_dcc_destroy .sp \fBPrototype:\fP .INDENT 0.0 .TP .B int irc_dcc_destroy(irc_session_t *\fI\ session\fP, irc_dcc_t\fI\ dccid\fP) .UNINDENT .sp \fBParameters:\fP .TS center; |l|l|. _ T{ \fIsession\fP T} T{ IRC session handle T} _ T{ \fIdccid\fP T} T{ DCC session identifier of a session to destroy T} _ .TE .sp \fBDescription:\fP .sp 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. .sp Note that when DCC session is finished (either with success or failure), you should not destroy it \- it will be destroyed automatically. .sp \fBReturn value:\fP .sp Return code 0 means success. Other value means error, the error code may be obtained through \fBirc_errno()\fP. .sp \fBThread safety:\fP .sp This function can be called simultaneously from multiple threads. .SS Handling the colored messages .SS irc_color_strip_from_mirc .sp \fBPrototype:\fP .INDENT 0.0 .TP .B char * irc_color_strip_from_mirc(const char *\fI\ message\fP) .UNINDENT .sp \fBParameters:\fP .TS center; |l|l|. _ T{ \fImessage\fP T} T{ Original message with colors T} _ .TE .sp \fBDescription:\fP .sp 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. .sp This function does not modify the message which doesn\(aqt use colors. .sp \fBReturn value:\fP .sp 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. .sp \fBThread safety:\fP .sp This function can be called simultaneously from multiple threads. .SS irc_color_convert_from_mirc .sp \fBPrototype:\fP .INDENT 0.0 .TP .B char * irc_color_convert_from_mirc(const char *\fI\ message\fP) .UNINDENT .sp \fBParameters:\fP .TS center; |l|l|. _ T{ \fImessage\fP T} T{ Original message with colors T} _ .TE .sp \fBDescription:\fP .sp This function converts all the color codes and format options to libircclient internal colors. .sp \fBReturn value:\fP .sp Returns a pointer to the new message with converted ANSI color codes and format options. See the \fI\%irc_color_convert_to_mirc\fP help for details. .sp 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. .sp \fBThread safety:\fP .sp This function can be called simultaneously from multiple threads. .SS irc_color_convert_to_mirc .sp \fBPrototype:\fP .INDENT 0.0 .TP .B char * irc_color_convert_to_mirc(const char *\fI\ message\fP) .UNINDENT .sp \fBParameters:\fP .TS center; |l|l|. _ T{ \fImessage\fP T} T{ Original message with colors T} _ .TE .sp \fBDescription:\fP .sp This function converts all the color codes and format options from internal libircclient colors to ANSI used by mIRC and other IRC clients. .sp \fBReturn value:\fP .sp 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. .sp \fBThread safety:\fP .sp This function can be called simultaneously from multiple threads. .sp 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. .INDENT 0.0 .TP .B The possible codes are: .INDENT 7.0 .IP \(bu 2 [B] ... [/B] \- bold format mode. Everything between [B] and [/B] is written in \fBbold\fP. .IP \(bu 2 [I] ... [/I] \- italic/reverse format mode. Everything between [I] and [/I] is written in \fIitalic\fP, 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). .IP \(bu 2 [U] ... [/U] \- underline format mode. Everything between [U] and [/U] is written underlined. .IP \(bu 2 [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). .IP \(bu 2 [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. .UNINDENT .TP .B The following colors are supported: .INDENT 7.0 .IP \(bu 2 WHITE .IP \(bu 2 BLACK .IP \(bu 2 DARKBLUE .IP \(bu 2 DARKGREEN .IP \(bu 2 RED .IP \(bu 2 BROWN .IP \(bu 2 PURPLE .IP \(bu 2 OLIVE .IP \(bu 2 YELLOW .IP \(bu 2 GREEN .IP \(bu 2 TEAL .IP \(bu 2 CYAN .IP \(bu 2 BLUE .IP \(bu 2 MAGENTA .IP \(bu 2 DARKGRAY .IP \(bu 2 LIGHTGRAY .UNINDENT .UNINDENT .sp Examples of color sequences: .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C 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] .ft P .fi .UNINDENT .UNINDENT .SS Changing the library options .SS irc_get_version .sp \fBPrototype:\fP .INDENT 0.0 .TP .B void irc_get_version(unsigned int *\fI\ high\fP, unsigned int *\fI\ low\fP) .UNINDENT .sp \fBParameters:\fP .TS center; |l|l|. _ T{ \fIhigh\fP T} T{ Stores the high version number T} _ T{ \fIlow\fP T} T{ Stores the low version number T} _ .TE .sp \fBDescription:\fP .sp 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: .sp \fBprintf ("Version: %d.%02d", high, low);\fP .sp \fBThread safety:\fP .sp This function can be called simultaneously from multiple threads. .SS irc_set_ctx .sp \fBPrototype:\fP .INDENT 0.0 .TP .B void irc_set_ctx(irc_session_t *\fI\ session\fP, void *\fI\ ctx\fP) .UNINDENT .sp \fBParameters:\fP .TS center; |l|l|. _ T{ \fIsession\fP T} T{ IRC session handle T} _ T{ \fIctx\fP T} T{ User\-defined context T} _ .TE .sp \fBDescription:\fP .sp 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 \fI\%irc_get_ctx\fP. 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 \fBirc_destroy_session()\fP. .sp \fBThread safety:\fP .sp This function can be called simultaneously from multiple threads. .SS irc_get_ctx .sp \fBPrototype:\fP .INDENT 0.0 .TP .B void * irc_get_ctx(irc_session_t *\fI\ session\fP) .UNINDENT .sp \fBParameters:\fP .TS center; |l|l|. _ T{ \fIsession\fP T} T{ IRC session handle T} _ .TE .sp \fBDescription:\fP .sp This function returns the IRC session context, which was set by \fI\%irc_set_ctx\fP. .sp \fBReturn value:\fP .sp If no context was set, this function returns NULL. .sp \fBThread safety:\fP .sp This function can be called simultaneously from multiple threads. .SS irc_option_set .sp \fBPrototype:\fP .INDENT 0.0 .TP .B void irc_option_set(irc_session_t *\fI\ session\fP, unsigned int\fI\ option\fP) .UNINDENT .sp \fBParameters:\fP .TS center; |l|l|. _ T{ \fIsession\fP T} T{ IRC session handle T} _ T{ \fIoption\fP T} T{ One of the \fILibirc options\fP to set T} _ .TE .sp \fBDescription:\fP .sp This function sets the libircclient option, changing libircclient behavior. See the \fIoptions\fP list for the meaning for every option. .sp \fBThread safety:\fP .sp This function can be called simultaneously from multiple threads. .SS irc_option_reset .sp \fBPrototype:\fP .INDENT 0.0 .TP .B void irc_option_reset(irc_session_t *\fI\ session\fP, unsigned int\fI\ option\fP) .UNINDENT .sp \fBParameters:\fP .TS center; |l|l|. _ T{ \fIsession\fP T} T{ IRC session handle T} _ T{ \fIoption\fP T} T{ One of the \fILibirc options\fP to set T} _ .TE .sp \fBDescription:\fP .sp This function resets the libircclient option, changing libircclient behavior. See the \fIoptions\fP list for the meaning for every option. .sp \fBThread safety:\fP .sp This function can be called simultaneously from multiple threads. .SS Handling the errors .SS irc_errno .sp \fBPrototype:\fP .INDENT 0.0 .TP .B int irc_errno(irc_session_t *\fI\ session\fP) .UNINDENT .sp \fBParameters:\fP .TS center; |l|l|. _ T{ \fIsession\fP T} T{ IRC session handle T} _ .TE .sp \fBDescription:\fP .sp This function returns the last error code associated with last operation of this IRC session. Possible error codes are defined in libirc_errors.h .sp As usual, typical errno rules apply: .INDENT 0.0 .INDENT 3.5 .INDENT 0.0 .IP \(bu 2 irc_errno() should be called ONLY if the called function fails; .IP \(bu 2 irc_errno() doesn\(aqt return 0 if function succeed; actually, the return value will be undefined. .IP \(bu 2 you should call irc_errno() IMMEDIATELY after function fails, before calling any other libircclient function. .UNINDENT .UNINDENT .UNINDENT .sp \fBReturn value:\fP .sp The error code. .sp \fBThread safety:\fP .sp This function can be called simultaneously from multiple threads. Local error code is per IRC context, not per thread. .SS irc_strerror .sp \fBPrototype:\fP .INDENT 0.0 .TP .B const char * irc_strerror(int\fI\ ircerrno\fP) .UNINDENT .sp \fBParameters:\fP .TS center; |l|l|. _ T{ \fIircerrno\fP T} T{ IRC error code returned by \fBirc_errno()\fP T} _ .TE .sp \fBDescription:\fP .sp This function returns the text representation of the given error code. .sp \fBReturn value:\fP .sp Returns an internal English string with a short description of the error code. .sp \fBThread safety:\fP .sp This function can be called simultaneously from multiple threads. .SS Types .sp This section describes various types defined by the library. .SS irc_session_t .INDENT 0.0 .TP .B typedef struct irc_session_s irc_session_t .UNINDENT .sp The IRC session handle created by callind \fBirc_create_session()\fP. 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. .sp Once the handle is not used anymore, it should be destroyed by calling \fBirc_destroy_session()\fP. .SS irc_dcc_session_t .INDENT 0.0 .TP .B typedef struct irc_dcc_session_s irc_dcc_session_t .UNINDENT .sp This structure describes a DCC session used by libircclient. Its members are internal to libircclient, and should not be used directly. .SS irc_dcc_t .INDENT 0.0 .TP .B typedef unsigned int irc_dcc_t .UNINDENT .sp This type is a DCC session identifier, used to identify the DCC sessions in callbacks and various functions. .SS irc_callbacks_t .INDENT 0.0 .TP .B typedef struct irc_callbacks_t .UNINDENT .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C 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; } .ft P .fi .UNINDENT .UNINDENT .sp Describes the event callbacks structure which is used in registering the callbacks. .sp 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. .sp Every event has its own event handler, which is called when the appropriate event is received. You don\(aqt 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. .INDENT 0.0 .TP .B event_connect .UNINDENT .sp 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. .sp This event uses \fBirc_event_callback_t\fP callback with the following values: .TS center; |l|l|. _ T{ \fIorigin\fP T} T{ Unused, set to NULL T} _ T{ \fIparams\fP T} T{ Unused, set to NULL T} _ .TE .INDENT 0.0 .TP .B event_nick .UNINDENT .sp 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. .sp Changing your own nick will also generate this event. Note that the server may change your nick independently, so you must track this event. .sp This event uses \fBirc_event_callback_t\fP callback with the following values: .TS center; |l|l|. _ T{ \fIorigin\fP T} T{ The original nick (may be yours!) T} _ T{ \fIparams\fP T} T{ params[0] contains a new nick. T} _ .TE .INDENT 0.0 .TP .B event_quit .UNINDENT .sp 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. .sp This event uses \fBirc_event_callback_t\fP callback with the following values: .TS center; |l|l|. _ T{ \fIorigin\fP T} T{ The user who disconnected T} _ T{ \fIparams\fP T} T{ params[0] is optional, contains the user\-specified reason to quit T} _ .TE .INDENT 0.0 .TP .B event_join .UNINDENT .sp 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. .sp 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. .sp This event uses \fBirc_event_callback_t\fP callback with the following values: .TS center; |l|l|. _ T{ \fIorigin\fP T} T{ The user who joined the channel (this may be you!) T} _ T{ \fIparams\fP T} T{ params[0] contains the channel name T} _ .TE .INDENT 0.0 .TP .B event_part .UNINDENT .sp 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. .sp This event uses \fBirc_event_callback_t\fP callback with the following values: .TS center; |l|l|. _ T{ \fIorigin\fP T} T{ The user who left the channel (this may be you!) T} _ T{ \fIparams\fP T} T{ params[0] contains the channel name params[1] is optional and contains the user\-specified reason T} _ .TE .INDENT 0.0 .TP .B event_mode .UNINDENT .sp 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). .sp This event uses \fBirc_event_callback_t\fP callback with the following values: .TS center; |l|l|. _ T{ \fIorigin\fP T} T{ The user who performed the change T} _ T{ \fIparams\fP T} T{ 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) T} _ .TE .INDENT 0.0 .TP .B event_umode .UNINDENT .sp This event is triggered upon receipt of a user MODE message. It happens when your user mode is changed. .sp This event uses \fBirc_event_callback_t\fP callback with the following values: .TS center; |l|l|. _ T{ \fIorigin\fP T} T{ The user who performed the change T} _ T{ \fIparams\fP T} T{ params[0] contains the channel name params[1] contains the user mode changes, such as "+t", "\-i" T} _ .TE .INDENT 0.0 .TP .B event_topic .UNINDENT .sp 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). .sp This event uses \fBirc_event_callback_t\fP callback with the following values: .TS center; |l|l|. _ T{ \fIorigin\fP T} T{ The user who performed the change T} _ T{ \fIparams\fP T} T{ params[0] contains the channel name params[1] optional, contains the new topic T} _ .TE .INDENT 0.0 .TP .B event_kick .UNINDENT .sp 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). .sp It is possible to kick yourself from the channel. .sp This event uses \fBirc_event_callback_t\fP callback with the following values: .TS center; |l|l|. _ T{ \fIorigin\fP T} T{ The user who performed the action (may be you) T} _ T{ \fIparams\fP T} T{ params[0] contains the channel name params[1] optional, contains the nick of the kicked params[2] optional, contains the reason for the kick T} _ .TE .INDENT 0.0 .TP .B event_channel .UNINDENT .sp 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). .sp 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. .sp This event uses \fBirc_event_callback_t\fP callback with the following values: .TS center; |l|l|. _ T{ \fIorigin\fP T} T{ The user who sent a message T} _ T{ \fIparams\fP T} T{ params[0] contains the channel name params[1] optional, contains the message text T} _ .TE .INDENT 0.0 .TP .B event_privmsg .UNINDENT .sp This event is triggered upon receipt of a PRIVMSG message sent privately to you. It happens when someone sent you a message. .sp This event uses \fBirc_event_callback_t\fP callback with the following values: .TS center; |l|l|. _ T{ \fIorigin\fP T} T{ The user who sent a message T} _ T{ \fIparams\fP T} T{ params[0] contains your nick params[1] optional, contains the message text T} _ .TE .INDENT 0.0 .TP .B event_notice .UNINDENT .sp This event is triggered upon receipt of a NOTICE message. This message is similar to PRIVMSG and matches the \fI\%event_privmsg\fP. 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. .sp This event uses \fBirc_event_callback_t\fP callback with the following values: .TS center; |l|l|. _ T{ \fIorigin\fP T} T{ The user who sent a message T} _ T{ \fIparams\fP T} T{ params[0] contains the target nick name params[1] optional, contains the message text T} _ .TE .INDENT 0.0 .TP .B event_channel_notice .UNINDENT .sp This event is triggered upon receipt of a NOTICE message. This message is similar to PRIVMSG and matches the \fI\%event_channel\fP. 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. .sp This event uses \fBirc_event_callback_t\fP callback with the following values: .TS center; |l|l|. _ T{ \fIorigin\fP T} T{ The user who sent a message T} _ T{ \fIparams\fP T} T{ params[0] contains the channel name params[1] optional, contains the message text T} _ .TE .INDENT 0.0 .TP .B event_invite .UNINDENT .sp 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. .sp This event uses \fBirc_event_callback_t\fP callback with the following values: .TS center; |l|l|. _ T{ \fIorigin\fP T} T{ The user who invited you T} _ T{ \fIparams\fP T} T{ params[0] contains your nick params[1] optional, contains the channel name T} _ .TE .sp See also: \fBirc_cmd_invite()\fP .INDENT 0.0 .TP .B event_ctcp_req .UNINDENT .sp This event is triggered upon receipt of an CTCP request. By default, the built\-in CTCP request handler is used. .sp Mirc generates \fIPING\fP, \fIFINGER\fP, \fIVERSION\fP, \fITIME\fP and \fIACTION\fP 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 \fI\%event_ctcp_action\fP event. If you need to handle more types of the message, define this event handler, and check the source code of \fBlibirc_event_ctcp_internal\fP 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. .sp Also you may find useful this question in FAQ: ref faq4 .sp This event uses \fBirc_event_callback_t\fP callback with the following values: .TS center; |l|l|. _ T{ \fIorigin\fP T} T{ The user who generated the message T} _ T{ \fIparams\fP T} T{ params[0] contains the complete CTCP message T} _ .TE .INDENT 0.0 .TP .B event_ctcp_rep .UNINDENT .sp 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. .sp This event uses \fBirc_event_callback_t\fP callback with the following values: .TS center; |l|l|. _ T{ \fIorigin\fP T} T{ The user who generated the message T} _ T{ \fIparams\fP T} T{ params[0] contains the complete CTCP message T} _ .TE .INDENT 0.0 .TP .B event_ctcp_action .UNINDENT .sp This event is triggered upon receipt of an CTCP ACTION message. It is only invoked if you did not define the \fI\%event_ctcp_req\fP event handler. .sp Such messages typically look like that in the IRC client: .INDENT 0.0 .TP .B :: [08:32:55] * Michael is having fun [08:32:55] * Bobby\(aqs getting jealous .UNINDENT .sp This event uses \fBirc_event_callback_t\fP callback with the following values: .TS center; |l|l|. _ T{ \fIorigin\fP T} T{ The user who generated the message T} _ T{ \fIparams\fP T} T{ params[0] contains the content of ACTION message T} _ .TE .INDENT 0.0 .TP .B event_unknown .UNINDENT .sp This event is triggered upon receipt of an unknown message which is not handled by the library. .sp This event uses \fBirc_event_callback_t\fP callback with the following values: .TS center; |l|l|. _ T{ \fIorigin\fP T} T{ The user who generated the event T} _ T{ \fIparams\fP T} T{ Zero or more parameters provided with the event T} _ .TE .INDENT 0.0 .TP .B event_numeric .UNINDENT .sp 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. .sp This event uses the dedicated .nf irc_eventcode_callback_t_ .fi callback. See the callback documentation. .INDENT 0.0 .TP .B event_dcc_chat_req .UNINDENT .sp This event is triggered when someone attempts to establish the DCC CHAT with you. .sp This event uses the dedicated \fBirc_event_dcc_chat_t\fP callback. See the callback documentation. .INDENT 0.0 .TP .B event_dcc_send_req .UNINDENT .sp This event is triggered when someone attempts to send you the file via DCC SEND. .sp This event uses the dedicated \fBirc_event_dcc_send_t\fP callback. See the callback documentation. .SS Constants .sp This section describes contstants such as options and the error codes. .SS Errors .INDENT 0.0 .TP .B LIBIRC_ERR_OK .UNINDENT .sp (0): No error .INDENT 0.0 .TP .B LIBIRC_ERR_INVAL .UNINDENT .sp (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 \fBirc_cmd_join()\fP produces this error. .INDENT 0.0 .TP .B LIBIRC_ERR_RESOLV .UNINDENT .sp (2): The host name supplied for \fBirc_connect()\fP function could not be resolved into valid IP address. .INDENT 0.0 .TP .B LIBIRC_ERR_SOCKET .UNINDENT .sp (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 \fIfaq_err_socket\fP .INDENT 0.0 .TP .B LIBIRC_ERR_CONNECT .UNINDENT .sp (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. .INDENT 0.0 .TP .B LIBIRC_ERR_CLOSED .UNINDENT .sp (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. .INDENT 0.0 .TP .B LIBIRC_ERR_NOMEM .UNINDENT .sp (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. .INDENT 0.0 .TP .B LIBIRC_ERR_ACCEPT .UNINDENT .sp (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. .INDENT 0.0 .TP .B LIBIRC_ERR_NODCCSEND .UNINDENT .sp (9): A filename supplied to \fBirc_dcc_sendfile()\fP 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 \fBLIBIRC_ERR_OPENFILE\fP .INDENT 0.0 .TP .B LIBIRC_ERR_READ .UNINDENT .sp (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. .INDENT 0.0 .TP .B LIBIRC_ERR_WRITE .UNINDENT .sp (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. .INDENT 0.0 .TP .B LIBIRC_ERR_STATE .UNINDENT .sp (12): The function is called when it is not allowed to be called. For example, \fBirc_cmd_join()\fP was called before the connection to IRC server succeed, and \fBevent_connect\fP is called. .INDENT 0.0 .TP .B LIBIRC_ERR_TIMEOUT .UNINDENT .sp (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. .INDENT 0.0 .TP .B LIBIRC_ERR_OPENFILE .UNINDENT .sp (14): The file specified in \fBirc_dcc_sendfile()\fP could not be opened. .INDENT 0.0 .TP .B LIBIRC_ERR_TERMINATED .UNINDENT .sp (15): The connection to the IRC server was terminated. .INDENT 0.0 .TP .B LIBIRC_ERR_NOIPV6 .UNINDENT .sp (16): The function which requires IPv6 support was called, but the IPv6 support was not compiled into the application .INDENT 0.0 .TP .B LIBIRC_ERR_SSL_NOT_SUPPORTED .UNINDENT .sp (17): The SSL connection was required but the library was not compiled with SSL support .INDENT 0.0 .TP .B LIBIRC_ERR_SSL_INIT_FAILED .UNINDENT .sp (18): The SSL library could not be initialized. .INDENT 0.0 .TP .B LIBIRC_ERR_CONNECT_SSL_FAILED .UNINDENT .sp (19): SSL handshare failed when attempting to connect to the server. Typically this means you\(aqre trying to use SSL but attempting to connect to a non\-SSL port. .INDENT 0.0 .TP .B LIBIRC_ERR_SSL_CERT_VERIFY_FAILED .UNINDENT .sp (20): The server is using an invalid or the self\-signed certificate. Use \fBLIBIRC_OPTION_SSL_NO_VERIFY\fP option to connect to it. .SS Options .INDENT 0.0 .TP .B LIBIRC_OPTION_DEBUG .UNINDENT .sp If set, enables additional debug output which goes to STDOUT. .INDENT 0.0 .TP .B LIBIRC_OPTION_STRIPNICKS .UNINDENT .sp If set, strips the event origins automatically. Every event has an origin (i.e. who originated the event). The origin usually looks like \fInick!host@ircserver\fP, i.e. like \fItim!home@irc.server.net\fP. 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 \fBirc_target_get_nick()\fP, or automatically for all the events if this option is set. .INDENT 0.0 .TP .B LIBIRC_OPTION_SSL_NO_VERIFY .UNINDENT .sp 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. .sp This option must be set before the \fBirc_connect\fP function is called. .SH APPENDIX .SS Frequently asked questions .SS Why do I get a LIBIRC_ERR_SOCKET error under Win32 when using a static library? .sp Because on Win32 you have to initialize the Winsock API before using it: .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C WSADATA wsaData; if ( WSAStartup ( MAKEWORD (2, 2), &wsaData) != 0 ) // report an error // Now you can use libircclient .ft P .fi .UNINDENT .UNINDENT .sp 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. .SS What does it mean that the IRC protocol is event\-based? .sp The IRC protocol itself is asynchronous and server\-driven. For you, this means the following: .INDENT 0.0 .INDENT 3.5 .INDENT 0.0 .IP \(bu 2 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. .IP \(bu 2 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. .IP \(bu 2 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. .IP \(bu 2 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. .IP \(bu 2 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. .IP \(bu 2 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. .IP \(bu 2 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. .UNINDENT .UNINDENT .UNINDENT .SS Why the irc_cmd_join function does not return an error? .sp A typical example is the \fBirc_cmd_join()\fP 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. .SS How to register/auth with NICKSERV? .sp 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: .INDENT 0.0 .INDENT 3.5 .sp .nf .ft 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."); } .ft P .fi .UNINDENT .UNINDENT .sp The idea is to parse the messages sent from NICKSERV, and if they’re matched the specific patterns, react on them appropriately. .SS What is CTCP? .sp 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. .sp 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. .SS When I am made a chanop (+o) why do I not receive the event_umode? .sp Becoming a channel operator channes the \fBchannel mode\fP, not user mode. Therefore you will receive \fBevent_mode\fP and not \fBevent_umode\fP .sp If you receive the event_umode with +o this means your user is an IRC server operator. .SS What if my application uses epoll? .sp 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: .INDENT 0.0 .INDENT 3.5 .INDENT 0.0 .IP \(bu 2 Call irc_add_select_descriptors with an empty FD_SET .IP \(bu 2 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. .IP \(bu 2 Pass those descriptors to poll/epoll using relevant events (i.e. use the EPOLLIN for the descriptors in the \fIin_set\fP) .IP \(bu 2 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 \fBirc_process_select_descriptors()\fP .UNINDENT .UNINDENT .UNINDENT .sp 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. .SS GNU LESSER GENERAL PUBLIC LICENSE .sp Version 3, 29 June 2007 .sp Copyright © 2007 Free Software Foundation, Inc. <\fI\%http://fsf.org/\fP> .sp Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. .sp 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. .INDENT 0.0 .IP 0. 4 Additional Definitions. .UNINDENT .sp 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. .sp “The Library” refers to a covered work governed by this License, other than an Application or a Combined Work as defined below. .sp 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. .sp 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”. .sp 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. .sp 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. .sp 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. .sp 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: .INDENT 0.0 .INDENT 3.5 .INDENT 0.0 .IP a. 3 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 .IP b. 3 under the GNU GPL, with none of the additional permissions of this License applicable to that copy. .UNINDENT .UNINDENT .UNINDENT .INDENT 0.0 .IP 3. 3 Object Code Incorporating Material from Library Header Files. .UNINDENT .sp 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: .INDENT 0.0 .INDENT 3.5 .INDENT 0.0 .IP a. 3 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. .IP b. 3 Accompany the object code with a copy of the GNU GPL and this license document. .UNINDENT .UNINDENT .UNINDENT .INDENT 0.0 .IP 4. 3 Combined Works. .UNINDENT .sp 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: .INDENT 0.0 .INDENT 3.5 .INDENT 0.0 .IP a. 3 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. .IP b. 3 Accompany the Combined Work with a copy of the GNU GPL and this license document. .IP c. 3 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. .IP d. 3 .INDENT 3.0 .TP .B Do one of the following: .INDENT 7.0 .IP 0. 4 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. .IP 1. 4 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\(aqs computer system, and (b) will operate properly with a modified version of the Library that is interface\-compatible with the Linked Version. .UNINDENT .UNINDENT .IP e. 3 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.) .UNINDENT .UNINDENT .UNINDENT .INDENT 0.0 .IP 5. 3 Combined Libraries. .UNINDENT .sp 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: .INDENT 0.0 .INDENT 3.5 .INDENT 0.0 .IP a. 3 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. .IP b. 3 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. .UNINDENT .UNINDENT .UNINDENT .INDENT 0.0 .IP 6. 3 Revised Versions of the GNU Lesser General Public License. .UNINDENT .sp 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. .sp 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. .sp 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\(aqs public statement of acceptance of any version is permanent authorization for you to choose that version for the Library. .SS Indices and tables .INDENT 0.0 .IP \(bu 2 \fIgenindex\fP .IP \(bu 2 \fImodindex\fP .IP \(bu 2 \fIsearch\fP .UNINDENT .SH AUTHOR George Yunaev .SH COPYRIGHT 2013, George Yunaev .\" Generated by docutils manpage writer. . libircclient-1.8/PaxHeaders.13636/configure0000644000000000000000000000012411706656172016744 xustar000000000000000027 mtime=1327193210.517601 27 atime=1399667494.707956 30 ctime=1399667494.708956931 libircclient-1.8/configure0000755000175000001440000051160611706656172015770 0ustar00timusers00000000000000#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.68 for libircclient 1.3. # # Report bugs to . # # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, # 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 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 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" 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 : # 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 export CONFIG_SHELL 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+"$@"} 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_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; } # 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 -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi else as_ln_s='cp -p' 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 if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in #( -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #(( ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # 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 $as_echo "$as_me: WARNING: if you wanted to set the --build type, don't use --host. If a cross compiler is detected then cross compile mode will be used" >&2 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.68 Copyright (C) 2010 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 || $as_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.68. 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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 #include #include /* 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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" { test -f "$ac_path_GREP" && $as_test_x "$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" { test -f "$ac_path_EGREP" && $as_test_x "$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 () { /* FIXME: Include the comments suggested by Paul. */ #ifndef __cplusplus /* Ultrix mips cc rejects this. */ typedef int charset[2]; const charset cs; /* 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. */ char *t; 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 saying "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ struct s { int j; const int *ap[3]; }; struct s *b; 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_new_ex_data in -lcrypto" >&5 $as_echo_n "checking for CRYPTO_new_ex_data in -lcrypto... " >&6; } if ${ac_cv_lib_crypto_CRYPTO_new_ex_data+:} 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_new_ex_data (); int main () { return CRYPTO_new_ex_data (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_crypto_CRYPTO_new_ex_data=yes else ac_cv_lib_crypto_CRYPTO_new_ex_data=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_new_ex_data" >&5 $as_echo "$ac_cv_lib_crypto_CRYPTO_new_ex_data" >&6; } if test "x$ac_cv_lib_crypto_CRYPTO_new_ex_data" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBCRYPTO 1 _ACEOF LIBS="-lcrypto $LIBS" else as_fn_error $? "OpenSSL not found" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SSL_library_init in -lssl" >&5 $as_echo_n "checking for SSL_library_init in -lssl... " >&6; } if ${ac_cv_lib_ssl_SSL_library_init+:} 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_library_init (); int main () { return SSL_library_init (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_ssl_SSL_library_init=yes else ac_cv_lib_ssl_SSL_library_init=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_library_init" >&5 $as_echo "$ac_cv_lib_ssl_SSL_library_init" >&6; } if test "x$ac_cv_lib_ssl_SSL_library_init" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBSSL 1 _ACEOF LIBS="-lssl $LIBS" else as_fn_error $? "OpenSSL not found" "$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 -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi else as_ln_s='cp -p' 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 if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in #( -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #(( ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # 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.68. 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.68, with options \\"\$ac_cs_config\\" Copyright (C) 2010 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 libircclient-1.8/PaxHeaders.13636/include0000644000000000000000000000013212333235446016377 xustar000000000000000030 mtime=1399667494.711956931 30 atime=1399667494.710956931 30 ctime=1399667494.711956931 libircclient-1.8/include/0000755000175000001440000000000012333235446015465 5ustar00timusers00000000000000libircclient-1.8/include/PaxHeaders.13636/libircclient.h0000644000000000000000000000012412333212511021255 xustar000000000000000027 mtime=1399657801.077183 27 atime=1399667494.711956 30 ctime=1399667494.711956931 libircclient-1.8/include/libircclient.h0000644000175000001440000016712312333212511020277 0ustar00timusers00000000000000/* * 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 libircclient.h * \author George Yunaev * \version 1.5 * \date 01.2012 * \brief This file defines all prototypes and functions to use libircclient. * * libircclient is a small but powerful library, which implements client-server IRC * protocol. It is designed to be small, fast, portable and compatible to RFC * standards, and most IRC clients. libircclient features include: * - Full multi-threading support. * - Single threads handles all the IRC processing. * - Support for single-threaded applications, and socket-based applications, * which use select() * - Synchronous and asynchronous interfaces. * - CTCP support with optional build-in reply code. * - 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. * - Plain C interface and implementation (possible to use from C++ code, * obviously) * - Compatible with RFC 1459 and most IRC clients. * - SSL support if compiled with --enable-openssl. * - Free, licensed under LGPL license. * * Note that to use libircclient, only libircclient.h should be included into your * program. Do not include other libirc_* headers. */ #ifndef INCLUDE_LIBIRC_H #define INCLUDE_LIBIRC_H #include #if !defined (WIN32) #include /* fd_set */ #else #include #include #if defined (ENABLE_IPV6) typedef int (WSAAPI * getaddrinfo_ptr_t) (const char *, const char* , const struct addrinfo *, struct addrinfo **); typedef void (WSAAPI * freeaddrinfo_ptr_t) (struct addrinfo*); #endif #endif #ifdef __cplusplus extern "C" { #endif /*! \brief A libircclient IRC session. * * This structure describes an IRC session. Its members are internal to * libircclient, and should not be used directly. */ typedef struct irc_session_s irc_session_t; /*! \brief A libircclient DCC session. * * This structure describes a DCC session used by libircclient. * Its members are internal to libircclient, and should not be used directly. */ typedef struct irc_dcc_session_s irc_dcc_session_t; /*! \brief A DCC session identifier. * * The irc_dcc_t type is a DCC session identifier, used to identify the * DCC sessions in callbacks and various functions. */ typedef unsigned int irc_dcc_t; /*! * \fn typedef void (*irc_dcc_callback_t) (irc_session_t * session, irc_dcc_t id, int status, void * ctx, const char * data, unsigned int length) * \brief A common DCC callback, used to inform you about the current DCC state or event. * * \param session An IRC session which generates the callback * \param id A DCC session id. * \param status An error status. 0 means no error, otherwise error code. * \param ctx A user-supplied context. * \param data Data supplied (if available) * \param length data length (if available) * * This callback is called for all DCC functions when state change occurs. * * For DCC CHAT, the callback is called in next circumstances: * - \a status is LIBIRC_ERR_CLOSED: connection is closed by remote peer. * After returning from the callback, the DCC session is automatically * destroyed. * - \a status is neither 0 nor 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. * - \a status is 0: new chat message received, \a data contains the message * (null-terminated string), \a length contains the message length. * * For DCC SEND, while file is sending, callback called in next circumstances: * - \a status is neither 0 nor 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. * - \a status is 0: new data received, \a data contains the data received, * \a length contains the amount of data received. * * For DCC RECV, while file is sending, callback called in next circumstances: * - \a status is neither 0 nor 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. * - \a status is 0, and \a data is 0: file has been received successfully. * After returning from the callback, the DCC session is automatically * destroyed. * - \a status is 0, and \a data is not 0: new data received, \a data contains * the data received, \a length contains the amount of data received. * * \ingroup dccstuff */ typedef void (*irc_dcc_callback_t) (irc_session_t * session, irc_dcc_t id, int status, void * ctx, const char * data, unsigned int length); #define IN_INCLUDE_LIBIRC_H #include "libirc_errors.h" #include "libirc_events.h" #include "libirc_options.h" #undef IN_INCLUDE_LIBIRC_H /*! * \fn irc_session_t * irc_create_session (irc_callbacks_t * callbacks) * \brief Creates and initiates a new IRC session. * * \param callbacks A structure, which defines several callbacks, which will * be called on appropriate events. Must not be NULL. * * \return An ::irc_session_t object, or 0 if creation failed. Usually, * failure is caused by out of memory error. * * Every ::irc_session_t object describes a single IRC session - a connection * to an IRC server, and possibly to some DCC clients. Almost every irc_* * function requires this object to be passed to, and therefore this function * should be called first. * * Every session created must be destroyed when it is not needed anymore * by calling irc_destroy_session(). * * The most common function sequence is: * \code * ... prepare irc_callbacks_t structure ... * irc_create_session(); * irc_connect(); * irc_run(); * irc_destroy_session(); * \endcode * * \sa irc_destroy_session * \ingroup initclose */ irc_session_t * irc_create_session (irc_callbacks_t * callbacks); /*! * \fn void irc_destroy_session (irc_session_t * session) * \brief Destroys previously created IRC session. * * \param session A session to destroy. Must not be NULL. * * This function should be used to destroy an IRC session, close the * connection to the IRC server, and free all the used resources. After * calling this function, you should not use this session object anymore. * * \ingroup initclose */ void irc_destroy_session (irc_session_t * session); /*! * \fn int irc_connect (irc_session_t * session, const char * server, unsigned short port, const char * server_password, const char * nick, const char * username, const char * realname); * \brief Initiates a connection to IRC server. * * \param session A session to initiate connections on. Must not be NULL. * \param server A domain name or an IP address of the IRC server to connect to. Cannot be NULL. * If the library is built with SSL support and the first character is hash, tries to establish the SSL connection. * For example, the connection to "irc.example.com" is assumed to be plaintext, and connection to "#irc.example.com" * is assumed to be secured by SSL. Note that SSL will only work if the library is built with the SSL support. * \param port An IRC server port, usually 6667. * \param server_password An 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. * \param nick A nick, which libircclient will use to login to the IRC server. * Must not be NULL. * \param username A username of the 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. * May be NULL, in this case 'nobody' will be sent as username. * \param realname A real name of the person, who connects to the IRC. Usually * people put some wide-available information here (URL, small * description or something else). This information also will * be shown in "user properties" dialogs and returned by /whois * request. May be NULL, in this case 'noname' will be sent as * username. * * \return Return code 0 means success. Other value means error, the error * code may be obtained through irc_errno(). Any error, generated by the * IRC server, is available through irc_callbacks_t::event_numeric. * * This function prepares and initiates a connection to the IRC server. The * connection is done asynchronously (see irc_callbacks_t::event_connect), so the success * return value means that connection was initiated (but not completed!) * successfully. * * \sa irc_run * \ingroup conndisc */ int irc_connect (irc_session_t * session, const char * server, unsigned short port, const char * server_password, const char * nick, const char * username, const char * realname); /*! * \fn int irc_connect6 (irc_session_t * session, const char * server, unsigned short port, const char * server_password, const char * nick, const char * username, const char * realname); * \brief Initiates a connection to IRC server using IPv6. * * \param session A session to initiate connections on. Must not be NULL. * \param server A domain name or an IP address of the IRC server to connect to. Cannot be NULL. * If the library is built with SSL support and the first character is hash, tries to establish the SSL connection. * For example, the connection to "irc.example.com" is assumed to be plaintext, and connection to "#irc.example.com" * is assumed to be secured by SSL. Note that SSL will only work if the library is built with the SSL support. * \param port An IRC server port, usually 6667. * \param server_password An 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. * \param nick A nick, which libircclient will use to login to the IRC server. * Must not be NULL. * \param username A username of the 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. * May be NULL, in this case 'nobody' will be sent as username. * \param realname A real name of the person, who connects to the IRC. Usually * people put some wide-available information here (URL, small * description or something else). This information also will * be shown in "user properties" dialogs and returned by /whois * request. May be NULL, in this case 'noname' will be sent as * username. * * \return Return code 0 means success. Other value means error, the error * code may be obtained through irc_errno(). Any error, generated by the * IRC server, is available through irc_callbacks_t::event_numeric. * * This function prepares and initiates a connection to the IRC server. The * connection is done asynchronously (see irc_callbacks_t::event_connect), so the success * return value means that connection was initiated (but not completed!) * successfully. * * \sa irc_run * \ingroup conndisc */ int irc_connect6 (irc_session_t * session, const char * server, unsigned short port, const char * server_password, const char * nick, const char * username, const char * realname); /*! * \fn void irc_disconnect (irc_session_t * session) * \brief Disconnects a connection to IRC server. * * \param session An IRC session. * * \return Return code 0 means success. Other value means error, the error * code may be obtained through irc_errno(). * * This function closes the IRC connection. After that connection is closed, * libircclient automatically leaves irc_run loop. * * \sa irc_connect irc_run * \ingroup conndisc */ void irc_disconnect (irc_session_t * session); /*! * \fn int irc_is_connected (irc_session_t * session) * \brief Checks whether the session is connecting/connected to the IRC server. * * \param session An initialized IRC session. * * \return Return code 1 means that session is connecting or connected to the * IRC server, zero value means that the session has been disconnected. * * \sa irc_connect irc_run * \ingroup conndisc */ int irc_is_connected (irc_session_t * session); /*! * \fn int irc_run (irc_session_t * session) * \brief Goes into forever-loop, processing IRC events and generating * callbacks. * * \param session An initiated and connected session. * * \return Return code 0 means success. Other value means error, the error * code may be obtained through irc_errno(). * * This function goes into forever loop, processing the IRC events, and * calling appropriate callbacks. This function will not return until the * server connection is terminated - either by server, or by calling * irc_cmd_quit. This function should be used, if you 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 irc_run, * and start the asynchronous thread in event_connect handler. See examples. * * \ingroup running */ int irc_run (irc_session_t * session); /*! * \fn int irc_add_select_descriptors (irc_session_t * session, fd_set *in_set, fd_set *out_set, int * maxfd) * \brief Adds IRC socket(s) for the descriptor set to use in select(). * * \param session An initiated and connected session. * \param in_set A FD_IN descriptor set for select() * \param out_set A FD_OUT descriptor set for select() * \param maxfd A max descriptor found. * * \return Return code 0 means success. Other value means error, the error * code may be obtained through irc_errno(). * * This function should be used when you already have a program with select() * based data processing. You prepare your descriptors, call this function * to add session's descriptor(s) into set, and then call select(). When it * returns, you should call irc_add_select_descriptors, which sends/recvs all * available data, parses received data, calls your callbacks(!), and returns. * Then you can process your sockets from set. See the example. * * \sa irc_process_select_descriptors * \ingroup running */ int irc_add_select_descriptors (irc_session_t * session, fd_set *in_set, fd_set *out_set, int * maxfd); /*! * \fn int irc_process_select_descriptors (irc_session_t * session, fd_set *in_set, fd_set *out_set) * \brief Processes the IRC socket(s), which descriptor(s) are set. * * \param session An initiated and connected session. * \param in_set A FD_IN descriptor set for select() * \param out_set A FD_OUT descriptor set for select() * * \return Return code 0 means success. Other value means error, the error * code may be obtained through irc_errno(). * * This function should be used in pair with irc_add_select_descriptors * function. See irc_add_select_descriptors description. * * \sa irc_add_select_descriptors * \ingroup running */ int irc_process_select_descriptors (irc_session_t * session, fd_set *in_set, fd_set *out_set); /*! * \fn int irc_send_raw (irc_session_t * session, const char * format, ...) * \brief Sends raw data to the IRC server. * * \param session An initiated and connected session. * \param format A printf-formatted string, followed by function args. * * \return Return code 0 means success. Other value means error, the error * code may be obtained through irc_errno(). Any error, generated by the * IRC server, is available through irc_callbacks_t::event_numeric. * * 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. * * \ingroup ircmd_oth */ int irc_send_raw (irc_session_t * session, const char * format, ...); /*! * \fn int irc_cmd_quit (irc_session_t * session, const char * reason) * \brief Sends QUIT command to the IRC server. * * \param session An initiated and connected session. * \param reason A reason to quit. May be NULL. * * \return Return code 0 means success. Other value means error, the error * code may be obtained through irc_errno(). Any error, generated by the * IRC server, is available through irc_callbacks_t::event_numeric. * * 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. * * \ingroup ircmd_oth */ int irc_cmd_quit (irc_session_t * session, const char * reason); /*! * \fn int irc_cmd_join (irc_session_t * session, const char * channel, const char * key) * \brief Joins the new IRC channel. * * \param session An initiated and connected session. * \param channel A channel name to join to. Must not be NULL. * \param key Channel password. May be NULL. * * \return Return code 0 means success. Other value means error, the error * code may be obtained through irc_errno(). Any error, generated by the * IRC server, is available through irc_callbacks_t::event_numeric. * * This function is used to JOIN the IRC channel. If the channel is 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 \a key argument. * * If join is successful, the irc_callbacks_t::event_join is called (with \a origin == * your nickname), then you are sent the channel's topic * (using ::LIBIRC_RFC_RPL_TOPIC) and the list of users who are on the * channel (using ::LIBIRC_RFC_RPL_NAMREPLY), which includes the user * joining - namely you. * * Possible error responces for this command from the RFC1459: * - ::LIBIRC_RFC_ERR_NEEDMOREPARAMS * - ::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 * * And on success the following replies returned: * - ::LIBIRC_RFC_RPL_TOPIC * - ::LIBIRC_RFC_RPL_NAMREPLY * * \ingroup ircmd_ch */ int irc_cmd_join (irc_session_t * session, const char * channel, const char * key); /*! * \fn int irc_cmd_part (irc_session_t * session, const char * channel) * \brief Leaves the IRC channel. * * \param session An initiated and connected session. * \param channel A channel name to leave. Must not be NULL. * * \return Return code 0 means success. Other value means error, the error * code may be obtained through irc_errno(). Any error, generated by the * IRC server, is available through irc_callbacks_t::event_numeric. * * This function is used 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. * * Possible error responces for this command from the RFC1459: * - ::LIBIRC_RFC_ERR_NEEDMOREPARAMS * - ::LIBIRC_RFC_ERR_NOSUCHCHANNEL * - ::LIBIRC_RFC_ERR_NOTONCHANNEL * * \ingroup ircmd_ch */ int irc_cmd_part (irc_session_t * session, const char * channel); /*! * \fn int irc_cmd_invite (irc_session_t * session, const char * nick, const char * channel) * \brief Invites a user to invite-only channel. * * \param session An initiated and connected session. * \param nick A nick to invite. Must not be NULL. * \param channel A channel name to invite to. Must not be NULL. * * \return Return code 0 means success. Other value means error, the error * code may be obtained through irc_errno(). Any error, generated by the * IRC server, is available through irc_callbacks_t::event_numeric. * * 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 irc_callbacks_t::event_invite event. * Note that you must be a channel operator to INVITE the users. * * 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 * * And on success one of the following replies returned: * - ::LIBIRC_RFC_RPL_INVITING * - ::LIBIRC_RFC_RPL_AWAY * * \sa irc_callbacks_t::event_invite irc_cmd_channel_mode * \ingroup ircmd_ch */ int irc_cmd_invite (irc_session_t * session, const char * nick, const char * channel); /*! * \fn int irc_cmd_names (irc_session_t * session, const char * channel) * \brief Obtains a list of users who're in channel. * * \param session An initiated and connected session. * \param channel A channel name(s) to obtain user list. Must not be NULL. * It is possible to specify more than a single channel, but * several channel names should be separated by a comma. * * \return Return code 0 means success. Other value means error, the error * code may be obtained through irc_errno(). Any error, generated by the * IRC server, is available through irc_callbacks_t::event_numeric. * * This function is used to ask the IRC server for the list of the users * who're in 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 ::RPL_NAMREPLY and ::RPL_ENDOFNAMES numeric codes. * * The channel names are returned by irc_callbacks_t::event_numeric * using the following reply codes: * - ::LIBIRC_RFC_RPL_NAMREPLY * - ::LIBIRC_RFC_RPL_ENDOFNAMES * * \ingroup ircmd_ch */ int irc_cmd_names (irc_session_t * session, const char * channel); /*! * \fn int irc_cmd_list (irc_session_t * session, const char * channel) * \brief Obtains a list of active server channels with their topics. * * \param session An initiated and connected session. * \param channel A channel name(s) to list. May be NULL, in which case all the * channels will be listed. It is possible to specify more than * a single channel, but several channel names should be * separated by a comma. * * \return Return code 0 means success. Other value means error, the error * code may be obtained through irc_errno(). Any error, generated by the * IRC server, is available through irc_callbacks_t::event_numeric. * * This function is used to ask the IRC server for the active (existing) * channels list. The list will be returned using ::LIBIRC_RFC_RPL_LISTSTART - * ::LIBIRC_RFC_RPL_LIST - ::LIBIRC_RFC_RPL_LISTEND 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 a member of the channel in question. * * Possible error responces for this command from the RFC1459: * - ::LIBIRC_RFC_ERR_NOSUCHSERVER * * And the channel list is returned using the following reply codes: * - ::LIBIRC_RFC_RPL_LISTSTART * - ::LIBIRC_RFC_RPL_LISTEND * - ::LIBIRC_RFC_RPL_LIST * * \ingroup ircmd_ch */ int irc_cmd_list (irc_session_t * session, const char * channel); /*! * \fn int irc_cmd_topic (irc_session_t * session, const char * channel, const char * topic) * \brief Views or changes the channel topic. * * \param session An initiated and connected session. * \param channel A channel name to invite to. Must not be NULL. * \param topic A new topic to change. If NULL, the old topic will be * returned, and topic won't changed. * * \return Return code 0 means success. Other value means error, the error * code may be obtained through irc_errno(). Any error, generated by the * IRC server, is available through irc_callbacks_t::event_numeric. * * The irc_cmd_topic() is used to change or view the topic of a channel. * The topic for \a channel is returned if \a topic is NULL. If the \a topic * is not NULL, the topic for the \a channel will be changed. Note that, * depending on \a +t channel mode, you may be required to be a channel * operator to change the channel topic. * * If the command succeed, the IRC server will generate a ::RPL_NOTOPIC or * ::RPL_TOPIC message, containing either old or changed topic. Also the IRC * server can (but not have to) generate the non-RFC ::RPL_TOPIC_EXTRA message, * containing the nick of person, who's changed the topic, and the time of * latest topic change. * * Possible error responces for this command from the RFC1459: * - ::LIBIRC_RFC_ERR_NEEDMOREPARAMS * - ::LIBIRC_RFC_ERR_CHANOPRIVSNEEDED * - ::LIBIRC_RFC_ERR_NOTONCHANNEL * * And the topic information is returned using one of following reply codes: * - ::LIBIRC_RFC_RPL_NOTOPIC * - ::LIBIRC_RFC_RPL_TOPIC * * \sa irc_callbacks_t::event_topic irc_cmd_channel_mode * \ingroup ircmd_ch */ int irc_cmd_topic (irc_session_t * session, const char * channel, const char * topic); /*! * \fn int irc_cmd_channel_mode (irc_session_t * session, const char * channel, const char * mode) * \brief Views or changes the channel mode. * * \param session An initiated and connected session. * \param channel A channel name to invite to. Must not be NULL. * \param mode A channel mode, described below. If NULL, the channel mode is * not changed, just the old mode is returned. * * \return Return code 0 means success. Other value means error, the error * code may be obtained through irc_errno(). Any error, generated by the * IRC server, is available through irc_callbacks_t::event_numeric. * * The irc_cmd_channel_mode() is used to change or view the channel modes. * The \a channel mode is returned if the \a mode is NULL. If the \a mode * is not NULL, the mode for the \a channel will be changed. Note that, * only channel operators can change the channel modes. * * Channel mode is represended by the 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: * * - \a o \a nickname - gives (+o nick) or takes (-o nick) the channel * operator privileges from a \a nickname. This mode affects the * users in channel, not the channel itself. * Examples: "+o tim", "-o watson". * * - \a p - sets (+p) or resets (-p) private channel flag. * Private channels are shown in channel list as 'Prv', without the topic. * * - \a s - sets (+p) or resets (-p) secret channel flag. * Secret channels aren't shown in channel list at all. * * - \a i - sets (+i) or resets (-i) invite-only channel flag. When the flag * is set, only the people who are invited by irc_cmd_invite(), can * join this channel. * * - \a t - sets (+t) or resets (-t) topic settable by channel operator only * flag. When the flag is set, only the channel operators can change the * channel topic. * * - \a n - sets (+n) or resets (-n) the protection from the clients outside * the channel. When the \a +n mode is set, only the clients, who are in * channel, can send the messages to the channel. * * - \a 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 * the \a +v user mode can speak in the channel. * * - \a v \a nickname - gives (+v nick) or takes (-v nick) from user the * ability to speak on a moderated channel. * Examples: "+v tim", "-v watson". * * - \a l \a number - sets (+l 20) or removes (-l) the restriction of maximum * users in channel. When the restriction is set, and there is a number * of users in the channel, no one can join the channel anymore. * * - \a k \a key - sets (+k secret) or removes (-k) the password from the * channel. When the restriction is set, any user joining the channel * required to provide a channel key. * * - \a b \a 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 * mentioned here - please contact me at tim@krasnogorsk.ru * * 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 * * And the mode information is given using following reply codes: * - ::LIBIRC_RFC_RPL_CHANNELMODEIS * - ::LIBIRC_RFC_RPL_BANLIST * - ::LIBIRC_RFC_RPL_ENDOFBANLIST * * \sa irc_cmd_topic irc_cmd_list * \ingroup ircmd_ch */ int irc_cmd_channel_mode (irc_session_t * session, const char * channel, const char * mode); /*! * \fn int irc_cmd_user_mode (irc_session_t * session, const char * mode) * \brief Views or changes your own user mode. * * \param session An initiated and connected session. * \param mode A user mode, described below. If NULL, the user mode is * not changed, just the old mode is returned. * * \return Return code 0 means success. Other value means error, the error * code may be obtained through irc_errno(). Any error, generated by the * IRC server, is available through irc_callbacks_t::event_numeric. * * The irc_cmd_user_mode() is used to change or view the user modes. * Note that, unlike channel modes, not all user modes can be changed. * The user mode is returned if the \a mode is NULL. If the \a mode * is not NULL, the mode for you will be changed, and new mode will be * returned. * * Like channel mode, user mode is also 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: * * - \a 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. * * - \a i - if set, marks a user as 'invisible' - that is, not seen by lookups * if the user is not in a channel. * * - \a w - if set, marks a user as 'receiving wallops' - special messages * generated by IRC operators using WALLOPS command. * * - \a s - if set, marks a user for receipt of server notices. * * - \a r - NON-STANDARD MODE. If set, user has been authenticated with * NICKSERV IRC service. * * - \a x - NON-STANDARD MODE. If set, user's real IP is hidden by IRC * servers, to prevent scriptkiddies to do nasty things to the user's * computer. * * 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 at tim@krasnogorsk.ru * * 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 * * And the mode information is given using reply code ::LIBIRC_RFC_RPL_UMODEIS * * \ingroup ircmd_oth */ int irc_cmd_user_mode (irc_session_t * session, const char * mode); /*! * \fn int irc_cmd_nick (irc_session_t * session, const char * newnick) * \brief Changes your nick. * * \param session An initiated and connected session. * \param newnick A new nick. Must not be NULL. * * \return Return code 0 means success. Other value means error, the error * code may be obtained through irc_errno(). Any error, generated by the * IRC server, is available through irc_callbacks_t::event_numeric. * * 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. * * 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 * * \ingroup ircmd_oth */ int irc_cmd_nick (irc_session_t * session, const char * newnick); /*! * \fn int irc_cmd_whois (irc_session_t * session, const char * nick) * \brief Queries the information about the nick. * * \param session An initiated and connected session. * \param nick A nick to query the information abour. Must not be NULL. * A comma-separated list of several nicknames may be given. * * \return Return code 0 means success. Other value means error, the error * code may be obtained through irc_errno(). Any error, generated by the * IRC server, is available through irc_callbacks_t::event_numeric. * * This function queries various information about the nick: username, real * name, the IRC server used, the channels user is in, idle time, away mode and so on. * * Possible error responces for this command from the RFC1459: * - ::LIBIRC_RFC_ERR_NOSUCHSERVER * - ::LIBIRC_RFC_ERR_NOSUCHNICK * - ::LIBIRC_RFC_ERR_NONICKNAMEGIVEN * * And the information is returned using the following reply codes. The whois * query is completed when ::LIBIRC_RFC_RPL_ENDOFWHOIS message is received. * - ::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 * * \ingroup ircmd_oth */ int irc_cmd_whois (irc_session_t * session, const char * nick); /*! * \fn irc_cmd_msg (irc_session_t * session, const char * nch, const char * text) * \brief Sends the message to the nick or to the channel. * * \param session An initiated and connected session. * \param nch A target nick or channel. Must not be NULL. * \param text Message text. Must not be NULL. * * \return Return code 0 means success. Other value means error, the error * code may be obtained through irc_errno(). Any error, generated by the * IRC server, is available through irc_callbacks_t::event_numeric. * * This function is used to send the channel or private messages. The target * is determined by \a nch argument: if it describes nick, this will be a * private message, if a channel name - public (channel) message. Note that * depending on channel modes, you may be required to join the channel to * send the channel messages. * * 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 * * On success there is NOTHING generated. * * \ingroup ircmd_msg */ int irc_cmd_msg (irc_session_t * session, const char * nch, const char * text); /*! * \fn int irc_cmd_me (irc_session_t * session, const char * nch, const char * text) * \brief Sends the /me (CTCP ACTION) message to the nick or to the channel. * * \param session An initiated and connected session. * \param nch A target nick or channel. Must not be NULL. * \param text Action message text. Must not be NULL. * * \return Return code 0 means success. Other value means error, the error * code may be obtained through irc_errno(). Any error, generated by the * IRC server, is available through irc_callbacks_t::event_numeric. * * This function is used to send the /me message to channel or private. * As for irc_cmd_msg, the target is determined by \a nch argument. * * 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 * * On success there is NOTHING generated. * However, a ::LIBIRC_RFC_RPL_AWAY reply can be also generated. * * \sa irc_cmd_msg * \ingroup ircmd_msg */ int irc_cmd_me (irc_session_t * session, const char * nch, const char * text); /*! * \fn int irc_cmd_notice (irc_session_t * session, const char * nch, const char * text) * \brief Sends the notice to the nick or to the channel. * * \param session An initiated and connected session. * \param nch A target nick or channel. Must not be NULL. * \param text Notice text. Must not be NULL. * * \return Return code 0 means success. Other value means error, the error * code may be obtained through irc_errno(). Any error, generated by the * IRC server, is available through irc_callbacks_t::event_numeric. * * This function is used to send the channel or private notices. The target * is determined by \a nch argument: if it describes nick, this will be a * private message, if a channel name - public (channel) message. Note that * depending on channel modes, you may be required to join the channel to * send the channel notices. * * The only difference between message and notice is that, according to RFC * 1459, you must not automatically reply to NOTICE messages. * * 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 * * On success there is NOTHING generated. On notices sent to target nick, * a ::LIBIRC_RFC_RPL_AWAY reply may be generated. * * \sa irc_cmd_msg * \ingroup ircmd_msg */ int irc_cmd_notice (irc_session_t * session, const char * nch, const char * text); /*! * \fn int irc_cmd_kick (irc_session_t * session, const char * nick, const char * channel, const char * reason) * \brief Kick some lazy ass out of channel. * * \param session An initiated and connected session. * \param nick A nick to kick. Must not be NULL. * \param channel A channel to kick this nick out of. Must not be NULL. * \param reason A reason to kick. May be NULL. * * \return Return code 0 means success. Other value means error, the error * code may be obtained through irc_errno(). Any error, generated by the * IRC server, is available through irc_callbacks_t::event_numeric. * * This function is used to kick a person out of channel. Note that you must * be a channel operator to kick anyone. * * Possible error responces for this command from the RFC1459: * - ::LIBIRC_RFC_ERR_NEEDMOREPARAMS * - ::LIBIRC_RFC_ERR_BADCHANMASK * - ::LIBIRC_RFC_ERR_NOSUCHCHANNEL * - ::LIBIRC_RFC_ERR_NOTONCHANNEL * - ::LIBIRC_RFC_ERR_CHANOPRIVSNEEDED * * On success the irc_callbacks_t::event_kick event will be generated. * * \sa irc_callbacks_t::event_numeric * \ingroup ircmd_ch */ int irc_cmd_kick (irc_session_t * session, const char * nick, const char * channel, const char * reason); /*! * \fn int irc_cmd_ctcp_request (irc_session_t * session, const char * nick, const char * request) * \brief Generates a CTCP request. * * \param session An initiated and connected session. * \param nick A target nick to send request to. Must not be NULL. * \param request A request string. Must not be NULL. * * \return Return code 0 means success. Other value means error, the error * code may be obtained through irc_errno(). Any error, generated by the * IRC server, is available through irc_callbacks_t::event_numeric. * * This function is used to send a CTCP request. There are four CTCP requests * supported by Mirc: * 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. * * A reply to the CTCP request will be sent by the irc_callbacks_t::event_ctcp_rep callback; * be sure to define it. * * 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 * * \sa irc_callbacks_t::event_ctcp_rep irc_callbacks_t::event_numeric * \ingroup ctcp */ int irc_cmd_ctcp_request (irc_session_t * session, const char * nick, const char * request); /*! * \fn int irc_cmd_ctcp_reply (irc_session_t * session, const char * nick, const char * reply) * \brief Generates a reply to the CTCP request. * * \param session An initiated and connected session. * \param nick A target nick to send request to. Must not be NULL. * \param reply A reply string. Must not be NULL. * * \return Return code 0 means success. Other value means error, the error * code may be obtained through irc_errno(). Any error, generated by the * IRC server, is available through irc_callbacks_t::event_numeric. * * This function is used to send a reply to the CTCP request, generated by * irc_callbacks_t::event_ctcp_req. Note that you will not receive this event * unless you specify your own handler as \c event_ctcp_req callback during * the IRC session initialization. * * 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 * * \ingroup ctcp */ int irc_cmd_ctcp_reply (irc_session_t * session, const char * nick, const char * reply); /*! * \fn void irc_target_get_nick (const char * target, char *nick, size_t size) * \brief Gets the nick part from the target * * \param target A nick in common IRC server form like tim!root\@mycomain.com * \param nick A buffer to hold the nickname. * \param size A buffer size. If nick is longer than buffer size, it will * be truncated. * * For most events IRC server returns 'origin' (i.e. the person, who * generated this event) in i.e. "common" form, like nick!host\@domain. * However, all the irc_cmd_* functions require just a nick/ * This function parses this origin, and gets the nick, storing it into * user-provided buffer. * A buffer of size 90 should be enough for most nicks :) * * \ingroup nnparse */ void irc_target_get_nick (const char * target, char *nick, size_t size); /*! * \fn void irc_target_get_host (const char * target, char *nick, size_t size) * \brief Gets the host part from the target * * \param target A nick in common IRC server form like tim!root\@mydomain.com * \param nick A buffer to hold the nickname. * \param size A buffer size. If nick is longer than buffer size, it will * be truncated. * * For most events IRC server returns 'origin' (i.e. the person, who * generated this event) in i.e. "common" form, like nick!host\@domain. * I don't know any command, which requires host, but it may be useful :) * This function parses this origin, and gets the host, storing it into * user-provided buffer. * * \ingroup nnparse */ void irc_target_get_host (const char * target, char *nick, size_t size); /*! * \fn int irc_dcc_chat(irc_session_t * session, void * ctx, const char * nick, irc_dcc_callback_t callback, irc_dcc_t * dccid) * \brief Initiates a DCC CHAT. * * \param session An initiated and connected session. * \param ctx A user-supplied DCC session context, which will be passed to * the DCC callback function. May be NULL. * \param nick A nick to DCC CHAT with. * \param callback A DCC callback function, which will be called when * anything is said by other party. Must not be NULL. * \param dccid On success, DCC session ID will be stored in this var. * * \return Return code 0 means success. Other value means error, the error * code may be obtained through irc_errno(). Any error, generated by the * IRC server, is available through irc_callbacks_t::event_numeric. * * This function requests a DCC CHAT between you and other user. For * newbies, DCC chat is like private chat, but it goes directly between * two users, and bypasses IRC server. DCC CHAT request must be accepted * by other side before you can send anything. * * When the chat is accepted, terminated, or some data is received, the * callback function is called. See the details in irc_dcc_callback_t * declaration. * * 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 * * \sa irc_dcc_callback_t irc_dcc_msg * \ingroup dccstuff */ int irc_dcc_chat (irc_session_t * session, void * ctx, const char * nick, irc_dcc_callback_t callback, irc_dcc_t * dccid); /*! * \fn int irc_dcc_msg (irc_session_t * session, irc_dcc_t dccid, const char * text) * \brief Sends the message to the specific DCC CHAT * * \param session An IRC session. * \param dccid A DCC session ID, which chat request must have been accepted. * \param text Message text. Must not be NULL. * * \return Return code 0 means success. Other value means error, the error * code may be obtained through irc_errno(). * * This function is used to send the DCC CHAT messages. DCC CHAT request * must be initiated and accepted first (or just accepted, if initiated by * other side). * * \sa irc_dcc_chat * \ingroup dccstuff */ int irc_dcc_msg (irc_session_t * session, irc_dcc_t dccid, const char * text); /*! * \fn int irc_dcc_accept (irc_session_t * session, irc_dcc_t dccid, void * ctx, irc_dcc_callback_t callback) * \brief Accepts a remote DCC CHAT or DCC RECVFILE request. * * \param session An initiated and connected session. * \param dccid A DCC session ID, returned by appropriate callback. * \param ctx A user-supplied DCC session context, which will be passed * to the DCC callback function. May be NULL. * \param callback A DCC callback function, which will be called when * anything is said by other party. Must not be NULL. * * \return Return code 0 means success. Other value means error, the error * code may be obtained through irc_errno(). * * This function accepts a remote DCC request - either DCC CHAT or DCC FILE. * After the request is accepted, the supplied callback will be called, * and you can start sending messages or receiving the file. * * This function should be called only after either event_dcc_chat_req or * event_dcc_send_req events are generated, and should react to them. It is * possible not to call irc_dcc_accept or irc_dcc_decline immediately in * callback function - you may just return, and call it later. However, to * prevent memory leaks, you must call either irc_dcc_decline or * irc_dcc_accept for any incoming DCC request. * * \sa irc_dcc_decline event_dcc_chat_req event_dcc_send_req * \ingroup dccstuff */ int irc_dcc_accept (irc_session_t * session, irc_dcc_t dccid, void * ctx, irc_dcc_callback_t callback); /*! * \fn int irc_dcc_decline (irc_session_t * session, irc_dcc_t dccid) * \brief Declines a remote DCC CHAT or DCC RECVFILE request. * * \param session An initiated and connected session. * \param dccid A DCC session ID, returned by appropriate callback. * * \return Return code 0 means success. Other value means error, the error * code may be obtained through irc_errno(). * * This function declines a remote DCC request - either DCC CHAT or DCC FILE. * * This function should be called only after either event_dcc_chat_req or * event_dcc_send_req events are generated, and should react to them. It is * possible not to call irc_dcc_accept or irc_dcc_decline immediately in * callback function - you may just return, and call it later. However, to * prevent memory leaks, you must call either irc_dcc_decline or * irc_dcc_accept for any incoming DCC request. * * Do not use this function to close the accepted or initiated DCC session. * Use irc_dcc_destroy instead. * * \sa irc_dcc_accept irc_callbacks_t::event_dcc_chat_req irc_callbacks_t::event_dcc_send_req irc_dcc_destroy * \ingroup dccstuff */ int irc_dcc_decline (irc_session_t * session, irc_dcc_t dccid); /*! * \fn 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) * \brief Sends a file via DCC. * * \param session An initiated and connected session. * \param ctx A user-supplied DCC session context, which will be passed to * the DCC callback function. May be NULL. * \param nick A nick to send file via DCC to. * \param filename A file name to sent. Must be an existing file. * \param callback A DCC callback function, which will be called when * file sent operation is failed, progressed or completed. * \param dccid On success, DCC session ID will be stored in this var. * * \return Return code 0 means success. Other value means error, the error * code may be obtained through irc_errno(). Any error, generated by the * IRC server, is available through irc_callbacks_t::event_numeric. * * 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 * callback. See the details in irc_dcc_callback_t declaration. * * 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 * * \sa irc_dcc_callback_t * \ingroup dccstuff */ 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); /*! * \fn int irc_dcc_destroy (irc_session_t * session, irc_dcc_t dccid) * \brief Destroys a DCC session. * * \param session An initiated and connected session. * \param dccid A DCC session ID. * * \return Return code 0 means success. Other value means error, the error * code may be obtained through irc_errno(). * * This function closes the DCC connection (if available), and destroys * the DCC session, freeing the used resources. It can be called in any * moment, 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. * * \ingroup dccstuff */ int irc_dcc_destroy (irc_session_t * session, irc_dcc_t dccid); /*! * \fn void irc_get_version (unsigned int * high, unsigned int * low) * \brief Obtains a libircclient version. * * \param high A pointer to receive the high version part. * \param low A pointer to receive the low version part. * * 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); * * \ingroup common */ void irc_get_version (unsigned int * high, unsigned int * low); /*! * \fn void irc_set_ctx (irc_session_t * session, void * ctx) * \brief Sets the IRC session context. * * \param session An initiated session. * \param ctx A context. * * 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 irc_destroy_session(). * * \sa irc_get_ctx * \ingroup contexts */ void irc_set_ctx (irc_session_t * session, void * ctx); /*! * \fn void irc_set_ctcp_version (irc_session_t * session, const char *version) * \brief Sets the internal CTCP VERSION * * \param session an Initiated session. * \param version the version to reply * * This function sets an internal user-defined version to reply on CTCP * VERSION request. If none is given, a default one is provided. The parameter * version is copied and can be freed by the user. * * \ingroup contexts */ void irc_set_ctcp_version(irc_session_t * session, const char * version); /*! * \fn void * irc_get_ctx (irc_session_t * session) * \brief Returns the IRC session context. * * \param session An initiated session. * * This function returns the IRC session context, which was set by * irc_set_ctx(). If no context was set, this function returns NULL. * * \sa irc_set_ctx * \ingroup contexts */ void * irc_get_ctx (irc_session_t * session); /*! * \fn int irc_errno (irc_session_t * session) * \brief Returns the last error code. * * \param session An initiated session. * * 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, next 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. * * \sa irc_strerror * \ingroup errors */ int irc_errno (irc_session_t * session); /*! * \fn const char * irc_strerror (int ircerrno) * \brief Returns the text error message associated with this error code. * * \param ircerrno A numeric error code returned by irc_errno() * * This function returns the text representation of the given error code. * * \sa irc_errno() * \ingroup errors */ const char * irc_strerror (int ircerrno); /*! * \fn void irc_option_set (irc_session_t * session, unsigned int option) * \brief Sets the libircclient option. * * \param session An initiated session. * \param option An option from libirc_options.h * * This function sets the libircclient option, changing libircclient behavior. See the * option list for the meaning for every option. * * \sa irc_option_reset * \ingroup options */ void irc_option_set (irc_session_t * session, unsigned int option); /*! * \fn void irc_option_reset (irc_session_t * session, unsigned int option) * \brief Resets the libircclient option. * * \param session An initiated session. * \param option An option from libirc_options.h * * This function removes the previously set libircclient option, changing libircclient * behavior. See the option list for the meaning for every option. * * \sa irc_option_set * \ingroup options */ void irc_option_reset (irc_session_t * session, unsigned int option); /*! * \fn char * irc_color_strip_from_mirc (const char * message) * \brief Removes all the color codes and format options. * * \param message A message from IRC * * \return Returns a new plain text message with stripped mIRC 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. * * \sa irc_color_convert_from_mirc irc_color_convert_to_mirc * \ingroup colors */ char * irc_color_strip_from_mirc (const char * message); /*! * \fn char * irc_color_convert_from_mirc (const char * message) * \brief Converts all the color codes and format options to libircclient colors. * * \param message A message from IRC * * \return Returns a new message with converted mIRC color codes and format * options. See the irc_color_convert_to_mirc() help to see how the colors * are converted.\n * 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. * * \sa irc_color_strip_from_mirc irc_color_convert_to_mirc * \ingroup colors */ char * irc_color_convert_from_mirc (const char * message); /*! * \fn char * irc_color_convert_to_mirc (const char * message) * \brief Converts all the color codes from libircclient format to mIRC. * * \param message A message with color codes * * \return 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. * * 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 \b bold. * - [I] ... [/I] - italic/reverse format mode. Everything between [I] and [/I] is written in \c 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 \c 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 \c COLOR keyword, an equal sign followed by text foreground color code, a dash and a text background color code. * * The supported text colors are: * - WHITE * - BLACK * - DARKBLUE * - DARKGREEN * - RED * - BROWN * - PURPLE * - OLIVE * - YELLOW * - GREEN * - TEAL * - CYAN * - BLUE * - MAGENTA * - DARKGRAY * - LIGHTGRAY * * Examples of color sequences: * \code * 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] * \endcode * * \sa irc_color_strip_from_mirc irc_color_convert_from_mirc * \ingroup colors */ char * irc_color_convert_to_mirc (const char * message); #ifdef __cplusplus } #endif #endif /* INCLUDE_LIBIRC_H */ libircclient-1.8/include/PaxHeaders.13636/libirc_errors.h0000644000000000000000000000012411705476523021473 xustar000000000000000027 mtime=1326873939.154689 27 atime=1399667494.710956 30 ctime=1399667494.710956931 libircclient-1.8/include/libirc_errors.h0000644000175000001440000001451111705476523020505 0ustar00timusers00000000000000/* * 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 */ libircclient-1.8/include/PaxHeaders.13636/libirc_events.h0000644000000000000000000000012411705455314021456 xustar000000000000000027 mtime=1326865100.635729 27 atime=1399667494.710956 30 ctime=1399667494.710956931 libircclient-1.8/include/libirc_events.h0000644000175000001440000003713311705455314020475 0ustar00timusers00000000000000/* * 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 */ libircclient-1.8/include/PaxHeaders.13636/libirc_rfcnumeric.h0000644000000000000000000000012411707104775022313 xustar000000000000000027 mtime=1327270397.687192 27 atime=1399667494.710956 30 ctime=1399667494.710956931 libircclient-1.8/include/libirc_rfcnumeric.h0000644000175000001440000010063111707104775021324 0ustar00timusers00000000000000/* * 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 \ \ \ \ \ \ \