Autotoolified
authorChristian Thaeter <ct@pipapo.org>
Mon, 8 Oct 2007 18:46:35 +0000 (20:46 +0200)
committerChristian Thaeter <ct@pipapo.org>
Mon, 8 Oct 2007 18:46:35 +0000 (20:46 +0200)
.gitignore
Makefile.am [new file with mode: 0644]
configure.ac [new file with mode: 0644]
src/llist.h [moved from llist.h with 100% similarity]
src/main.c [moved from main.c with 94% similarity]
src/psplay.c [moved from psplay.c with 100% similarity]
src/psplay.h [moved from psplay.h with 100% similarity]
src/rxpd.c [moved from rxpd.c with 99% similarity]
src/rxpd.h [moved from rxpd.h with 99% similarity]

index b25c15b..3e7c318 100644 (file)
@@ -1 +1,9 @@
 *~
+aclocal.m4
+autom4te.cache
+build
+configure
+depcomp
+install-sh
+missing
+Makefile.in
diff --git a/Makefile.am b/Makefile.am
new file mode 100644 (file)
index 0000000..be5515a
--- /dev/null
@@ -0,0 +1,34 @@
+#  Copyright (C)
+#    2007,               Christian Thaeter <ct@pipapo.org>
+#
+#  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.
+
+AUTOMAKE_OPTIONS=foreign
+
+rxpd_srcdir = $(top_srcdir)/src
+
+bin_PROGRAMS = rxpd
+
+rxpd_CFLAGS = $(CFLAGS) -std=gnu99 -Wall -Wextra
+rxpd_LDADD = -levent
+
+rxpd_SOURCES =                         \
+       $(rxpd_srcdir)/main.c   \
+       $(rxpd_srcdir)/psplay.c \
+       $(rxpd_srcdir)/rxpd.c   \
+       $(rxpd_srcdir)/llist.h  \
+       $(rxpd_srcdir)/psplay.h \
+       $(rxpd_srcdir)/rxpd.h
+
diff --git a/configure.ac b/configure.ac
new file mode 100644 (file)
index 0000000..4c3b4d9
--- /dev/null
@@ -0,0 +1,40 @@
+AC_INIT(rxpd, 0.1pre)
+AC_CONFIG_SRCDIR(src/rxpd.c)
+AM_INIT_AUTOMAKE
+AC_PREREQ(2.59)
+
+AC_COPYRIGHT([
+  Copyright (C)
+    2007,               Christian Thaeter <ct@pipapo.org>
+
+  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.
+])
+
+#
+# Required programs
+#
+AC_PROG_CC
+AC_PROG_CPP
+
+#
+# test for headers
+#
+AC_STDC_HEADERS
+
+AH_TEMPLATE(HAVE_EVENT_H, [check for libevent])
+AC_CHECK_HEADER([event.h], AC_DEFINE(HAVE_EVENT_H))
+
+AC_CONFIG_FILES(Makefile)
+AC_OUTPUT
similarity index 100%
rename from llist.h
rename to src/llist.h
similarity index 94%
rename from main.c
rename to src/main.c
index 8bc2076..1c7943b 100644 (file)
--- a/main.c
@@ -19,7 +19,7 @@
   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 */
 
-#include "rxpd.c"
+#include "rxpd.h"
 
 #include <string.h>
 #include <sys/time.h>
@@ -68,6 +68,9 @@ main (int argc, char** argv)
   struct rxpd_file* file = rxpd_file_new (rxpd, "test");
   rxpd_file_load (file);
 
+  struct rxpd_file* file2 = rxpd_file_new (rxpd, "test2");
+  rxpd_file_load (file2);
+
   // initialize listening connections
   // port 2374
   rxpd_socket_schedule (rxpd_socket_new_tcp4 (rxpd, NULL, 2374));
similarity index 100%
rename from psplay.c
rename to src/psplay.c
similarity index 100%
rename from psplay.h
rename to src/psplay.h
similarity index 99%
rename from rxpd.c
rename to src/rxpd.c
index 183aa1b..d22ae03 100644 (file)
--- a/rxpd.c
@@ -183,7 +183,7 @@ rxpd_file_load (struct rxpd_file* self)
           struct rxpd_rule* node = (struct rxpd_rule*)n;
           rxpd_rule_delete (node);
         }
-      
+
       // TODO test excess line length = error
       char buf[4096];
 
similarity index 99%
rename from rxpd.h
rename to src/rxpd.h
index d3e841c..3da0383 100644 (file)
--- a/rxpd.h
@@ -58,7 +58,7 @@ enum rxpd_cmd_e {RXPD_COMMANDS};
  * characters which are absolutely not allowed in rule filenames
  * for finer control use policies
  */
-#define RXPD_FILE_ILG_CHARS "/: \t\n"
+#define RXPD_FILE_ILG_CHARS "/: \t\n*?"
 
 struct rxpd_base;
 struct rxpd_file;