Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Eiwic 1.1.3

  • Loading branch information...
commit 80149457568118d135915322b38d33924da04e85 0 parents
Hannes Gräuler authored
Showing with 16,355 additions and 0 deletions.
  1. +2 −0  .gitignore
  2. 0  AUTHORS
  3. +339 −0 COPYING
  4. +1 −0  ChangeLog
  5. 0  INSTALL
  6. +10 −0 Makefile.am
  7. +417 −0 Makefile.in
  8. 0  NEWS
  9. +152 −0 README
  10. +6 −0 TODO
  11. +955 −0 aclocal.m4
  12. 0  config.guess
  13. 0  config.sub
  14. +4,885 −0 configure
  15. +47 −0 configure.in
  16. +324 −0 connections.c
  17. +82 −0 connections.h
  18. +12 −0 debug.conf
  19. +308 −0 dlist.c
  20. +51 −0 dlist.h
  21. +123 −0 doc/doc.html
  22. BIN  doc/eiwic.png
  23. +1,571 −0 eiwic.c
  24. +236 −0 eiwic.h
  25. +251 −0 install-sh
  26. +190 −0 missing
  27. +40 −0 mkinstalldirs
  28. +35 −0 modules/Makefile.am
  29. +206 −0 modules/Makefile.in
  30. +117 −0 modules/admin.c
  31. +1,249 −0 modules/adventure.c
  32. +199 −0 modules/bc.c
  33. +171 −0 modules/conv.c
  34. +49 −0 modules/crash.c
  35. +72 −0 modules/ctcp.c
  36. +64 −0 modules/decide.c
  37. +211 −0 modules/dict.c
  38. +124 −0 modules/getnick.c
  39. +82 −0 modules/google.c
  40. +139 −0 modules/info.c
  41. +39 −0 modules/lol.c
  42. +123 −0 modules/modadmin.c
  43. +44 −0 modules/rot13.c
  44. +1 −0  modules/rssfeed.buildflags
  45. +379 −0 modules/rssfeed.c
  46. +161 −0 modules/stats.c
  47. +399 −0 modules/stream.c
  48. +73 −0 modules/styorg_addpic.c
  49. +37 −0 modules/template.c
  50. +232 −0 modules/tictactoe.c
  51. +211 −0 numerics.h
  52. +1,267 −0 plugins.c
  53. +190 −0 plugins.h
  54. +8 −0 rssfeed.conf
  55. +80 −0 sample.conf
  56. +49 −0 servers.c
  57. +39 −0 servers.h
  58. +203 −0 settings.c
  59. +1 −0  settings.h
  60. +66 −0 users.c
  61. +33 −0 users.h
2  .gitignore
@@ -0,0 +1,2 @@
+*~
+*.o
0  AUTHORS
No changes.
339 COPYING
@@ -0,0 +1,339 @@
+ GNU GENERAL PUBLIC LICENSE
+ Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.
+ 675 Mass Ave, Cambridge, MA 02139, USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users. This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it. (Some other Free Software Foundation software is covered by
+the GNU Library General Public License instead.) You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+ To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have. You must make sure that they, too, receive or can get the
+source code. And you must show them these terms so they know their
+rights.
+
+ We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+ Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software. If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+ Finally, any free program is threatened constantly by software
+patents. We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary. To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ GNU GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License. The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language. (Hereinafter, translation is included without limitation in
+the term "modification".) Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+ 1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+ 2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+ a) You must cause the modified files to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ b) You must cause any work that you distribute or publish, that in
+ whole or in part contains or is derived from the Program or any
+ part thereof, to be licensed as a whole at no charge to all third
+ parties under the terms of this License.
+
+ c) If the modified program normally reads commands interactively
+ when run, you must cause it, when started running for such
+ interactive use in the most ordinary way, to print or display an
+ announcement including an appropriate copyright notice and a
+ notice that there is no warranty (or else, saying that you provide
+ a warranty) and that users may redistribute the program under
+ these conditions, and telling the user how to view a copy of this
+ License. (Exception: if the Program itself is interactive but
+ does not normally print such an announcement, your work based on
+ the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+ 3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+ a) Accompany it with the complete corresponding machine-readable
+ source code, which must be distributed under the terms of Sections
+ 1 and 2 above on a medium customarily used for software interchange; or,
+
+ b) Accompany it with a written offer, valid for at least three
+ years, to give any third party, for a charge no more than your
+ cost of physically performing source distribution, a complete
+ machine-readable copy of the corresponding source code, to be
+ distributed under the terms of Sections 1 and 2 above on a medium
+ customarily used for software interchange; or,
+
+ c) Accompany it with the information you received as to the offer
+ to distribute corresponding source code. (This alternative is
+ allowed only for noncommercial distribution and only if you
+ received the program in object code or executable form with such
+ an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it. For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable. However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+ 4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License. Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+ 5. You are not required to accept this License, since you have not
+signed it. However, nothing else grants you permission to modify or
+distribute the Program or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+ 6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions. You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+ 7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all. For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices. Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+ 8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded. In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+ 9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation. If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+ 10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission. For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this. Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+ NO WARRANTY
+
+ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+ END OF TERMS AND CONDITIONS
+
+ Appendix: How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+ <one line to give the program's name and a brief idea of what it does.>
+ Copyright (C) 19yy <name of author>
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program 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 General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+ Gnomovision version 69, Copyright (C) 19yy name of author
+ Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+ This is free software, and you are welcome to redistribute it
+ under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License. Of course, the commands you use may
+be called something other than `show w' and `show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary. Here is a sample; alter the names:
+
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+ `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+ <signature of Ty Coon>, 1 April 1989
+ Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs. If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library. If this is what you want to do, use the GNU Library General
+Public License instead of this License.
1  ChangeLog
@@ -0,0 +1 @@
+see README
0  INSTALL
No changes.
10 Makefile.am
@@ -0,0 +1,10 @@
+bin_PROGRAMS = eiwic
+eiwic_SOURCES = dlist.c dlist.h eiwic.c eiwic.h numerics.h plugins.c \
+ plugins.h settings.c settings.h connections.c connections.h \
+ servers.c servers.h users.c users.h
+
+EXTRA_DIST = sample.conf debug.conf rssfeed.conf doc modules/*.buildflags
+
+
+SUBDIRS = modules
+
417 Makefile.in
@@ -0,0 +1,417 @@
+# Makefile.in generated automatically by automake 1.4-p6 from Makefile.am
+
+# Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+
+SHELL = @SHELL@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+prefix = @prefix@
+exec_prefix = @exec_prefix@
+
+bindir = @bindir@
+sbindir = @sbindir@
+libexecdir = @libexecdir@
+datadir = @datadir@
+sysconfdir = @sysconfdir@
+sharedstatedir = @sharedstatedir@
+localstatedir = @localstatedir@
+libdir = @libdir@
+infodir = @infodir@
+mandir = @mandir@
+includedir = @includedir@
+oldincludedir = /usr/include
+
+DESTDIR =
+
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+
+top_builddir = .
+
+ACLOCAL = @ACLOCAL@
+AUTOCONF = @AUTOCONF@
+AUTOMAKE = @AUTOMAKE@
+AUTOHEADER = @AUTOHEADER@
+
+INSTALL = @INSTALL@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS)
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+transform = @program_transform_name@
+
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+host_alias = @host_alias@
+host_triplet = @host@
+CC = @CC@
+HAVE_LIB = @HAVE_LIB@
+LIB = @LIB@
+LTLIB = @LTLIB@
+MAKEINFO = @MAKEINFO@
+PACKAGE = @PACKAGE@
+VERSION = @VERSION@
+
+bin_PROGRAMS = eiwic
+eiwic_SOURCES = dlist.c dlist.h eiwic.c eiwic.h numerics.h plugins.c plugins.h settings.c settings.h connections.c connections.h servers.c servers.h users.c users.h
+
+
+EXTRA_DIST = sample.conf debug.conf rssfeed.conf doc modules/*.buildflags
+
+SUBDIRS = modules
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
+CONFIG_CLEAN_FILES =
+PROGRAMS = $(bin_PROGRAMS)
+
+
+DEFS = @DEFS@ -I. -I$(srcdir)
+CPPFLAGS = @CPPFLAGS@
+LDFLAGS = @LDFLAGS@
+LIBS = @LIBS@
+eiwic_OBJECTS = dlist.o eiwic.o plugins.o settings.o connections.o \
+servers.o users.o
+eiwic_LDADD = $(LDADD)
+eiwic_DEPENDENCIES =
+eiwic_LDFLAGS =
+CFLAGS = @CFLAGS@
+COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@
+DIST_COMMON = README AUTHORS COPYING ChangeLog INSTALL Makefile.am \
+Makefile.in NEWS TODO aclocal.m4 config.guess config.sub configure \
+configure.in install-sh missing mkinstalldirs
+
+
+DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
+
+TAR = tar
+GZIP_ENV = --best
+SOURCES = $(eiwic_SOURCES)
+OBJECTS = $(eiwic_OBJECTS)
+
+all: all-redirect
+.SUFFIXES:
+.SUFFIXES: .S .c .o .s
+$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
+ cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps Makefile
+
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ cd $(top_builddir) \
+ && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status
+
+$(ACLOCAL_M4): configure.in
+ cd $(srcdir) && $(ACLOCAL)
+
+config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ $(SHELL) ./config.status --recheck
+$(srcdir)/configure: $(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES)
+ cd $(srcdir) && $(AUTOCONF)
+
+mostlyclean-binPROGRAMS:
+
+clean-binPROGRAMS:
+ -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS)
+
+distclean-binPROGRAMS:
+
+maintainer-clean-binPROGRAMS:
+
+install-binPROGRAMS: $(bin_PROGRAMS)
+ @$(NORMAL_INSTALL)
+ $(mkinstalldirs) $(DESTDIR)$(bindir)
+ @list='$(bin_PROGRAMS)'; for p in $$list; do \
+ if test -f $$p; then \
+ echo " $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`"; \
+ $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \
+ else :; fi; \
+ done
+
+uninstall-binPROGRAMS:
+ @$(NORMAL_UNINSTALL)
+ list='$(bin_PROGRAMS)'; for p in $$list; do \
+ rm -f $(DESTDIR)$(bindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \
+ done
+
+.c.o:
+ $(COMPILE) -c $<
+
+.s.o:
+ $(COMPILE) -c $<
+
+.S.o:
+ $(COMPILE) -c $<
+
+mostlyclean-compile:
+ -rm -f *.o core *.core
+
+clean-compile:
+
+distclean-compile:
+ -rm -f *.tab.c
+
+maintainer-clean-compile:
+
+eiwic: $(eiwic_OBJECTS) $(eiwic_DEPENDENCIES)
+ @rm -f eiwic
+ $(LINK) $(eiwic_LDFLAGS) $(eiwic_OBJECTS) $(eiwic_LDADD) $(LIBS)
+
+# This directory's subdirectories are mostly independent; you can cd
+# into them and run `make' without going through this Makefile.
+# To change the values of `make' variables: instead of editing Makefiles,
+# (1) if the variable is set in `config.status', edit `config.status'
+# (which will cause the Makefiles to be regenerated when you run `make');
+# (2) otherwise, pass the desired values on the `make' command line.
+
+@SET_MAKE@
+
+all-recursive install-data-recursive install-exec-recursive \
+installdirs-recursive install-recursive uninstall-recursive \
+check-recursive installcheck-recursive info-recursive dvi-recursive:
+ @set fnord $(MAKEFLAGS); amf=$$2; \
+ dot_seen=no; \
+ target=`echo $@ | sed s/-recursive//`; \
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ echo "Making $$target in $$subdir"; \
+ if test "$$subdir" = "."; then \
+ dot_seen=yes; \
+ local_target="$$target-am"; \
+ else \
+ local_target="$$target"; \
+ fi; \
+ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+ || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
+ done; \
+ if test "$$dot_seen" = "no"; then \
+ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+ fi; test -z "$$fail"
+
+mostlyclean-recursive clean-recursive distclean-recursive \
+maintainer-clean-recursive:
+ @set fnord $(MAKEFLAGS); amf=$$2; \
+ dot_seen=no; \
+ rev=''; list='$(SUBDIRS)'; for subdir in $$list; do \
+ rev="$$subdir $$rev"; \
+ test "$$subdir" != "." || dot_seen=yes; \
+ done; \
+ test "$$dot_seen" = "no" && rev=". $$rev"; \
+ target=`echo $@ | sed s/-recursive//`; \
+ for subdir in $$rev; do \
+ echo "Making $$target in $$subdir"; \
+ if test "$$subdir" = "."; then \
+ local_target="$$target-am"; \
+ else \
+ local_target="$$target"; \
+ fi; \
+ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+ || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
+ done && test -z "$$fail"
+tags-recursive:
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
+ done
+
+tags: TAGS
+
+ID: $(HEADERS) $(SOURCES) $(LISP)
+ list='$(SOURCES) $(HEADERS)'; \
+ unique=`for i in $$list; do echo $$i; done | \
+ awk ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ here=`pwd` && cd $(srcdir) \
+ && mkid -f$$here/ID $$unique $(LISP)
+
+TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ if test "$$subdir" = .; then :; else \
+ test -f $$subdir/TAGS && tags="$$tags -i $$here/$$subdir/TAGS"; \
+ fi; \
+ done; \
+ list='$(SOURCES) $(HEADERS)'; \
+ unique=`for i in $$list; do echo $$i; done | \
+ awk ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \
+ || (cd $(srcdir) && etags -o $$here/TAGS $(ETAGS_ARGS) $$tags $$unique $(LISP))
+
+mostlyclean-tags:
+
+clean-tags:
+
+distclean-tags:
+ -rm -f TAGS ID
+
+maintainer-clean-tags:
+
+distdir = $(PACKAGE)-$(VERSION)
+top_distdir = $(distdir)
+
+# This target untars the dist file and tries a VPATH configuration. Then
+# it guarantees that the distribution is self-contained by making another
+# tarfile.
+distcheck: dist
+ -rm -rf $(distdir)
+ GZIP=$(GZIP_ENV) $(TAR) zxf $(distdir).tar.gz
+ mkdir $(distdir)/=build
+ mkdir $(distdir)/=inst
+ dc_install_base=`cd $(distdir)/=inst && pwd`; \
+ cd $(distdir)/=build \
+ && ../configure --srcdir=.. --prefix=$$dc_install_base \
+ && $(MAKE) $(AM_MAKEFLAGS) \
+ && $(MAKE) $(AM_MAKEFLAGS) dvi \
+ && $(MAKE) $(AM_MAKEFLAGS) check \
+ && $(MAKE) $(AM_MAKEFLAGS) install \
+ && $(MAKE) $(AM_MAKEFLAGS) installcheck \
+ && $(MAKE) $(AM_MAKEFLAGS) dist
+ -rm -rf $(distdir)
+ @banner="$(distdir).tar.gz is ready for distribution"; \
+ dashes=`echo "$$banner" | sed s/./=/g`; \
+ echo "$$dashes"; \
+ echo "$$banner"; \
+ echo "$$dashes"
+dist: distdir
+ -chmod -R a+r $(distdir)
+ GZIP=$(GZIP_ENV) $(TAR) chozf $(distdir).tar.gz $(distdir)
+ -rm -rf $(distdir)
+dist-all: distdir
+ -chmod -R a+r $(distdir)
+ GZIP=$(GZIP_ENV) $(TAR) chozf $(distdir).tar.gz $(distdir)
+ -rm -rf $(distdir)
+distdir: $(DISTFILES)
+ -rm -rf $(distdir)
+ mkdir $(distdir)
+ -chmod 777 $(distdir)
+ $(mkinstalldirs) $(distdir)/modules
+ @for file in $(DISTFILES); do \
+ d=$(srcdir); \
+ if test -d $$d/$$file; then \
+ cp -pr $$d/$$file $(distdir)/$$file; \
+ else \
+ test -f $(distdir)/$$file \
+ || ln $$d/$$file $(distdir)/$$file 2> /dev/null \
+ || cp -p $$d/$$file $(distdir)/$$file || :; \
+ fi; \
+ done
+ for subdir in $(SUBDIRS); do \
+ if test "$$subdir" = .; then :; else \
+ test -d $(distdir)/$$subdir \
+ || mkdir $(distdir)/$$subdir \
+ || exit 1; \
+ chmod 777 $(distdir)/$$subdir; \
+ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir=../$(distdir) distdir=../$(distdir)/$$subdir distdir) \
+ || exit 1; \
+ fi; \
+ done
+connections.o: connections.c eiwic.h dlist.h users.h servers.h \
+ connections.h plugins.h
+dlist.o: dlist.c dlist.h
+eiwic.o: eiwic.c eiwic.h dlist.h users.h servers.h settings.h numerics.h \
+ connections.h plugins.h
+plugins.o: plugins.c eiwic.h dlist.h users.h servers.h settings.h \
+ plugins.h connections.h
+servers.o: servers.c eiwic.h dlist.h users.h servers.h settings.h \
+ plugins.h connections.h
+settings.o: settings.c eiwic.h dlist.h users.h servers.h settings.h \
+ plugins.h connections.h
+users.o: users.c eiwic.h dlist.h users.h servers.h plugins.h \
+ connections.h
+
+info-am:
+info: info-recursive
+dvi-am:
+dvi: dvi-recursive
+check-am: all-am
+check: check-recursive
+installcheck-am:
+installcheck: installcheck-recursive
+install-exec-am: install-binPROGRAMS
+install-exec: install-exec-recursive
+
+install-data-am:
+install-data: install-data-recursive
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+install: install-recursive
+uninstall-am: uninstall-binPROGRAMS
+uninstall: uninstall-recursive
+all-am: Makefile $(PROGRAMS)
+all-redirect: all-recursive
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install
+installdirs: installdirs-recursive
+installdirs-am:
+ $(mkinstalldirs) $(DESTDIR)$(bindir)
+
+
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -rm -f Makefile $(CONFIG_CLEAN_FILES)
+ -rm -f config.cache config.log stamp-h stamp-h[0-9]*
+
+maintainer-clean-generic:
+mostlyclean-am: mostlyclean-binPROGRAMS mostlyclean-compile \
+ mostlyclean-tags mostlyclean-generic
+
+mostlyclean: mostlyclean-recursive
+
+clean-am: clean-binPROGRAMS clean-compile clean-tags clean-generic \
+ mostlyclean-am
+
+clean: clean-recursive
+
+distclean-am: distclean-binPROGRAMS distclean-compile distclean-tags \
+ distclean-generic clean-am
+
+distclean: distclean-recursive
+ -rm -f config.status
+
+maintainer-clean-am: maintainer-clean-binPROGRAMS \
+ maintainer-clean-compile maintainer-clean-tags \
+ maintainer-clean-generic distclean-am
+ @echo "This command is intended for maintainers to use;"
+ @echo "it deletes files that may require special tools to rebuild."
+
+maintainer-clean: maintainer-clean-recursive
+ -rm -f config.status
+
+.PHONY: mostlyclean-binPROGRAMS distclean-binPROGRAMS clean-binPROGRAMS \
+maintainer-clean-binPROGRAMS uninstall-binPROGRAMS install-binPROGRAMS \
+mostlyclean-compile distclean-compile clean-compile \
+maintainer-clean-compile install-data-recursive \
+uninstall-data-recursive install-exec-recursive \
+uninstall-exec-recursive installdirs-recursive uninstalldirs-recursive \
+all-recursive check-recursive installcheck-recursive info-recursive \
+dvi-recursive mostlyclean-recursive distclean-recursive clean-recursive \
+maintainer-clean-recursive tags tags-recursive mostlyclean-tags \
+distclean-tags clean-tags maintainer-clean-tags distdir info-am info \
+dvi-am dvi check check-am installcheck-am installcheck install-exec-am \
+install-exec install-data-am install-data install-am install \
+uninstall-am uninstall all-redirect all-am all installdirs-am \
+installdirs mostlyclean-generic distclean-generic clean-generic \
+maintainer-clean-generic clean mostlyclean distclean maintainer-clean
+
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
0  NEWS
No changes.
152 README
@@ -0,0 +1,152 @@
+Eiwic 1.1.0
+-------------------------------------------------------------------------------
+ ___ _ _
+ | __(_)_ __ _(_)__ mail__________lordi@styleliga.org
+ | _|| \ V V / / _| www___http://lordi.styleliga.org
+ |___|_|\_/\_/|_\__| irc_________________lordi@IRCnet
+
+
+ Eiwic is released under the GPL, for more info please read the file COPYING.
+
+
+Short installation guide
+-------------------------------------------------------------------------------
+
+ - Ungzip & untar the eiwic-1.1.x.tar.gz file
+
+ - Edit Makefile (If your system does not support IPv6 etc.)
+
+ - Run 'gmake' (or 'make' if gmake does not work)
+
+ - Edit 'sample.conf' to fit your needs and save it as 'bot.conf'
+
+ - Optional: Run "./eiwic bot.conf -l - -v 10" to probe if the bot is
+ running correctly with your bot.conf. If it doesn't give you errors
+ or warnings and joins the channels you set, your configuration is
+ alright and you can kill the bot again through SIGINT (Ctrl-C).
+
+ - To run the bot in the background finally, you may launch it with
+ "./eiwic bot.conf -d" or, additionally, with "-l eiwic.log -v X" if
+ you want a logfile (X is the verbosity level, set it to 10 for a
+ verbose debug logfile, or to 2 for a normal (smaller) logfile.
+
+-------------------------------------------------------------------------------
+
+Send bugs to lordi@styleliga.org with a description and, if necessary, the part
+of the logfile.
+
+Thanks go out to alpha_5 for running Eiwic on his server so many bugs have been
+found, to Youk for making it run on OpenBSD and to Elaminato for testing Eiwic
+with Cygwin :)
+
+
+Changelog
+-------------------------------------------------------------------------------
+
+1.1.3 - jun 29th 2005
+ * Added RSS newsfeed module (rssfeed.c) (libraptor required)
+ * You can now create a modules/*.buildflags file where additional
+ flags for the specific module can be written down
+ * You can now create a modules/*.skip file to skip a module during
+ compilation
+ * -t flag can now take multiple trigger lines, seperated by semicolon
+ * output_tostring() to get the output destination (channel, query, ...)
+
+1.1.2 - ....
+
+1.1.1 - oct 27th 2004
+ * fixed a bug with output routing
+ * added more functions to admin.so
+ * added !decide module
+ * added experimental !getnick module - dont use it ;)
+ * added a crash/debug module
+
+1.1.0 - oct 15th 2004
+ * added output routing:
+ every trigger, ep_main, ep_help function doesn't have to
+ send its output now directly to the server. it just sends
+ its output to an OUTPUT object, which will then be routed
+ to a channel, and then to the server, for example
+ * changed module API because of the output routing
+ * in the msvc/ directory is now a MSVC studio workspace (not
+ for compiling, just editing)
+ * thrown out some modules... fixed all other modules to match the
+ new module API
+ * introduced ep_help callback for the modules
+ * changed !help trigger from the info module. it can now be used
+ to read what the ep_help trigger returns from every module.
+ * triggers can now be used in private /msgs to the bot
+ * triggers can now be tested with the -t cmdline parameter
+
+1.0.14 - oct 10th 2004
+ the last version(s) hasn't been documented.
+
+ * support for admin_mask and admin-only triggers added
+ * added modadmin module for runtime-module-managment
+ * fixed "dict":
+ - now using pda.leo.org
+ - added !dico for french - german translation
+ - had to update html parsing
+ - support for <b>-tag
+ * added some testing modules (don't pay attention to them)
+ * + more fixes
+
+1.0.12 pre1:
+ ./configure script included (thanks to Youk)
+ pre2:
+ "stream" module introduced, streams your channel through browser
+ "rot13" module added, introducing !rot13 ;)
+ code clean-ups
+ pre3:
+ modules/Makefile fixed for some systems (thanks to Youk)
+ struct timeval fix for some system (required sys/time.h)
+ added "USERNAME" setting in the config file
+ pre4:
+ added "stats" module, monitoring all triggers and saves statistics
+ added ep_trigger call back function, is always called when any
+ trigger is triggered
+ "stream" module updates
+ pre5:
+ added "users.[c|h]" and basic user_* functions
+ added "getop" module, which will be replaced with some real
+ user/rights management etc. (doesn't work however ;),
+ dont use it)
+ fixed !dict module (layout change on dict.leo.org)
+ pre6:
+ added CSS style support for HTTP livestream (stream)
+1.0.11 module code updated again
+ Makefile re-written
+1.0.10 removed 'ping' module / added 'conv' (EUR->USD) conversion
+ added 'heise' module that automatically puts new heise news into your
+ channel
+ added a function that pings the server after a specific intervall so
+ that eiwic is able to discover when the connection got lost
+ updated module code (will not link functions anymore)
+1.0.9 minor bug fixes
+ will now run on OpenBSD (OpenBSD does not support modules loading in a
+ way linux does, so it might cause problems)
+1.0.8 fixed bc bug ;)
+ added "settings" structure/set code rewritten
+ module code cleanups
+ added cyborg module
+ added HTTPS proxy support
+ fixed ld open issue
+1.0.7 Makefile updated
+ add bc/calc module
+ALPHA6: minor bug fixes
+ added !find (google module)
+ added ipv6 and debug switches to Makefile
+ALPHA5: major bug fixes
+ cleaned up modules
+ added !up ;)
+ALPHA4: vhost support
+ vvd_section
+ALPHA3: daemon mode
+ ctcp module updated: ping
+ ipv6
+ multiple server
+ multiple channels
+ALPHA2: introducing new log system with several
+ verbosity-level and module-dependent logging
+
+-------------------------------------------------------------------------------
6 TODO
@@ -0,0 +1,6 @@
+* log(LOG_STATUS, "Uptime: ...") when eiwic quits
+* modules/stream.c: filter < & >
+* modules/stream.c: filter mirc color codes
+* modules/stream.c: filter \02 -> <b> and </b>
+* modules/stream.c: morph (http://|www.)[^\ ] to links
+* eiwic: add some kind of asyncronous DNS lib
955 aclocal.m4
@@ -0,0 +1,955 @@
+dnl aclocal.m4 generated automatically by aclocal 1.4-p6
+
+dnl Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl This program is distributed in the hope that it will be useful,
+dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+dnl PARTICULAR PURPOSE.
+
+# lib-prefix.m4 serial 3 (gettext-0.13)
+dnl Copyright (C) 2001-2003 Free Software Foundation, Inc.
+dnl This file is free software, distributed under the terms of the GNU
+dnl General Public License. As a special exception to the GNU General
+dnl Public License, this file may be distributed as part of a program
+dnl that contains a configuration script generated by Autoconf, under
+dnl the same distribution terms as the rest of that program.
+
+dnl From Bruno Haible.
+
+dnl AC_LIB_ARG_WITH is synonymous to AC_ARG_WITH in autoconf-2.13, and
+dnl similar to AC_ARG_WITH in autoconf 2.52...2.57 except that is doesn't
+dnl require excessive bracketing.
+ifdef([AC_HELP_STRING],
+[AC_DEFUN([AC_LIB_ARG_WITH], [AC_ARG_WITH([$1],[[$2]],[$3],[$4])])],
+[AC_DEFUN([AC_][LIB_ARG_WITH], [AC_ARG_WITH([$1],[$2],[$3],[$4])])])
+
+dnl AC_LIB_PREFIX adds to the CPPFLAGS and LDFLAGS the flags that are needed
+dnl to access previously installed libraries. The basic assumption is that
+dnl a user will want packages to use other packages he previously installed
+dnl with the same --prefix option.
+dnl This macro is not needed if only AC_LIB_LINKFLAGS is used to locate
+dnl libraries, but is otherwise very convenient.
+AC_DEFUN([AC_LIB_PREFIX],
+[
+ AC_BEFORE([$0], [AC_LIB_LINKFLAGS])
+ AC_REQUIRE([AC_PROG_CC])
+ AC_REQUIRE([AC_CANONICAL_HOST])
+ AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
+ dnl By default, look in $includedir and $libdir.
+ use_additional=yes
+ AC_LIB_WITH_FINAL_PREFIX([
+ eval additional_includedir=\"$includedir\"
+ eval additional_libdir=\"$libdir\"
+ ])
+ AC_LIB_ARG_WITH([lib-prefix],
+[ --with-lib-prefix[=DIR] search for libraries in DIR/include and DIR/lib
+ --without-lib-prefix don't search for libraries in includedir and libdir],
+[
+ if test "X$withval" = "Xno"; then
+ use_additional=no
+ else
+ if test "X$withval" = "X"; then
+ AC_LIB_WITH_FINAL_PREFIX([
+ eval additional_includedir=\"$includedir\"
+ eval additional_libdir=\"$libdir\"
+ ])
+ else
+ additional_includedir="$withval/include"
+ additional_libdir="$withval/lib"
+ fi
+ fi
+])
+ if test $use_additional = yes; then
+ dnl Potentially add $additional_includedir to $CPPFLAGS.
+ dnl But don't add it
+ dnl 1. if it's the standard /usr/include,
+ dnl 2. if it's already present in $CPPFLAGS,
+ dnl 3. if it's /usr/local/include and we are using GCC on Linux,
+ dnl 4. if it doesn't exist as a directory.
+ if test "X$additional_includedir" != "X/usr/include"; then
+ haveit=
+ for x in $CPPFLAGS; do
+ AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
+ if test "X$x" = "X-I$additional_includedir"; then
+ haveit=yes
+ break
+ fi
+ done
+ if test -z "$haveit"; then
+ if test "X$additional_includedir" = "X/usr/local/include"; then
+ if test -n "$GCC"; then
+ case $host_os in
+ linux*) haveit=yes;;
+ esac
+ fi
+ fi
+ if test -z "$haveit"; then
+ if test -d "$additional_includedir"; then
+ dnl Really add $additional_includedir to $CPPFLAGS.
+ CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }-I$additional_includedir"
+ fi
+ fi
+ fi
+ fi
+ dnl Potentially add $additional_libdir to $LDFLAGS.
+ dnl But don't add it
+ dnl 1. if it's the standard /usr/lib,
+ dnl 2. if it's already present in $LDFLAGS,
+ dnl 3. if it's /usr/local/lib and we are using GCC on Linux,
+ dnl 4. if it doesn't exist as a directory.
+ if test "X$additional_libdir" != "X/usr/lib"; then
+ haveit=
+ for x in $LDFLAGS; do
+ AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
+ if test "X$x" = "X-L$additional_libdir"; then
+ haveit=yes
+ break
+ fi
+ done
+ if test -z "$haveit"; then
+ if test "X$additional_libdir" = "X/usr/local/lib"; then
+ if test -n "$GCC"; then
+ case $host_os in
+ linux*) haveit=yes;;
+ esac
+ fi
+ fi
+ if test -z "$haveit"; then
+ if test -d "$additional_libdir"; then
+ dnl Really add $additional_libdir to $LDFLAGS.
+ LDFLAGS="${LDFLAGS}${LDFLAGS:+ }-L$additional_libdir"
+ fi
+ fi
+ fi
+ fi
+ fi
+])
+
+dnl AC_LIB_PREPARE_PREFIX creates variables acl_final_prefix,
+dnl acl_final_exec_prefix, containing the values to which $prefix and
+dnl $exec_prefix will expand at the end of the configure script.
+AC_DEFUN([AC_LIB_PREPARE_PREFIX],
+[
+ dnl Unfortunately, prefix and exec_prefix get only finally determined
+ dnl at the end of configure.
+ if test "X$prefix" = "XNONE"; then
+ acl_final_prefix="$ac_default_prefix"
+ else
+ acl_final_prefix="$prefix"
+ fi
+ if test "X$exec_prefix" = "XNONE"; then
+ acl_final_exec_prefix='${prefix}'
+ else
+ acl_final_exec_prefix="$exec_prefix"
+ fi
+ acl_save_prefix="$prefix"
+ prefix="$acl_final_prefix"
+ eval acl_final_exec_prefix=\"$acl_final_exec_prefix\"
+ prefix="$acl_save_prefix"
+])
+
+dnl AC_LIB_WITH_FINAL_PREFIX([statement]) evaluates statement, with the
+dnl variables prefix and exec_prefix bound to the values they will have
+dnl at the end of the configure script.
+AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX],
+[
+ acl_save_prefix="$prefix"
+ prefix="$acl_final_prefix"
+ acl_save_exec_prefix="$exec_prefix"
+ exec_prefix="$acl_final_exec_prefix"
+ $1
+ exec_prefix="$acl_save_exec_prefix"
+ prefix="$acl_save_prefix"
+])
+
+# lib-link.m4 serial 4 (gettext-0.12)
+dnl Copyright (C) 2001-2003 Free Software Foundation, Inc.
+dnl This file is free software, distributed under the terms of the GNU
+dnl General Public License. As a special exception to the GNU General
+dnl Public License, this file may be distributed as part of a program
+dnl that contains a configuration script generated by Autoconf, under
+dnl the same distribution terms as the rest of that program.
+
+dnl From Bruno Haible.
+
+dnl AC_LIB_LINKFLAGS(name [, dependencies]) searches for libname and
+dnl the libraries corresponding to explicit and implicit dependencies.
+dnl Sets and AC_SUBSTs the LIB${NAME} and LTLIB${NAME} variables and
+dnl augments the CPPFLAGS variable.
+AC_DEFUN([AC_LIB_LINKFLAGS],
+[
+ AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
+ AC_REQUIRE([AC_LIB_RPATH])
+ define([Name],[translit([$1],[./-], [___])])
+ define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
+ [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
+ AC_CACHE_CHECK([how to link with lib[]$1], [ac_cv_lib[]Name[]_libs], [
+ AC_LIB_LINKFLAGS_BODY([$1], [$2])
+ ac_cv_lib[]Name[]_libs="$LIB[]NAME"
+ ac_cv_lib[]Name[]_ltlibs="$LTLIB[]NAME"
+ ac_cv_lib[]Name[]_cppflags="$INC[]NAME"
+ ])
+ LIB[]NAME="$ac_cv_lib[]Name[]_libs"
+ LTLIB[]NAME="$ac_cv_lib[]Name[]_ltlibs"
+ INC[]NAME="$ac_cv_lib[]Name[]_cppflags"
+ AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
+ AC_SUBST([LIB]NAME)
+ AC_SUBST([LTLIB]NAME)
+ dnl Also set HAVE_LIB[]NAME so that AC_LIB_HAVE_LINKFLAGS can reuse the
+ dnl results of this search when this library appears as a dependency.
+ HAVE_LIB[]NAME=yes
+ undefine([Name])
+ undefine([NAME])
+])
+
+dnl AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode)
+dnl searches for libname and the libraries corresponding to explicit and
+dnl implicit dependencies, together with the specified include files and
+dnl the ability to compile and link the specified testcode. If found, it
+dnl sets and AC_SUBSTs HAVE_LIB${NAME}=yes and the LIB${NAME} and
+dnl LTLIB${NAME} variables and augments the CPPFLAGS variable, and
+dnl #defines HAVE_LIB${NAME} to 1. Otherwise, it sets and AC_SUBSTs
+dnl HAVE_LIB${NAME}=no and LIB${NAME} and LTLIB${NAME} to empty.
+AC_DEFUN([AC_LIB_HAVE_LINKFLAGS],
+[
+ AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
+ AC_REQUIRE([AC_LIB_RPATH])
+ define([Name],[translit([$1],[./-], [___])])
+ define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
+ [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
+
+ dnl Search for lib[]Name and define LIB[]NAME, LTLIB[]NAME and INC[]NAME
+ dnl accordingly.
+ AC_LIB_LINKFLAGS_BODY([$1], [$2])
+
+ dnl Add $INC[]NAME to CPPFLAGS before performing the following checks,
+ dnl because if the user has installed lib[]Name and not disabled its use
+ dnl via --without-lib[]Name-prefix, he wants to use it.
+ ac_save_CPPFLAGS="$CPPFLAGS"
+ AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
+
+ AC_CACHE_CHECK([for lib[]$1], [ac_cv_lib[]Name], [
+ ac_save_LIBS="$LIBS"
+ LIBS="$LIBS $LIB[]NAME"
+ AC_TRY_LINK([$3], [$4], [ac_cv_lib[]Name=yes], [ac_cv_lib[]Name=no])
+ LIBS="$ac_save_LIBS"
+ ])
+ if test "$ac_cv_lib[]Name" = yes; then
+ HAVE_LIB[]NAME=yes
+ AC_DEFINE([HAVE_LIB]NAME, 1, [Define if you have the $1 library.])
+ AC_MSG_CHECKING([how to link with lib[]$1])
+ AC_MSG_RESULT([$LIB[]NAME])
+ else
+ HAVE_LIB[]NAME=no
+ dnl If $LIB[]NAME didn't lead to a usable library, we don't need
+ dnl $INC[]NAME either.
+ CPPFLAGS="$ac_save_CPPFLAGS"
+ LIB[]NAME=
+ LTLIB[]NAME=
+ fi
+ AC_SUBST([HAVE_LIB]NAME)
+ AC_SUBST([LIB]NAME)
+ AC_SUBST([LTLIB]NAME)
+ undefine([Name])
+ undefine([NAME])
+])
+
+dnl Determine the platform dependent parameters needed to use rpath:
+dnl libext, shlibext, hardcode_libdir_flag_spec, hardcode_libdir_separator,
+dnl hardcode_direct, hardcode_minus_L.
+AC_DEFUN([AC_LIB_RPATH],
+[
+ AC_REQUIRE([AC_PROG_CC]) dnl we use $CC, $GCC, $LDFLAGS
+ AC_REQUIRE([AC_LIB_PROG_LD]) dnl we use $LD, $with_gnu_ld
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl we use $host
+ AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT]) dnl we use $ac_aux_dir
+ AC_CACHE_CHECK([for shared library run path origin], acl_cv_rpath, [
+ CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \
+ ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh
+ . ./conftest.sh
+ rm -f ./conftest.sh
+ acl_cv_rpath=done
+ ])
+ wl="$acl_cv_wl"
+ libext="$acl_cv_libext"
+ shlibext="$acl_cv_shlibext"
+ hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec"
+ hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator"
+ hardcode_direct="$acl_cv_hardcode_direct"
+ hardcode_minus_L="$acl_cv_hardcode_minus_L"
+ dnl Determine whether the user wants rpath handling at all.
+ AC_ARG_ENABLE(rpath,
+ [ --disable-rpath do not hardcode runtime library paths],
+ :, enable_rpath=yes)
+])
+
+dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and
+dnl the libraries corresponding to explicit and implicit dependencies.
+dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables.
+AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
+[
+ define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
+ [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
+ dnl By default, look in $includedir and $libdir.
+ use_additional=yes
+ AC_LIB_WITH_FINAL_PREFIX([
+ eval additional_includedir=\"$includedir\"
+ eval additional_libdir=\"$libdir\"
+ ])
+ AC_LIB_ARG_WITH([lib$1-prefix],
+[ --with-lib$1-prefix[=DIR] search for lib$1 in DIR/include and DIR/lib
+ --without-lib$1-prefix don't search for lib$1 in includedir and libdir],
+[
+ if test "X$withval" = "Xno"; then
+ use_additional=no
+ else
+ if test "X$withval" = "X"; then
+ AC_LIB_WITH_FINAL_PREFIX([
+ eval additional_includedir=\"$includedir\"
+ eval additional_libdir=\"$libdir\"
+ ])
+ else
+ additional_includedir="$withval/include"
+ additional_libdir="$withval/lib"
+ fi
+ fi
+])
+ dnl Search the library and its dependencies in $additional_libdir and
+ dnl $LDFLAGS. Using breadth-first-seach.
+ LIB[]NAME=
+ LTLIB[]NAME=
+ INC[]NAME=
+ rpathdirs=
+ ltrpathdirs=
+ names_already_handled=
+ names_next_round='$1 $2'
+ while test -n "$names_next_round"; do
+ names_this_round="$names_next_round"
+ names_next_round=
+ for name in $names_this_round; do
+ already_handled=
+ for n in $names_already_handled; do
+ if test "$n" = "$name"; then
+ already_handled=yes
+ break
+ fi
+ done
+ if test -z "$already_handled"; then
+ names_already_handled="$names_already_handled $name"
+ dnl See if it was already located by an earlier AC_LIB_LINKFLAGS
+ dnl or AC_LIB_HAVE_LINKFLAGS call.
+ uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'`
+ eval value=\"\$HAVE_LIB$uppername\"
+ if test -n "$value"; then
+ if test "$value" = yes; then
+ eval value=\"\$LIB$uppername\"
+ test -z "$value" || LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$value"
+ eval value=\"\$LTLIB$uppername\"
+ test -z "$value" || LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$value"
+ else
+ dnl An earlier call to AC_LIB_HAVE_LINKFLAGS has determined
+ dnl that this library doesn't exist. So just drop it.
+ :
+ fi
+ else
+ dnl Search the library lib$name in $additional_libdir and $LDFLAGS
+ dnl and the already constructed $LIBNAME/$LTLIBNAME.
+ found_dir=
+ found_la=
+ found_so=
+ found_a=
+ if test $use_additional = yes; then
+ if test -n "$shlibext" && test -f "$additional_libdir/lib$name.$shlibext"; then
+ found_dir="$additional_libdir"
+ found_so="$additional_libdir/lib$name.$shlibext"
+ if test -f "$additional_libdir/lib$name.la"; then
+ found_la="$additional_libdir/lib$name.la"
+ fi
+ else
+ if test -f "$additional_libdir/lib$name.$libext"; then
+ found_dir="$additional_libdir"
+ found_a="$additional_libdir/lib$name.$libext"
+ if test -f "$additional_libdir/lib$name.la"; then
+ found_la="$additional_libdir/lib$name.la"
+ fi
+ fi
+ fi
+ fi
+ if test "X$found_dir" = "X"; then
+ for x in $LDFLAGS $LTLIB[]NAME; do
+ AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
+ case "$x" in
+ -L*)
+ dir=`echo "X$x" | sed -e 's/^X-L//'`
+ if test -n "$shlibext" && test -f "$dir/lib$name.$shlibext"; then
+ found_dir="$dir"
+ found_so="$dir/lib$name.$shlibext"
+ if test -f "$dir/lib$name.la"; then
+ found_la="$dir/lib$name.la"
+ fi
+ else
+ if test -f "$dir/lib$name.$libext"; then
+ found_dir="$dir"
+ found_a="$dir/lib$name.$libext"
+ if test -f "$dir/lib$name.la"; then
+ found_la="$dir/lib$name.la"
+ fi
+ fi
+ fi
+ ;;
+ esac
+ if test "X$found_dir" != "X"; then
+ break
+ fi
+ done
+ fi
+ if test "X$found_dir" != "X"; then
+ dnl Found the library.
+ LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$found_dir -l$name"
+ if test "X$found_so" != "X"; then
+ dnl Linking with a shared library. We attempt to hardcode its
+ dnl directory into the executable's runpath, unless it's the
+ dnl standard /usr/lib.
+ if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/lib"; then
+ dnl No hardcoding is needed.
+ LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
+ else
+ dnl Use an explicit option to hardcode DIR into the resulting
+ dnl binary.
+ dnl Potentially add DIR to ltrpathdirs.
+ dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
+ haveit=
+ for x in $ltrpathdirs; do
+ if test "X$x" = "X$found_dir"; then
+ haveit=yes
+ break
+ fi
+ done
+ if test -z "$haveit"; then
+ ltrpathdirs="$ltrpathdirs $found_dir"
+ fi
+ dnl The hardcoding into $LIBNAME is system dependent.
+ if test "$hardcode_direct" = yes; then
+ dnl Using DIR/libNAME.so during linking hardcodes DIR into the
+ dnl resulting binary.
+ LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
+ else
+ if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no; then
+ dnl Use an explicit option to hardcode DIR into the resulting
+ dnl binary.
+ LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
+ dnl Potentially add DIR to rpathdirs.
+ dnl The rpathdirs will be appended to $LIBNAME at the end.
+ haveit=
+ for x in $rpathdirs; do
+ if test "X$x" = "X$found_dir"; then
+ haveit=yes
+ break
+ fi
+ done
+ if test -z "$haveit"; then
+ rpathdirs="$rpathdirs $found_dir"
+ fi
+ else
+ dnl Rely on "-L$found_dir".
+ dnl But don't add it if it's already contained in the LDFLAGS
+ dnl or the already constructed $LIBNAME
+ haveit=
+ for x in $LDFLAGS $LIB[]NAME; do
+ AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
+ if test "X$x" = "X-L$found_dir"; then
+ haveit=yes
+ break
+ fi
+ done
+ if test -z "$haveit"; then
+ LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir"
+ fi
+ if test "$hardcode_minus_L" != no; then
+ dnl FIXME: Not sure whether we should use
+ dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
+ dnl here.
+ LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
+ else
+ dnl We cannot use $hardcode_runpath_var and LD_RUN_PATH
+ dnl here, because this doesn't fit in flags passed to the
+ dnl compiler. So give up. No hardcoding. This affects only
+ dnl very old systems.
+ dnl FIXME: Not sure whether we should use
+ dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
+ dnl here.
+ LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
+ fi
+ fi
+ fi
+ fi
+ else
+ if test "X$found_a" != "X"; then
+ dnl Linking with a static library.
+ LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_a"
+ else
+ dnl We shouldn't come here, but anyway it's good to have a
+ dnl fallback.
+ LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir -l$name"
+ fi
+ fi
+ dnl Assume the include files are nearby.
+ additional_includedir=
+ case "$found_dir" in
+ */lib | */lib/)
+ basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e 's,/lib/*$,,'`
+ additional_includedir="$basedir/include"
+ ;;
+ esac
+ if test "X$additional_includedir" != "X"; then
+ dnl Potentially add $additional_includedir to $INCNAME.
+ dnl But don't add it
+ dnl 1. if it's the standard /usr/include,
+ dnl 2. if it's /usr/local/include and we are using GCC on Linux,
+ dnl 3. if it's already present in $CPPFLAGS or the already
+ dnl constructed $INCNAME,
+ dnl 4. if it doesn't exist as a directory.
+ if test "X$additional_includedir" != "X/usr/include"; then
+ haveit=
+ if test "X$additional_includedir" = "X/usr/local/include"; then
+ if test -n "$GCC"; then
+ case $host_os in
+ linux*) haveit=yes;;
+ esac
+ fi
+ fi
+ if test -z "$haveit"; then
+ for x in $CPPFLAGS $INC[]NAME; do
+ AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
+ if test "X$x" = "X-I$additional_includedir"; then
+ haveit=yes
+ break
+ fi
+ done
+ if test -z "$haveit"; then
+ if test -d "$additional_includedir"; then
+ dnl Really add $additional_includedir to $INCNAME.
+ INC[]NAME="${INC[]NAME}${INC[]NAME:+ }-I$additional_includedir"
+ fi
+ fi
+ fi
+ fi
+ fi
+ dnl Look for dependencies.
+ if test -n "$found_la"; then
+ dnl Read the .la file. It defines the variables
+ dnl dlname, library_names, old_library, dependency_libs, current,
+ dnl age, revision, installed, dlopen, dlpreopen, libdir.
+ save_libdir="$libdir"
+ case "$found_la" in
+ */* | *\\*) . "$found_la" ;;
+ *) . "./$found_la" ;;
+ esac
+ libdir="$save_libdir"
+ dnl We use only dependency_libs.
+ for dep in $dependency_libs; do
+ case "$dep" in
+ -L*)
+ additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'`
+ dnl Potentially add $additional_libdir to $LIBNAME and $LTLIBNAME.
+ dnl But don't add it
+ dnl 1. if it's the standard /usr/lib,
+ dnl 2. if it's /usr/local/lib and we are using GCC on Linux,
+ dnl 3. if it's already present in $LDFLAGS or the already
+ dnl constructed $LIBNAME,
+ dnl 4. if it doesn't exist as a directory.
+ if test "X$additional_libdir" != "X/usr/lib"; then
+ haveit=
+ if test "X$additional_libdir" = "X/usr/local/lib"; then
+ if test -n "$GCC"; then
+ case $host_os in
+ linux*) haveit=yes;;
+ esac
+ fi
+ fi
+ if test -z "$haveit"; then
+ haveit=
+ for x in $LDFLAGS $LIB[]NAME; do
+ AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
+ if test "X$x" = "X-L$additional_libdir"; then
+ haveit=yes
+ break
+ fi
+ done
+ if test -z "$haveit"; then
+ if test -d "$additional_libdir"; then
+ dnl Really add $additional_libdir to $LIBNAME.
+ LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$additional_libdir"
+ fi
+ fi
+ haveit=
+ for x in $LDFLAGS $LTLIB[]NAME; do
+ AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
+ if test "X$x" = "X-L$additional_libdir"; then
+ haveit=yes
+ break
+ fi
+ done
+ if test -z "$haveit"; then
+ if test -d "$additional_libdir"; then
+ dnl Really add $additional_libdir to $LTLIBNAME.
+ LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$additional_libdir"
+ fi
+ fi
+ fi
+ fi
+ ;;
+ -R*)
+ dir=`echo "X$dep" | sed -e 's/^X-R//'`
+ if test "$enable_rpath" != no; then
+ dnl Potentially add DIR to rpathdirs.
+ dnl The rpathdirs will be appended to $LIBNAME at the end.
+ haveit=
+ for x in $rpathdirs; do
+ if test "X$x" = "X$dir"; then
+ haveit=yes
+ break
+ fi
+ done
+ if test -z "$haveit"; then
+ rpathdirs="$rpathdirs $dir"
+ fi
+ dnl Potentially add DIR to ltrpathdirs.
+ dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
+ haveit=
+ for x in $ltrpathdirs; do
+ if test "X$x" = "X$dir"; then
+ haveit=yes
+ break
+ fi
+ done
+ if test -z "$haveit"; then
+ ltrpathdirs="$ltrpathdirs $dir"
+ fi
+ fi
+ ;;
+ -l*)
+ dnl Handle this in the next round.
+ names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'`
+ ;;
+ *.la)
+ dnl Handle this in the next round. Throw away the .la's
+ dnl directory; it is already contained in a preceding -L
+ dnl option.
+ names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'`
+ ;;
+ *)
+ dnl Most likely an immediate library name.
+ LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$dep"
+ LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$dep"
+ ;;
+ esac
+ done
+ fi
+ else
+ dnl Didn't find the library; assume it is in the system directories
+ dnl known to the linker and runtime loader. (All the system
+ dnl directories known to the linker should also be known to the
+ dnl runtime loader, otherwise the system is severely misconfigured.)
+ LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
+ LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-l$name"
+ fi
+ fi
+ fi
+ done
+ done
+ if test "X$rpathdirs" != "X"; then
+ if test -n "$hardcode_libdir_separator"; then
+ dnl Weird platform: only the last -rpath option counts, the user must
+ dnl pass all path elements in one option. We can arrange that for a
+ dnl single library, but not when more than one $LIBNAMEs are used.
+ alldirs=
+ for found_dir in $rpathdirs; do
+ alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$found_dir"
+ done
+ dnl Note: hardcode_libdir_flag_spec uses $libdir and $wl.
+ acl_save_libdir="$libdir"
+ libdir="$alldirs"
+ eval flag=\"$hardcode_libdir_flag_spec\"
+ libdir="$acl_save_libdir"
+ LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
+ else
+ dnl The -rpath options are cumulative.
+ for found_dir in $rpathdirs; do
+ acl_save_libdir="$libdir"
+ libdir="$found_dir"
+ eval flag=\"$hardcode_libdir_flag_spec\"
+ libdir="$acl_save_libdir"
+ LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
+ done
+ fi
+ fi
+ if test "X$ltrpathdirs" != "X"; then
+ dnl When using libtool, the option that works for both libraries and
+ dnl executables is -R. The -R options are cumulative.
+ for found_dir in $ltrpathdirs; do
+ LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-R$found_dir"
+ done
+ fi
+])
+
+dnl AC_LIB_APPENDTOVAR(VAR, CONTENTS) appends the elements of CONTENTS to VAR,
+dnl unless already present in VAR.
+dnl Works only for CPPFLAGS, not for LIB* variables because that sometimes
+dnl contains two or three consecutive elements that belong together.
+AC_DEFUN([AC_LIB_APPENDTOVAR],
+[
+ for element in [$2]; do
+ haveit=
+ for x in $[$1]; do
+ AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
+ if test "X$x" = "X$element"; then
+ haveit=yes
+ break
+ fi
+ done
+ if test -z "$haveit"; then
+ [$1]="${[$1]}${[$1]:+ }$element"
+ fi
+ done
+])
+
+# lib-ld.m4 serial 3 (gettext-0.13)
+dnl Copyright (C) 1996-2003 Free Software Foundation, Inc.
+dnl This file is free software, distributed under the terms of the GNU
+dnl General Public License. As a special exception to the GNU General
+dnl Public License, this file may be distributed as part of a program
+dnl that contains a configuration script generated by Autoconf, under
+dnl the same distribution terms as the rest of that program.
+
+dnl Subroutines of libtool.m4,
+dnl with replacements s/AC_/AC_LIB/ and s/lt_cv/acl_cv/ to avoid collision
+dnl with libtool.m4.
+
+dnl From libtool-1.4. Sets the variable with_gnu_ld to yes or no.
+AC_DEFUN([AC_LIB_PROG_LD_GNU],
+[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], acl_cv_prog_gnu_ld,
+[# I'd rather use --version here, but apparently some GNU ld's only accept -v.
+case `$LD -v 2>&1 </dev/null` in
+*GNU* | *'with BFD'*)
+ acl_cv_prog_gnu_ld=yes ;;
+*)
+ acl_cv_prog_gnu_ld=no ;;
+esac])
+with_gnu_ld=$acl_cv_prog_gnu_ld
+])
+
+dnl From libtool-1.4. Sets the variable LD.
+AC_DEFUN([AC_LIB_PROG_LD],
+[AC_ARG_WITH(gnu-ld,
+[ --with-gnu-ld assume the C compiler uses GNU ld [default=no]],
+test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
+AC_REQUIRE([AC_PROG_CC])dnl
+AC_REQUIRE([AC_CANONICAL_HOST])dnl
+# Prepare PATH_SEPARATOR.
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+ echo "#! /bin/sh" >conf$$.sh
+ echo "exit 0" >>conf$$.sh
+ chmod +x conf$$.sh
+ if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
+ PATH_SEPARATOR=';'
+ else
+ PATH_SEPARATOR=:
+ fi
+ rm -f conf$$.sh
+fi
+ac_prog=ld
+if test "$GCC" = yes; then
+ # Check if gcc -print-prog-name=ld gives a path.
+ AC_MSG_CHECKING([for ld used by GCC])
+ case $host in
+ *-*-mingw*)
+ # gcc leaves a trailing carriage return which upsets mingw
+ ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
+ *)
+ ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
+ esac
+ case $ac_prog in
+ # Accept absolute paths.
+ [[\\/]* | [A-Za-z]:[\\/]*)]
+ [re_direlt='/[^/][^/]*/\.\./']
+ # Canonicalize the path of ld
+ ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
+ while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
+ ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
+ done
+ test -z "$LD" && LD="$ac_prog"
+ ;;
+ "")
+ # If it fails, then pretend we aren't using GCC.
+ ac_prog=ld
+ ;;
+ *)
+ # If it is relative, then search for the first ld in PATH.
+ with_gnu_ld=unknown
+ ;;
+ esac
+elif test "$with_gnu_ld" = yes; then
+ AC_MSG_CHECKING([for GNU ld])
+else
+ AC_MSG_CHECKING([for non-GNU ld])
+fi
+AC_CACHE_VAL(acl_cv_path_LD,
+[if test -z "$LD"; then
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
+ for ac_dir in $PATH; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
+ acl_cv_path_LD="$ac_dir/$ac_prog"
+ # Check to see if the program is GNU ld. I'd rather use --version,
+ # but apparently some GNU ld's only accept -v.
+ # Break only if it was the GNU/non-GNU ld that we prefer.
+ case `"$acl_cv_path_LD" -v 2>&1 < /dev/null` in
+ *GNU* | *'with BFD'*)
+ test "$with_gnu_ld" != no && break ;;
+ *)
+ test "$with_gnu_ld" != yes && break ;;
+ esac
+ fi
+ done
+ IFS="$ac_save_ifs"
+else
+ acl_cv_path_LD="$LD" # Let the user override the test with a path.
+fi])
+LD="$acl_cv_path_LD"
+if test -n "$LD"; then
+ AC_MSG_RESULT($LD)
+else
+ AC_MSG_RESULT(no)
+fi
+test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
+AC_LIB_PROG_LD_GNU
+])
+
+# Do all the work for Automake. This macro actually does too much --
+# some checks are only needed if your package does certain things.
+# But this isn't really a big deal.
+
+# serial 1
+
+dnl Usage:
+dnl AM_INIT_AUTOMAKE(package,version, [no-define])
+
+AC_DEFUN([AM_INIT_AUTOMAKE],
+[AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
+AC_REQUIRE([AC_PROG_INSTALL])
+PACKAGE=[$1]
+AC_SUBST(PACKAGE)
+VERSION=[$2]
+AC_SUBST(VERSION)
+dnl test to see if srcdir already configured
+if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
+ AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
+fi
+ifelse([$3],,
+AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
+AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package]))
+AC_REQUIRE([AM_SANITY_CHECK])
+AC_REQUIRE([AC_ARG_PROGRAM])
+dnl FIXME This is truly gross.
+missing_dir=`cd $ac_aux_dir && pwd`
+AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}, $missing_dir)
+AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
+AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}, $missing_dir)
+AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
+AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
+AC_REQUIRE([AC_PROG_MAKE_SET])])
+
+# Copyright 2002 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# This program 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 General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+
+# AM_AUTOMAKE_VERSION(VERSION)
+# ----------------------------
+# Automake X.Y traces this macro to ensure aclocal.m4 has been
+# generated from the m4 files accompanying Automake X.Y.
+AC_DEFUN([AM_AUTOMAKE_VERSION],[am__api_version="1.4"])
+
+# AM_SET_CURRENT_AUTOMAKE_VERSION
+# -------------------------------
+# Call AM_AUTOMAKE_VERSION so it can be traced.
+# This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
+AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
+ [AM_AUTOMAKE_VERSION([1.4-p6])])
+
+#
+# Check to make sure that the build environment is sane.
+#
+
+AC_DEFUN([AM_SANITY_CHECK],
+[AC_MSG_CHECKING([whether build environment is sane])
+# Just in case
+sleep 1
+echo timestamp > conftestfile
+# Do `set' in a subshell so we don't clobber the current shell's
+# arguments. Must try -L first in case configure is actually a
+# symlink; some systems play weird games with the mod time of symlinks
+# (eg FreeBSD returns the mod time of the symlink's containing
+# directory).
+if (
+ set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
+ if test "[$]*" = "X"; then
+ # -L didn't work.
+ set X `ls -t $srcdir/configure conftestfile`
+ fi
+ if test "[$]*" != "X $srcdir/configure conftestfile" \
+ && test "[$]*" != "X conftestfile $srcdir/configure"; then
+
+ # If neither matched, then we have a broken ls. This can happen
+ # if, for instance, CONFIG_SHELL is bash and it inherits a
+ # broken ls alias from the environment. This has actually
+ # happened. Such a system could not be considered "sane".
+ AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
+alias in your environment])
+ fi
+
+ test "[$]2" = conftestfile
+ )
+then
+ # Ok.
+ :
+else
+ AC_MSG_ERROR([newly created file is older than distributed files!
+Check your system clock])
+fi
+rm -f conftest*
+AC_MSG_RESULT(yes)])
+
+dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
+dnl The program must properly implement --version.
+AC_DEFUN([AM_MISSING_PROG],
+[AC_MSG_CHECKING(for working $2)
+# Run test in a subshell; some versions of sh will print an error if
+# an executable is not found, even if stderr is redirected.
+# Redirect stdin to placate older versions of autoconf. Sigh.
+if ($2 --version) < /dev/null > /dev/null 2>&1; then
+ $1=$2
+ AC_MSG_RESULT(found)
+else
+ $1="$3/missing $2"
+ AC_MSG_RESULT(missing)
+fi
+AC_SUBST($1)])
+
0  config.guess
No changes.
0  config.sub
No changes.
4,885 configure
4,885 additions, 0 deletions not shown
47 configure.in
@@ -0,0 +1,47 @@
+dnl Process this file with autoconf to produce a configure script.
+AC_INIT(eiwic.c)
+
+PACKAGE=`cat eiwic.h | grep "#define NAME" | cut -d "\"" -f2`
+VERSION=`cat eiwic.h | grep "#define VERSION" | cut -d "\"" -f2`
+
+AC_SUBST(PACKAGE)
+AC_SUBST(VERSION)
+
+AM_INIT_AUTOMAKE($PACKAGE, $VERSION)
+
+AC_ARG_ENABLE(ipv6,
+ [ --enable-ipv6 enable IPv6 support [default: off]],
+ AC_DEFINE(IPV6))
+AC_ARG_ENABLE(vv-debug,
+ [ --enable-vv-debug enable verbose debug messages [default: off]],
+ AC_DEFINE(VV_DEBUG))
+
+dnl Checks for programs.
+AC_PROG_CC
+
+dnl Checks for libraries.
+AC_CHECK_LIB(dl, dlopen)
+
+dnl Checks for header files.
+AC_HEADER_STDC
+AC_HEADER_SYS_WAIT
+AC_CHECK_HEADERS(fcntl.h sys/ioctl.h unistd.h arpa/inet.h netdb.h netinet/in.h stdlib.h string.h sys/socket.h)
+
+dnl Checks for typedefs, structures, and compiler characteristics.
+AC_C_CONST
+AC_HEADER_TIME
+
+dnl Checks for library functions.
+AC_TYPE_SIGNAL
+AC_FUNC_VPRINTF
+AC_CHECK_FUNCS(select socket strcasecmp strncasecmp strerror strstr strtod bzero dup2 gethostbyname inet_ntoa memmove memset fork malloc)
+
+AC_CHECK_LIB(raptor, raptor_init, [rm -f modules/rssfeed.skip], [
+echo 'Note: libraptor has not been found, required by "rssfeed" module. "rssfeed" is disabled.'
+echo ' If you want to have the module, please install the raptor library and re-configure.'
+echo ' Otherwise proceed...';
+echo
+touch modules/rssfeed.skip
+], "-lxml2")
+
+AC_OUTPUT(modules/Makefile Makefile)
324 connections.c
@@ -0,0 +1,324 @@
+/******************************************************************************
+ * eiwic - Extensible Ircbot Written In C
+ * Copyright (C) Hannes Gr�uler <lordi@styleliga.org>
+ *
+ * connections.c: Functions implementations for creating TCP/IP connections,
+ * listenening sockets and HTTP interface
+ *****************************************************************************/
+
+#include <fcntl.h>
+#include <sys/types.h>
+#include <sys/ioctl.h>
+#include <sys/socket.h>
+#include <errno.h>
+
+#include "eiwic.h"
+#include "connections.h"
+#include "plugins.h"
+
+CONN* conn_connect(char *hostname, u_short port,
+ e_conn_established_f cbe,
+ e_conn_read_f cbr,
+ e_conn_write_f cbw,
+ e_conn_close_f cbc)
+{
+ CONN *epc;
+ struct sockaddr_in sin;
+ int s, flags;
+
+ epc = malloc(sizeof(CONN));
+ bzero(epc, sizeof(CONN));
+
+ epc->plugin = plugin;
+ epc->cbc = cbc;
+ epc->cbr = cbr;
+ epc->cbw = cbw;
+ epc->cbe = cbe;
+
+ if (findip(hostname, (struct in_addr *)&epc->host) == -1)
+ {
+ log(LOG_DEBUG, "Unable to resolve host %s", inet_ntoa(*(struct in_addr*)&epc->host));
+ }
+
+ epc->port = port;
+
+#ifdef VV_DEBUG
+ log(LOG_VERBOSE_DEBUG, "Attempt to create connection to %s:%i", inet_ntoa(*(struct in_addr*)&epc->host), epc->port);
+#endif
+
+ bzero(&sin, sizeof(struct sockaddr_in));
+ sin.sin_family = AF_INET;
+ sin.sin_addr.s_addr = epc->host;
+ sin.sin_port = htons(epc->port);
+
+ /* create us a socket.. */
+ s = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
+
+ /* ..and set it to non-blocking */
+ if (-1 == (flags = fcntl(s, F_GETFL, 0))) flags = 0;
+
+ if (-1 == (fcntl(s, F_SETFL, flags | O_NONBLOCK)))
+ {
+ log(LOG_ERROR, "connections.c: conn_connect: fcntl");
+ return NULL;
+ }
+
+ /* finally connect in non-blocking mode: */
+ if (connect(s, (struct sockaddr *) &sin, sizeof(struct sockaddr)) == -1)
+ {
+ if (errno != EINPROGRESS) /* Operation now in progress */
+ {
+ log(LOG_WARNING, "Connection failed to %s:%i", inet_ntoa(*(struct in_addr*)&epc->host), epc->port);
+ return NULL;
+ }
+ }
+
+ epc->sock = s;
+ epc->status = CONN_CONNECTING;
+
+ log(LOG_DEBUG, "Connecting non-blocking to %s:%i", inet_ntoa(*(struct in_addr*)&epc->host), epc->port);
+ dlist_ins_next(&e_global->connections, e_global->connections.tail, epc);
+
+ return epc;
+}
+
+CONN *conn_listen(u_short port, int backlog, e_conn_incoming_f cbi,
+ e_conn_read_f cbr,
+ e_conn_write_f cbw,
+ e_conn_close_f cbc)
+{
+ CONN *epc;
+ struct sockaddr_in sin;
+ int s, flags;
+
+ epc = malloc(sizeof(CONN));
+ bzero(epc, sizeof(CONN));
+
+ epc->plugin = plugin;
+ epc->cbi = cbi;
+ epc->cbr = cbr;
+ epc->cbw = cbw;
+ epc->cbc = cbc;
+
+ /* create us a socket.. */
+ s = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
+
+ /* ..and set it to non-blocking */
+ if (-1 == (flags = fcntl(s, F_GETFL, 0))) flags = 0;
+
+ if (-1 == (fcntl(s, F_SETFL, flags | O_NONBLOCK)))
+ {
+ log(LOG_ERROR, "connections.c: conn_listen: fcntl");
+ return NULL;
+ }
+
+ bzero(&sin, sizeof(struct sockaddr_in));
+ sin.sin_family = AF_INET;
+ sin.sin_addr.s_addr = INADDR_ANY;
+ sin.sin_port = htons(port);
+
+ if (bind(s, (struct sockaddr *)&sin, sizeof(struct sockaddr_in)) == -1)
+ {
+ log(LOG_ERROR, "connections.c: conn_listen: bind");
+ return NULL;
+ }
+
+ /* finally listen in non-blocking mode: */
+ if (listen(s, backlog) == -1)
+ {
+ if (errno != EINPROGRESS) /* Operation now in progress */
+ {
+ log(LOG_WARNING, "Unable to create listening socket");
+ return NULL;
+ }
+ }
+
+ epc->sock = s;
+ epc->status = CONN_LISTENING;
+
+ log(LOG_DEBUG, "Listening socket has been set up on port %i", port);
+ dlist_ins_next(&e_global->connections, e_global->connections.tail, epc);
+
+ return epc;
+}
+
+CONN *conn_accept(CONN *lis)
+{
+ CONN *epa;
+ struct sockaddr_in sin;
+ int s, flags, sin_len = sizeof(struct sockaddr_in);
+
+ epa = malloc(sizeof(CONN));
+ bzero(epa, sizeof(CONN));
+
+ epa->plugin = lis->plugin;
+ epa->cbr = lis->cbr;
+ epa->cbw = lis->cbw;
+ epa->cbc = lis->cbc;
+
+ /* accept incoming connection.. */
+ if (-1 == (s = accept(lis->sock, (struct sockaddr *)&sin, &sin_len)))
+ {
+ log(LOG_ERROR, "connections.c: conn_accept: accept");
+ return NULL;
+ }
+
+ /* ..and set it to non-blocking */
+ if (-1 == (flags = fcntl(s, F_GETFL, 0))) flags = 0;
+
+ if (-1 == (fcntl(s, F_SETFL, flags | O_NONBLOCK)))
+ {
+ log(LOG_ERROR, "connections.c: conn_accept: fcntl");
+ return NULL;
+ }
+
+ epa->host = sin.sin_addr.s_addr;
+ epa->sock = s;
+ epa->status = CONN_ESTABLISHED;
+
+ log(LOG_DEBUG, "Connection succesfully accepted from remote port %d", htons(sin.sin_port));
+ dlist_ins_next(&e_global->connections, e_global->connections.tail, epa);
+
+ return epa;
+}
+
+
+int conn_close(CONN *con)
+{
+ plog(con->plugin, LOG_DEBUG, "Connection closed to %s:%i", inet_ntoa(*(struct in_addr*)&con->host), con->port);
+
+ if (con->cbc)
+ {
+ e_global->jump_back = 1;
+ if (sigsetjmp(e_global->jmp_past, 1) == 0)
+ {
+ plugin = con->plugin;
+ con->cbc(con);
+ plugin = NULL;
+ }
+ else
+ {
+ e_global->jump_back = 0;
+ SEGWARN(con->plugin, "e_conn_close_f");
+ }
+ e_global->jump_back = 0;
+ }
+
+ conn_unreg(con);
+ return 1;
+}
+
+int conn_unreg(CONN *conn)
+{
+ dlist_remove(&e_global->connections, dlist_find(&e_global->connections, conn), NULL);
+ conn_destroy(conn);
+
+ return 1;
+}
+
+void conn_destroy(void *data)
+{
+ CONN *conn = data;
+
+ shutdown(conn->sock, 2);
+ close(conn->sock);
+ free(conn);
+
+}
+
+int http_on_connect(CONN *conn)
+{
+ char buf[1024];
+
+ sprintf(buf, "GET %s HTTP/1.0\r\nHost: %s:%i\r\n\r\n", ((HTTP *)conn->data)->file, ((HTTP *)conn->data)->host, ((HTTP *)conn->data)->port);
+ send(conn->sock, buf, strlen(buf), 0);
+
+ return 0;
+}
+
+int http_on_read(CONN *conn, char*buf, u_int len)
+{
+ HTTP *http;
+ int old_len;
+
+ http = conn->data;
+ old_len = http->buffer?strlen(http->buffer):0;
+
+ http->buffer = realloc(http->buffer, old_len + len + 1);
+ memcpy(http->buffer + old_len, buf, len);
+ http->buffer[old_len + len] = 0;
+ return 0;
+}
+
+int http_on_close(CONN *conn)
+{
+ HTTP *http;
+ char *code;
+
+ http = conn->data;
+
+ if (http->buffer)
+ {
+ log(LOG_DEBUG, "HTTP request (%s %s) returned %d bytes: %.14s...",
+ http->host,
+ http->file,
+ strlen(http->buffer),
+ http->buffer);
+
+
+ code = strstr(http->buffer, "\r\n\r\n");
+ if (code) {
+ *code = 0;
+ code += 4;
+ }
+ else {
+ code = http->buffer;
+ }
+
+
+ if (http->callback != NULL)
+ http->callback(code, http->data);
+
+ if (http->buffer) free(http->buffer);
+ }
+ else {
+ if (http->callback != NULL)
+ http->callback(NULL, http->data);
+ }
+ return 0;
+}
+
+CONN *conn_http_get(char *url, e_conn_http_f cb, void *data)
+{
+ char host[128];
+ char *file, *t;
+ HTTP *http;
+ CONN *c;
+
+ if (strncasecmp(url, "http://", 7) != 0)
+ return NULL;
+
+ file = strchr(url + 7, '/');
+ strncpy(host, url + 7, file - (url + 7));
+ host[file - (url + 7)] = 0;
+ if ((t = strchr(host, ':')) != NULL)
+ *t = 0;
+ c = conn_connect(host, t?atoi(t+1):80, http_on_connect, http_on_read, NULL, http_on_close);
+ if (c)
+ {
+ http = malloc(sizeof(HTTP));
+
+ c->data = http;
+ http->conn = c;
+ strcpy(http->file, file);
+ strcpy(http->host, host);
+ http->buffer = NULL;
+ http->callback = cb;
+ http->data = data;
+ http->port = t?atoi(t+1):80;
+
+ return c;
+ }
+
+ return NULL;
+}
82 connections.h
@@ -0,0 +1,82 @@
+/******************************************************************************
+ * eiwic - Extensible Ircbot Written In C
+ * Copyright (C) Hannes Gr�uler <lordi@styleliga.org>
+ *
+ * connections.h: Header file for connections.c
+ *****************************************************************************/
+
+#ifndef _CONNECTIONS_H_INCLUDED
+#define _CONNECTIONS_H_INCLUDED
+
+struct eiwic_connection;
+
+typedef int (*e_conn_established_f)(struct eiwic_connection *);
+typedef int (*e_conn_read_f)(struct eiwic_connection *, char *, u_int);
+typedef int (*e_conn_write_f)(struct eiwic_connection *);
+typedef int (*e_conn_close_f)(struct eiwic_connection *);
+typedef int (*e_conn_http_f)(char *http, void *data);
+typedef int (*e_conn_incoming_f)(struct eiwic_connection *);
+
+enum _CONN_STATUS {
+ CONN_NONE,
+ CONN_CONNECTING,
+ CONN_ESTABLISHED,
+ CONN_LISTENING
+};
+
+struct eiwic_connection {
+ u_char status;
+ int sock;
+
+ u_short port;
+ u_long host;
+
+ e_conn_established_f cbe;
+ e_conn_incoming_f cbi;
+ e_conn_read_f cbr;
+ e_conn_write_f cbw;
+ e_conn_close_f cbc;
+
+ void *data;
+
+ struct eiwic_plugin *plugin;
+};
+
+struct eiwic_http {
+ struct eiwic_connection *conn;
+
+ char file[255];
+ char host[255];
+
+ u_short port;
+
+ e_conn_http_f callback;
+ void *data;
+
+ char *buffer;
+};
+
+typedef struct eiwic_connection CONN;
+typedef struct eiwic_http HTTP;
+
+typedef CONN *(pfn_conn_http_get)(char *, e_conn_http_f, void *);
+typedef int (pfn_conn_unreg)(CONN *);
+typedef int (pfn_conn_close)(CONN *);
+typedef void (pfn_conn_destroy)(void *);
+typedef CONN *(pfn_conn_connect)(char *hostname, u_short port,
+ e_conn_established_f, e_conn_read_f, e_conn_write_f, e_conn_close_f);
+typedef CONN *(pfn_conn_listen)(u_short port, int backlog,
+ e_conn_incoming_f, e_conn_read_f, e_conn_write_f, e_conn_close_f);
+typedef CONN *(pfn_conn_accept)(CONN *listening);
+
+#ifndef EIWIC_MODULE
+pfn_conn_http_get conn_http_get;
+pfn_conn_unreg conn_unreg;
+pfn_conn_close conn_close;
+pfn_conn_destroy conn_destroy;
+pfn_conn_connect conn_connect;
+pfn_conn_listen conn_listen;
+pfn_conn_accept conn_accept;
+#endif /* EIWIC_MODULE */
+
+#endif /* _CONNECTIONS_H_INCLUDED */
12 debug.conf
@@ -0,0 +1,12 @@
+##-- Eiwic debug configuration file --
+add SERVER localhost 6667
+add CHANNEL #eiwic
+set NICK=Eiwic
+set ADMIN_MASK *!*@*
+set VHOST=192.168.200.201
+set MODULE_PATH=modules/
+load MODULE=rssfeed
+load MODULE=admin
+load MODULE=modadmin
+load MODULE=crash
+
308 dlist.c
@@ -0,0 +1,308 @@
+/*****************************************************************************
+ * Notice: *
+ * This source has been taken from : Algorithmen mit C von Kyle Loudon, *
+ * O'Reilly & Associates (ISBN: 3-89721-165-3). *
+ ****************************************************************************/
+
+/*****************************************************************************
+* *
+* ------------------------------- dlist.c -------------------------------- *
+* *
+*****************************************************************************/
+
+#include <stdlib.h>
+#include <string.h>
+
+#include "dlist.h"
+
+DListElmt *dlist_find(DList *list, const void *data) /* lordi@styleliga.org */
+{
+ DListElmt *el;
+ FOR_EACH(list, el)
+ {
+ if (el->data == data)
+ return el;
+ }
+
+ return NULL;
+}
+/*****************************************************************************
+* *
+* ------------------------------ dlist_init ------------------------------ *
+* *
+*****************************************************************************/
+
+void dlist_init(DList *list, void (*destroy)(void *data)) {
+
+/*****************************************************************************
+* *
+* Initialize the list. *
+* *
+*****************************************************************************/
+
+list->size = 0;
+list->destroy = destroy;
+list->head = NULL;
+list->tail = NULL;
+
+return;
+
+}
+
+/*****************************************************************************
+* *
+* ---------------------------- dlist_destroy ----------------------------- *
+* *
+*****************************************************************************/
+
+void dlist_destroy(DList *list) {
+
+void *data;
+
+/*****************************************************************************
+* *
+* Remove each element. *
+* *
+*****************************************************************************/
+
+while (dlist_size(list) > 0) {
+
+ if (dlist_remove(list, dlist_tail(list), (void **)&data) == 0 && list->
+ destroy != NULL) {
+
+ /***********************************************************************
+ * *
+ * Call a user-defined function to free dynamically allocated data. *
+ * *
+ ***********************************************************************/
+
+ list->destroy(data);
+
+ }
+
+}
+
+/*****************************************************************************
+* *
+* No operations are allowed now, but clear the structure as a precaution. *
+* *
+*****************************************************************************/
+
+memset(list, 0, sizeof(DList));
+
+return;
+
+}
+
+/*****************************************************************************
+* *
+* ---------------------------- dlist_ins_next ---------------------------- *
+* *
+*****************************************************************************/
+
+int dlist_ins_next(DList *list, DListElmt *element, const void *data) {
+
+DListElmt *new_element;
+
+/*****************************************************************************
+* *
+* Do not allow a NULL element unless the list is empty. *
+* *
+*****************************************************************************/
+
+if (element == NULL && dlist_size(list) != 0)
+ return -1;
+
+/*****************************************************************************
+* *
+* Allocate storage for the element. *
+* *
+*****************************************************************************/
+
+if ((new_element = (DListElmt *)malloc(sizeof(DListElmt))) == NULL)
+ return -1;
+
+/*****************************************************************************
+* *
+* Insert the new element into the list. *
+* *
+*****************************************************************************/
+
+new_element->data = (void *)data;
+
+if (dlist_size(list) == 0) {
+
+ /**************************************************************************
+ * *
+ * Handle insertion when the list is empty. *
+ * *
+ **************************************************************************/
+
+ list->head = new_element;
+ list->head->prev = NULL;
+ list->head->next = NULL;
+ list->tail = new_element;
+
+ }
+
+else {
+
+ /**************************************************************************
+ * *
+ * Handle insertion when the list is not empty. *
+ * *
+ **************************************************************************/
+
+ new_element->next = element->next;
+ new_element->prev = element;
+
+ if (element->next == NULL)
+ list->tail = new_element;
+ else
+ element->next->prev = new_element;
+
+ element->next = new_element;
+
+}
+
+/*****************************************************************************
+* *
+* Adjust the size of the list to account for the inserted element. *
+* *
+*****************************************************************************/
+
+list->size++;
+
+return 0;
+
+}
+
+/*****************************************************************************
+* *
+* ---------------------------- dlist_ins_prev ---------------------------- *
+* *
+*****************************************************************************/
+
+
+int dlist_ins_prev(DList *list, DListElmt *element, const void *data) {
+
+DListElmt *new_element;
+
+/*****************************************************************************
+* *
+* Do not allow a NULL element unless the list is empty. *
+* *
+*****************************************************************************/
+
+if (element == NULL && dlist_size(list) != 0)
+ return -1;
+
+/*****************************************************************************
+* *
+* Allocate storage to be managed by the abstract data type. *
+* *
+*****************************************************************************/
+
+if ((new_element = (DListElmt *)malloc(sizeof(DListElmt))) == NULL)
+ return -1;
+
+/*****************************************************************************
+* *
+* Insert the new element into the list. *
+* *
+*****************************************************************************/
+
+new_element->data = (void *)data;
+
+if (dlist_size(list) == 0) {
+
+ /**************************************************************************
+ * *
+ * Handle insertion when the list is empty. *
+ * *
+ **************************************************************************/
+
+ list->head = new_element;
+ list->head->prev = NULL;
+ list->head->next = NULL;
+ list->tail = new_element;
+
+ }
+
+
+else {
+
+ /**************************************************************************
+ * *
+ * Handle insertion when the list is not empty. *
+ * *
+ **************************************************************************/
+
+ new_element->next = element;
+ new_element->prev = element->prev;
+
+ if (element->prev == NULL)
+ list->head = new_element;
+ else
+ element->prev->next = new_element;
+
+ element->prev = new_element;
+
+}
+
+
+/*****************************************************************************
+* *
+* Adjust the size of the list to account for the new element. *
+* *
+*****************************************************************************/
+
+list->size++;
+
+return 0;
+
+}
+
+/*****************************************************************************
+* *
+* ----------------------------- dlist_remove ----------------------------- *
+* *
+*****************************************************************************/
+
+int dlist_remove(DList *list, DListElmt *element, void **data) {
+
+if (element == NULL || dlist_size(list) == 0)
+ return -1;
+
+if (data)
+ *data = element->data;
+
+if (element == list->head) {
+
+ list->head = element->next;
+
+ if (list->head == NULL)
+ list->tail = NULL;
+ else
+ element->next->prev = NULL;
+
+ }
+
+else {
+
+ element->prev->next = element->next;
+
+ if (element->next == NULL)
+ list->tail = element->prev;
+ else
+ element->next->prev = element->prev;
+
+}
+
+free(element);
+
+list->size--;
+
+return 0;
+
+}
51 dlist.h
@@ -0,0 +1,51 @@
+/*****************************************************************************
+ * Notice: *
+ * This source has been taken from : Algorithmen mit C von Kyle Loudon, *
+ * O'Reilly & Associates (ISBN: 3-89721-165-3). *
+ ****************************************************************************/
+
+#ifndef DLIST_H
+#define DLIST_H
+
+#include <stdlib.h>
+
+typedef struct DListElmt_ {
+ void *data;
+ struct DListElmt_ *prev;
+ struct DListElmt_ *next;
+} DListElmt;
+
+typedef struct DList_ {
+ int size;
+ int (*match)(const void *key1, const void *key2);
+ void (*destroy)(void *data);
+ DListElmt *head;
+ DListElmt *tail;
+} DList;
+
+DListElmt *dlist_find(DList *list, const void *data); /* lordi@styleliga.org */
+void dlist_init(DList *list, void (*destroy)(void *data));
+void dlist_destroy(DList *list);
+int dlist_ins_next(DList *list, DListElmt *element, const void *data);
+int dlist_ins_prev(DList *list, DListElmt *element, const void *data);
+int dlist_remove(DList *list, DListElmt *element, void **data);
+#define dlist_remove_and_destroy(list, data)\
+{ void *data2;\
+ dlist_remove((list), dlist_find((list), (data)), &data2);\
+ (*(list)).destroy(data2);\
+ }
+
+#define dlist_size(list) ((list)->size)
+#define dlist_head(list) ((list)->head)
+#define dlist_tail(list) ((list)->tail)
+#define dlist_is_head(element) ((element)->prev == NULL ? 1 : 0)
+#define dlist_is_tail(element) ((element)->next == NULL ? 1 : 0)
+#define dlist_data(element) ((element)->data)
+#define dlist_next(element) ((element)->next)
+#define dlist_prev(element) ((element)->prev)
+
+#define FOR_EACH(list, element) for((element) = (list)->head; (element) && (element)->data; (element) = (element)->next)
+#define FOR_EACH_DATA(list, obj) { DListElmt* element; FOR_EACH(list, element) { (obj)=(element)->data;
+#define END_DATA } }
+
+#endif
123 doc/doc.html
@@ -0,0 +1,123 @@
+<html>
+<head>
+<title>Eiwic help file</title>
+</head>
+<body>
+<h1>A quick'n dirty help file</h1>
+<img src="eiwic.png">
+<br>
+<font size=+2><u>If eiwic is online, try !help.</u></font>
+<br>
+<br>
+
+<h3>Compiling eiwic</h3>
+<p>
+Ehrm...
+<pre>
+./configure
+make
+</pre>
+</p>
+
+<h3>Configuring eiwic</h3>
+<p>
+Edit the .conf file.
+</p>
+
+<h3>Running eiwic</h3>
+<p>
+See <code>./eiwic -h</code> please.
+</p>
+
+<h3>Debugging eiwic</h3>
+<p>
+<pre>
+./configure --enable-vv-debug
+make clean
+make
+./eiwic -l - -v 10 debug.conf
+</pre>
+<br>
+<br>
+to debug modules you can use the -t switch: e.g. -t '!dict sleep'
+</p>
+
+<h3>Own modules</h3>
+<p>
+Every single .c file which is in modules/ will be compiled to as .so library. Every .so library in the
+modules/ directory can be loaded as a module. If you want to write your own module, copy "template.c"
+to "yourmodule.c" and modify it. To compile it, just type "make" in the eiwic directory.<br>
+<br>
+<code>EP_SETNAME()</code> is a macro which sets the module name. The parameter should be the same as the
+file name. This must exist in the module source file.<br><br>
+<code>int ep_init(OUTPUT *out)</code> is the init function. It doesn't have to exist. If it does exist, however,
+you must return 1 in case of successful initialization, and 0 if it failed (it will be unloaded then). Print out status
+or error messages to <code>out</code> (see <i>Module API</i>). Most likely you will register your trigger here.<br><br>
+<code>int ep_parse(MSG *msg)</code> is a function that will be called after a line from the server
+has been parsed. In the MSG struct you can find the Message from the IRC server parsed (see <i>Eiwic structs</i