- Move malloc.c to memory.c
authormichael <michael@82007160-df01-0410-b94d-b575c5fd34c7>
Thu, 8 Jan 2015 12:46:36 +0000 (12:46 +0000)
committermichael <michael@82007160-df01-0410-b94d-b575c5fd34c7>
Thu, 8 Jan 2015 12:46:36 +0000 (12:46 +0000)
- Generate parser/lexer files before actually compiling anything else that uses them
- Fix up header inclusion mess

git-svn-id: svn://svn.ircd-hybrid.org/svnroot/hopm/branches/1.0.x@5336 82007160-df01-0410-b94d-b575c5fd34c7

19 files changed:
configure
src/Makefile.am
src/Makefile.in
src/config-parser.c
src/config-parser.h
src/config-parser.y
src/config.c
src/dnsbl.c
src/firedns.c
src/irc.c
src/list.c
src/main.c
src/malloc.c [deleted file]
src/malloc.h [deleted file]
src/memory.c [new file with mode: 0644]
src/memory.h [new file with mode: 0644]
src/negcache.c
src/opercmd.c
src/scan.c

index 3e5b5c2103cd48d238400d772ead2937a73e3df7..a5b25acdba42a8afd67647ae44209619e4a999e3 100755 (executable)
--- a/configure
+++ b/configure
@@ -1,5 +1,5 @@
 #! /bin/sh
-# From configure.ac Id: configure.ac 4980 2014-12-05 14:30:16Z michael .
+# From configure.ac Id: configure.ac 5313 2015-01-06 13:27:21Z michael .
 # Guess values for system-dependent variables and create Makefiles.
 # Generated by GNU Autoconf 2.69 for hopm 1.0.1.
 #
index b2492dc2cde2b2a5d6a6ecb924ad2e09246c917e..e43669c3ddc09c03bbea6759cde89bac4e300b6c 100644 (file)
@@ -6,10 +6,10 @@ AM_YFLAGS = -d
 
 hopm_SOURCES = compat.c        \
                compat.h        \
-               config.c        \
-               config.h        \
                config-parser.y \
                config-lexer.l  \
+               config.c        \
+               config.h        \
                dnsbl.c         \
                dnsbl.h         \
                extern.h        \
@@ -23,8 +23,8 @@ hopm_SOURCES = compat.c        \
                log.h           \
                main.c          \
                main.h          \
-               malloc.c        \
-               malloc.h        \
+               memory.c        \
+               memory.h        \
                match.c         \
                match.h         \
                misc.c          \
index 9794ed77b9ffe6072eb4f4c92c118bd91720cc70..f571f64ee6aaf78175820b8a7c2b8b57b5593041 100644 (file)
@@ -94,10 +94,10 @@ CONFIG_CLEAN_FILES =
 CONFIG_CLEAN_VPATH_FILES =
 am__installdirs = "$(DESTDIR)$(bindir)"
 PROGRAMS = $(bin_PROGRAMS)
-am_hopm_OBJECTS = compat.$(OBJEXT) config.$(OBJEXT) \
-       config-parser.$(OBJEXT) config-lexer.$(OBJEXT) dnsbl.$(OBJEXT) \
+am_hopm_OBJECTS = compat.$(OBJEXT) config-parser.$(OBJEXT) \
+       config-lexer.$(OBJEXT) config.$(OBJEXT) dnsbl.$(OBJEXT) \
        firedns.$(OBJEXT) irc.$(OBJEXT) list.$(OBJEXT) log.$(OBJEXT) \
-       main.$(OBJEXT) malloc.$(OBJEXT) match.$(OBJEXT) misc.$(OBJEXT) \
+       main.$(OBJEXT) memory.$(OBJEXT) match.$(OBJEXT) misc.$(OBJEXT) \
        negcache.$(OBJEXT) opercmd.$(OBJEXT) scan.$(OBJEXT) \
        stats.$(OBJEXT)
 hopm_OBJECTS = $(am_hopm_OBJECTS)
@@ -354,10 +354,10 @@ AM_CPPFLAGS = -DHOPM_ETCDIR="\"$(sysconfdir)\"" -DHOPM_LOGDIR="\"$(localstatedir
 AM_YFLAGS = -d
 hopm_SOURCES = compat.c        \
                compat.h        \
-               config.c        \
-               config.h        \
                config-parser.y \
                config-lexer.l  \
+               config.c        \
+               config.h        \
                dnsbl.c         \
                dnsbl.h         \
                extern.h        \
@@ -371,8 +371,8 @@ hopm_SOURCES = compat.c        \
                log.h           \
                main.c          \
                main.h          \
-               malloc.c        \
-               malloc.h        \
+               memory.c        \
+               memory.h        \
                match.c         \
                match.h         \
                misc.c          \
@@ -512,8 +512,8 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/list.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/log.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/main.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/malloc.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/match.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/memory.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/misc.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/negcache.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/opercmd.Po@am__quote@
index 7fe45da3680d3ee37042659ddf63f213d38d6c53..ea928be785d50fe8d5e651e033c7a8fa70d4431e 100644 (file)
@@ -66,7 +66,8 @@
 
 #include <stdio.h>
 #include <string.h>
-#include "malloc.h"
+
+#include "memory.h"
 #include "config.h"
 
 int yylex(void);
@@ -75,7 +76,7 @@ int yydebug=0;
 void *tmp;        /* Variable to temporarily hold nodes before insertion to list */
 
 
-#line 79 "config-parser.c" /* yacc.c:339  */
+#line 80 "config-parser.c" /* yacc.c:339  */
 
 # ifndef YY_NULLPTR
 #  if defined __cplusplus && 201103L <= __cplusplus
@@ -235,12 +236,12 @@ extern int yydebug;
 typedef union YYSTYPE YYSTYPE;
 union YYSTYPE
 {
-#line 87 "config-parser.y" /* yacc.c:355  */
+#line 88 "config-parser.y" /* yacc.c:355  */
 
         int number;
         char *string;
 
-#line 244 "config-parser.c" /* yacc.c:355  */
+#line 245 "config-parser.c" /* yacc.c:355  */
 };
 # define YYSTYPE_IS_TRIVIAL 1
 # define YYSTYPE_IS_DECLARED 1
@@ -255,7 +256,7 @@ int yyparse (void);
 
 /* Copy the second part of user declarations.  */
 
-#line 259 "config-parser.c" /* yacc.c:358  */
+#line 260 "config-parser.c" /* yacc.c:358  */
 
 #ifdef short
 # undef short
@@ -558,22 +559,22 @@ static const yytype_uint8 yytranslate[] =
   /* YYRLINE[YYN] -- Source line where rule number YYN was defined.  */
 static const yytype_uint16 yyrline[] =
 {
-       0,   102,   102,   103,   106,   107,   108,   109,   110,   111,
-     113,   113,   114,   115,   116,   117,   118,   119,   120,   121,
-     124,   124,   125,   126,   127,   128,   133,   135,   136,   138,
-     139,   140,   141,   142,   143,   145,   150,   155,   161,   166,
-     174,   176,   177,   179,   180,   181,   182,   183,   184,   185,
-     186,   187,   188,   189,   190,   191,   192,   193,   194,   195,
-     197,   203,   209,   215,   221,   227,   233,   239,   247,   252,
-     257,   263,   269,   275,   281,   291,   291,   308,   309,   311,
-     312,   313,   315,   323,   331,   342,   342,   358,   359,   361,
-     362,   363,   365,   375,   388,   388,   433,   434,   436,   437,
-     438,   439,   440,   441,   442,   443,   444,   445,   447,   454,
-     461,   468,   484,   490,   496,   502,   508,   527,   529,   530,
-     532,   533,   534,   535,   536,   538,   544,   550,   559,   559,
-     578,   579,   581,   582,   583,   584,   585,   586,   588,   595,
-     602,   613,   619,   621,   622,   624,   642,   644,   645,   647,
-     648,   650
+       0,   103,   103,   104,   107,   108,   109,   110,   111,   112,
+     114,   114,   115,   116,   117,   118,   119,   120,   121,   122,
+     125,   125,   126,   127,   128,   129,   134,   136,   137,   139,
+     140,   141,   142,   143,   144,   146,   151,   156,   162,   167,
+     175,   177,   178,   180,   181,   182,   183,   184,   185,   186,
+     187,   188,   189,   190,   191,   192,   193,   194,   195,   196,
+     198,   204,   210,   216,   222,   228,   234,   240,   248,   253,
+     258,   264,   270,   276,   282,   292,   292,   309,   310,   312,
+     313,   314,   316,   324,   332,   343,   343,   359,   360,   362,
+     363,   364,   366,   376,   389,   389,   434,   435,   437,   438,
+     439,   440,   441,   442,   443,   444,   445,   446,   448,   455,
+     462,   469,   485,   491,   497,   503,   509,   528,   530,   531,
+     533,   534,   535,   536,   537,   539,   545,   551,   560,   560,
+     579,   580,   582,   583,   584,   585,   586,   587,   589,   596,
+     603,   614,   620,   622,   623,   625,   643,   645,   646,   648,
+     649,   651
 };
 #endif
 
@@ -1575,268 +1576,268 @@ yyreduce:
   switch (yyn)
     {
         case 10:
-#line 113 "config-parser.y" /* yacc.c:1646  */
+#line 114 "config-parser.y" /* yacc.c:1646  */
     { (yyval.number) = 0; }
-#line 1581 "config-parser.c" /* yacc.c:1646  */
+#line 1582 "config-parser.c" /* yacc.c:1646  */
     break;
 
   case 12:
-#line 114 "config-parser.y" /* yacc.c:1646  */
+#line 115 "config-parser.y" /* yacc.c:1646  */
     { (yyval.number) = (yyvsp[-1].number) + (yyvsp[0].number); }
-#line 1587 "config-parser.c" /* yacc.c:1646  */
+#line 1588 "config-parser.c" /* yacc.c:1646  */
     break;
 
   case 13:
-#line 115 "config-parser.y" /* yacc.c:1646  */
+#line 116 "config-parser.y" /* yacc.c:1646  */
     { (yyval.number) = (yyvsp[-2].number) + (yyvsp[0].number); }
-#line 1593 "config-parser.c" /* yacc.c:1646  */
+#line 1594 "config-parser.c" /* yacc.c:1646  */
     break;
 
   case 14:
-#line 116 "config-parser.y" /* yacc.c:1646  */
+#line 117 "config-parser.y" /* yacc.c:1646  */
     { (yyval.number) = (yyvsp[-2].number) * 60 + (yyvsp[0].number); }
-#line 1599 "config-parser.c" /* yacc.c:1646  */
+#line 1600 "config-parser.c" /* yacc.c:1646  */
     break;
 
   case 15:
-#line 117 "config-parser.y" /* yacc.c:1646  */
+#line 118 "config-parser.y" /* yacc.c:1646  */
     { (yyval.number) = (yyvsp[-2].number) * 60 * 60 + (yyvsp[0].number); }
-#line 1605 "config-parser.c" /* yacc.c:1646  */
+#line 1606 "config-parser.c" /* yacc.c:1646  */
     break;
 
   case 16:
-#line 118 "config-parser.y" /* yacc.c:1646  */
+#line 119 "config-parser.y" /* yacc.c:1646  */
     { (yyval.number) = (yyvsp[-2].number) * 60 * 60 * 24 + (yyvsp[0].number); }
-#line 1611 "config-parser.c" /* yacc.c:1646  */
+#line 1612 "config-parser.c" /* yacc.c:1646  */
     break;
 
   case 17:
-#line 119 "config-parser.y" /* yacc.c:1646  */
+#line 120 "config-parser.y" /* yacc.c:1646  */
     { (yyval.number) = (yyvsp[-2].number) * 60 * 60 * 24 * 7 + (yyvsp[0].number); }
-#line 1617 "config-parser.c" /* yacc.c:1646  */
+#line 1618 "config-parser.c" /* yacc.c:1646  */
     break;
 
   case 18:
-#line 120 "config-parser.y" /* yacc.c:1646  */
+#line 121 "config-parser.y" /* yacc.c:1646  */
     { (yyval.number) = (yyvsp[-2].number) * 60 * 60 * 24 * 7 * 4 + (yyvsp[0].number); }
-#line 1623 "config-parser.c" /* yacc.c:1646  */
+#line 1624 "config-parser.c" /* yacc.c:1646  */
     break;
 
   case 19:
-#line 121 "config-parser.y" /* yacc.c:1646  */
+#line 122 "config-parser.y" /* yacc.c:1646  */
     { (yyval.number) = (yyvsp[-2].number) * 60 * 60 * 24 * 365 + (yyvsp[0].number); }
-#line 1629 "config-parser.c" /* yacc.c:1646  */
+#line 1630 "config-parser.c" /* yacc.c:1646  */
     break;
 
   case 20:
-#line 124 "config-parser.y" /* yacc.c:1646  */
+#line 125 "config-parser.y" /* yacc.c:1646  */
     { (yyval.number) = 0; }
-#line 1635 "config-parser.c" /* yacc.c:1646  */
+#line 1636 "config-parser.c" /* yacc.c:1646  */
     break;
 
   case 22:
-#line 125 "config-parser.y" /* yacc.c:1646  */
+#line 126 "config-parser.y" /* yacc.c:1646  */
     { (yyval.number) = (yyvsp[-1].number) + (yyvsp[0].number); }
-#line 1641 "config-parser.c" /* yacc.c:1646  */
+#line 1642 "config-parser.c" /* yacc.c:1646  */
     break;
 
   case 23:
-#line 126 "config-parser.y" /* yacc.c:1646  */
+#line 127 "config-parser.y" /* yacc.c:1646  */
     { (yyval.number) = (yyvsp[-2].number) + (yyvsp[0].number); }
-#line 1647 "config-parser.c" /* yacc.c:1646  */
+#line 1648 "config-parser.c" /* yacc.c:1646  */
     break;
 
   case 24:
-#line 127 "config-parser.y" /* yacc.c:1646  */
+#line 128 "config-parser.y" /* yacc.c:1646  */
     { (yyval.number) = (yyvsp[-2].number) * 1024 + (yyvsp[0].number); }
-#line 1653 "config-parser.c" /* yacc.c:1646  */
+#line 1654 "config-parser.c" /* yacc.c:1646  */
     break;
 
   case 25:
-#line 128 "config-parser.y" /* yacc.c:1646  */
+#line 129 "config-parser.y" /* yacc.c:1646  */
     { (yyval.number) = (yyvsp[-2].number) * 1024 * 1024 + (yyvsp[0].number); }
-#line 1659 "config-parser.c" /* yacc.c:1646  */
+#line 1660 "config-parser.c" /* yacc.c:1646  */
     break;
 
   case 35:
-#line 146 "config-parser.y" /* yacc.c:1646  */
+#line 147 "config-parser.y" /* yacc.c:1646  */
     {
    OptionsItem->negcache = (yyvsp[-1].number);
 }
-#line 1667 "config-parser.c" /* yacc.c:1646  */
+#line 1668 "config-parser.c" /* yacc.c:1646  */
     break;
 
   case 36:
-#line 151 "config-parser.y" /* yacc.c:1646  */
+#line 152 "config-parser.y" /* yacc.c:1646  */
     {
    OptionsItem->negcache_rebuild = (yyvsp[-1].number);
 }
-#line 1675 "config-parser.c" /* yacc.c:1646  */
+#line 1676 "config-parser.c" /* yacc.c:1646  */
     break;
 
   case 37:
-#line 156 "config-parser.y" /* yacc.c:1646  */
+#line 157 "config-parser.y" /* yacc.c:1646  */
     {
    MyFree(OptionsItem->pidfile);
    OptionsItem->pidfile = xstrdup((yyvsp[-1].string));
 }
-#line 1684 "config-parser.c" /* yacc.c:1646  */
+#line 1685 "config-parser.c" /* yacc.c:1646  */
     break;
 
   case 38:
-#line 162 "config-parser.y" /* yacc.c:1646  */
+#line 163 "config-parser.y" /* yacc.c:1646  */
     {
    OptionsItem->dns_fdlimit = (yyvsp[-1].number);
 }
-#line 1692 "config-parser.c" /* yacc.c:1646  */
+#line 1693 "config-parser.c" /* yacc.c:1646  */
     break;
 
   case 39:
-#line 167 "config-parser.y" /* yacc.c:1646  */
+#line 168 "config-parser.y" /* yacc.c:1646  */
     {
    MyFree(OptionsItem->scanlog);
    OptionsItem->scanlog = xstrdup((yyvsp[-1].string));
 }
-#line 1701 "config-parser.c" /* yacc.c:1646  */
+#line 1702 "config-parser.c" /* yacc.c:1646  */
     break;
 
   case 60:
-#line 198 "config-parser.y" /* yacc.c:1646  */
+#line 199 "config-parser.y" /* yacc.c:1646  */
     {
    MyFree(IRCItem->away);
    IRCItem->away = xstrdup((yyvsp[-1].string));
 }
-#line 1710 "config-parser.c" /* yacc.c:1646  */
+#line 1711 "config-parser.c" /* yacc.c:1646  */
     break;
 
   case 61:
-#line 204 "config-parser.y" /* yacc.c:1646  */
+#line 205 "config-parser.y" /* yacc.c:1646  */
     {
    MyFree(IRCItem->kline);
    IRCItem->kline = xstrdup((yyvsp[-1].string));
 }
-#line 1719 "config-parser.c" /* yacc.c:1646  */
+#line 1720 "config-parser.c" /* yacc.c:1646  */
     break;
 
   case 62:
-#line 210 "config-parser.y" /* yacc.c:1646  */
+#line 211 "config-parser.y" /* yacc.c:1646  */
     {
    MyFree(IRCItem->mode);
    IRCItem->mode = xstrdup((yyvsp[-1].string));
 }
-#line 1728 "config-parser.c" /* yacc.c:1646  */
+#line 1729 "config-parser.c" /* yacc.c:1646  */
     break;
 
   case 63:
-#line 216 "config-parser.y" /* yacc.c:1646  */
+#line 217 "config-parser.y" /* yacc.c:1646  */
     {
    MyFree(IRCItem->nick);
    IRCItem->nick = xstrdup((yyvsp[-1].string));
 }
-#line 1737 "config-parser.c" /* yacc.c:1646  */
+#line 1738 "config-parser.c" /* yacc.c:1646  */
     break;
 
   case 64:
-#line 222 "config-parser.y" /* yacc.c:1646  */
+#line 223 "config-parser.y" /* yacc.c:1646  */
     {
    MyFree(IRCItem->nickserv);
    IRCItem->nickserv = xstrdup((yyvsp[-1].string));
 }
-#line 1746 "config-parser.c" /* yacc.c:1646  */
+#line 1747 "config-parser.c" /* yacc.c:1646  */
     break;
 
   case 65:
-#line 228 "config-parser.y" /* yacc.c:1646  */
+#line 229 "config-parser.y" /* yacc.c:1646  */
     {
    MyFree(IRCItem->oper);
    IRCItem->oper = xstrdup((yyvsp[-1].string));
 }
-#line 1755 "config-parser.c" /* yacc.c:1646  */
+#line 1756 "config-parser.c" /* yacc.c:1646  */
     break;
 
   case 66:
-#line 234 "config-parser.y" /* yacc.c:1646  */
+#line 235 "config-parser.y" /* yacc.c:1646  */
     {
    MyFree(IRCItem->password);
    IRCItem->password = xstrdup((yyvsp[-1].string));
 }
-#line 1764 "config-parser.c" /* yacc.c:1646  */
+#line 1765 "config-parser.c" /* yacc.c:1646  */
     break;
 
   case 67:
-#line 240 "config-parser.y" /* yacc.c:1646  */
+#line 241 "config-parser.y" /* yacc.c:1646  */
     {
    node_t *node;
    node = node_create(xstrdup((yyvsp[-1].string)));
 
    list_add(IRCItem->performs, node);
 }
-#line 1775 "config-parser.c" /* yacc.c:1646  */
+#line 1776 "config-parser.c" /* yacc.c:1646  */
     break;
 
   case 68:
-#line 248 "config-parser.y" /* yacc.c:1646  */
+#line 249 "config-parser.y" /* yacc.c:1646  */
     {
    IRCItem->port = (yyvsp[-1].number);
 }
-#line 1783 "config-parser.c" /* yacc.c:1646  */
+#line 1784 "config-parser.c" /* yacc.c:1646  */
     break;
 
   case 69:
-#line 253 "config-parser.y" /* yacc.c:1646  */
+#line 254 "config-parser.y" /* yacc.c:1646  */
     {
    IRCItem->readtimeout = (yyvsp[-1].number);
 }
-#line 1791 "config-parser.c" /* yacc.c:1646  */
+#line 1792 "config-parser.c" /* yacc.c:1646  */
     break;
 
   case 70:
-#line 258 "config-parser.y" /* yacc.c:1646  */
+#line 259 "config-parser.y" /* yacc.c:1646  */
     {
    MyFree(IRCItem->realname);
    IRCItem->realname = xstrdup((yyvsp[-1].string));
 }
-#line 1800 "config-parser.c" /* yacc.c:1646  */
+#line 1801 "config-parser.c" /* yacc.c:1646  */
     break;
 
   case 71:
-#line 264 "config-parser.y" /* yacc.c:1646  */
+#line 265 "config-parser.y" /* yacc.c:1646  */
     {
    MyFree(IRCItem->server);
    IRCItem->server = xstrdup((yyvsp[-1].string));
 }
-#line 1809 "config-parser.c" /* yacc.c:1646  */
+#line 1810 "config-parser.c" /* yacc.c:1646  */
     break;
 
   case 72:
-#line 270 "config-parser.y" /* yacc.c:1646  */
+#line 271 "config-parser.y" /* yacc.c:1646  */
     {
    MyFree(IRCItem->username);
    IRCItem->username = xstrdup((yyvsp[-1].string));
 }
-#line 1818 "config-parser.c" /* yacc.c:1646  */
+#line 1819 "config-parser.c" /* yacc.c:1646  */
     break;
 
   case 73:
-#line 276 "config-parser.y" /* yacc.c:1646  */
+#line 277 "config-parser.y" /* yacc.c:1646  */
     {
    MyFree(IRCItem->vhost);
    IRCItem->vhost = xstrdup((yyvsp[-1].string));
 }
-#line 1827 "config-parser.c" /* yacc.c:1646  */
+#line 1828 "config-parser.c" /* yacc.c:1646  */
     break;
 
   case 74:
-#line 282 "config-parser.y" /* yacc.c:1646  */
+#line 283 "config-parser.y" /* yacc.c:1646  */
     {
    MyFree(IRCItem->connregex);
    IRCItem->connregex = xstrdup((yyvsp[-1].string));
 }
-#line 1836 "config-parser.c" /* yacc.c:1646  */
+#line 1837 "config-parser.c" /* yacc.c:1646  */
     break;
 
   case 75:
-#line 291 "config-parser.y" /* yacc.c:1646  */
+#line 292 "config-parser.y" /* yacc.c:1646  */
     {
    node_t *node;
    struct ChannelConf *item;
@@ -1852,44 +1853,44 @@ yyreduce:
 
    tmp = item;
 }
-#line 1856 "config-parser.c" /* yacc.c:1646  */
+#line 1857 "config-parser.c" /* yacc.c:1646  */
     break;
 
   case 82:
-#line 316 "config-parser.y" /* yacc.c:1646  */
+#line 317 "config-parser.y" /* yacc.c:1646  */
     {
    struct ChannelConf *item = tmp;
 
    MyFree(item->name);
    item->name = xstrdup((yyvsp[-1].string));
 }
-#line 1867 "config-parser.c" /* yacc.c:1646  */
+#line 1868 "config-parser.c" /* yacc.c:1646  */
     break;
 
   case 83:
-#line 324 "config-parser.y" /* yacc.c:1646  */
+#line 325 "config-parser.y" /* yacc.c:1646  */
     {
    struct ChannelConf *item = tmp;
 
    MyFree(item->key);
    item->key = xstrdup((yyvsp[-1].string));
 }
-#line 1878 "config-parser.c" /* yacc.c:1646  */
+#line 1879 "config-parser.c" /* yacc.c:1646  */
     break;
 
   case 84:
-#line 332 "config-parser.y" /* yacc.c:1646  */
+#line 333 "config-parser.y" /* yacc.c:1646  */
     {
    struct ChannelConf *item = tmp;
 
    MyFree(item->invite);
    item->invite = xstrdup((yyvsp[-1].string));
 }
-#line 1889 "config-parser.c" /* yacc.c:1646  */
+#line 1890 "config-parser.c" /* yacc.c:1646  */
     break;
 
   case 85:
-#line 342 "config-parser.y" /* yacc.c:1646  */
+#line 343 "config-parser.y" /* yacc.c:1646  */
     {
    node_t *node;
    struct UserConf *item;
@@ -1904,11 +1905,11 @@ yyreduce:
 
    tmp = item; 
 }
-#line 1908 "config-parser.c" /* yacc.c:1646  */
+#line 1909 "config-parser.c" /* yacc.c:1646  */
     break;
 
   case 92:
-#line 366 "config-parser.y" /* yacc.c:1646  */
+#line 367 "config-parser.y" /* yacc.c:1646  */
     {
    struct UserConf *item = tmp;
    node_t *node;
@@ -1917,11 +1918,11 @@ yyreduce:
 
    list_add(item->masks, node);
 }
-#line 1921 "config-parser.c" /* yacc.c:1646  */
+#line 1922 "config-parser.c" /* yacc.c:1646  */
     break;
 
   case 93:
-#line 376 "config-parser.y" /* yacc.c:1646  */
+#line 377 "config-parser.y" /* yacc.c:1646  */
     {
    struct UserConf *item = tmp;
    node_t *node;
@@ -1930,11 +1931,11 @@ yyreduce:
 
    list_add(item->scanners, node);
 }
-#line 1934 "config-parser.c" /* yacc.c:1646  */
+#line 1935 "config-parser.c" /* yacc.c:1646  */
     break;
 
   case 94:
-#line 388 "config-parser.y" /* yacc.c:1646  */
+#line 389 "config-parser.y" /* yacc.c:1646  */
     {
    node_t *node;
    struct ScannerConf *item, *olditem;
@@ -1978,41 +1979,41 @@ yyreduce:
    list_add(ScannerItemList, node);
    tmp = item;
 }
-#line 1982 "config-parser.c" /* yacc.c:1646  */
+#line 1983 "config-parser.c" /* yacc.c:1646  */
     break;
 
   case 108:
-#line 448 "config-parser.y" /* yacc.c:1646  */
+#line 449 "config-parser.y" /* yacc.c:1646  */
     {
    struct ScannerConf *item = tmp;
    MyFree(item->name);
    item->name = xstrdup((yyvsp[-1].string));
 }
-#line 1992 "config-parser.c" /* yacc.c:1646  */
+#line 1993 "config-parser.c" /* yacc.c:1646  */
     break;
 
   case 109:
-#line 455 "config-parser.y" /* yacc.c:1646  */
+#line 456 "config-parser.y" /* yacc.c:1646  */
     {
    struct ScannerConf *item = tmp;
    MyFree(item->vhost);
    item->vhost = xstrdup((yyvsp[-1].string));
 }
-#line 2002 "config-parser.c" /* yacc.c:1646  */
+#line 2003 "config-parser.c" /* yacc.c:1646  */
     break;
 
   case 110:
-#line 462 "config-parser.y" /* yacc.c:1646  */
+#line 463 "config-parser.y" /* yacc.c:1646  */
     {
    struct ScannerConf *item = tmp;
    MyFree(item->target_ip);
    item->target_ip = xstrdup((yyvsp[-1].string));
 }
-#line 2012 "config-parser.c" /* yacc.c:1646  */
+#line 2013 "config-parser.c" /* yacc.c:1646  */
     break;
 
   case 111:
-#line 469 "config-parser.y" /* yacc.c:1646  */
+#line 470 "config-parser.y" /* yacc.c:1646  */
     {
    struct ScannerConf *item = tmp;
 
@@ -2027,47 +2028,47 @@ yyreduce:
 
    list_add(item->target_string, node);
 }
-#line 2031 "config-parser.c" /* yacc.c:1646  */
+#line 2032 "config-parser.c" /* yacc.c:1646  */
     break;
 
   case 112:
-#line 485 "config-parser.y" /* yacc.c:1646  */
+#line 486 "config-parser.y" /* yacc.c:1646  */
     {
    struct ScannerConf *item = tmp;
    item->fd = (yyvsp[-1].number);
 }
-#line 2040 "config-parser.c" /* yacc.c:1646  */
+#line 2041 "config-parser.c" /* yacc.c:1646  */
     break;
 
   case 113:
-#line 491 "config-parser.y" /* yacc.c:1646  */
+#line 492 "config-parser.y" /* yacc.c:1646  */
     {
    struct ScannerConf *item = tmp;
    item->target_port = (yyvsp[-1].number);
 }
-#line 2049 "config-parser.c" /* yacc.c:1646  */
+#line 2050 "config-parser.c" /* yacc.c:1646  */
     break;
 
   case 114:
-#line 497 "config-parser.y" /* yacc.c:1646  */
+#line 498 "config-parser.y" /* yacc.c:1646  */
     {
    struct ScannerConf *item = tmp;
    item->timeout = (yyvsp[-1].number);
 }
-#line 2058 "config-parser.c" /* yacc.c:1646  */
+#line 2059 "config-parser.c" /* yacc.c:1646  */
     break;
 
   case 115:
-#line 503 "config-parser.y" /* yacc.c:1646  */
+#line 504 "config-parser.y" /* yacc.c:1646  */
     {
    struct ScannerConf *item = tmp;
    item->max_read = (yyvsp[-1].number);
 }
-#line 2067 "config-parser.c" /* yacc.c:1646  */
+#line 2068 "config-parser.c" /* yacc.c:1646  */
     break;
 
   case 116:
-#line 509 "config-parser.y" /* yacc.c:1646  */
+#line 510 "config-parser.y" /* yacc.c:1646  */
     {
    struct ProtocolConf *item;
    struct ScannerConf  *item2;
@@ -2083,38 +2084,38 @@ yyreduce:
    node = node_create(item);
    list_add(item2->protocols, node);
 }
-#line 2087 "config-parser.c" /* yacc.c:1646  */
+#line 2088 "config-parser.c" /* yacc.c:1646  */
     break;
 
   case 125:
-#line 539 "config-parser.y" /* yacc.c:1646  */
+#line 540 "config-parser.y" /* yacc.c:1646  */
     {
    MyFree(OpmItem->dnsbl_from);
    OpmItem->dnsbl_from = xstrdup((yyvsp[-1].string));
 }
-#line 2096 "config-parser.c" /* yacc.c:1646  */
+#line 2097 "config-parser.c" /* yacc.c:1646  */
     break;
 
   case 126:
-#line 545 "config-parser.y" /* yacc.c:1646  */
+#line 546 "config-parser.y" /* yacc.c:1646  */
     {
    MyFree(OpmItem->dnsbl_to);
    OpmItem->dnsbl_to = xstrdup((yyvsp[-1].string));
 }
-#line 2105 "config-parser.c" /* yacc.c:1646  */
+#line 2106 "config-parser.c" /* yacc.c:1646  */
     break;
 
   case 127:
-#line 551 "config-parser.y" /* yacc.c:1646  */
+#line 552 "config-parser.y" /* yacc.c:1646  */
     {
    MyFree(OpmItem->sendmail);
    OpmItem->sendmail = xstrdup((yyvsp[-1].string));
 }
-#line 2114 "config-parser.c" /* yacc.c:1646  */
+#line 2115 "config-parser.c" /* yacc.c:1646  */
     break;
 
   case 128:
-#line 559 "config-parser.y" /* yacc.c:1646  */
+#line 560 "config-parser.y" /* yacc.c:1646  */
     {
    node_t *node;
    struct BlacklistConf *item;
@@ -2132,33 +2133,33 @@ yyreduce:
 
    tmp = item;
 }
-#line 2136 "config-parser.c" /* yacc.c:1646  */
+#line 2137 "config-parser.c" /* yacc.c:1646  */
     break;
 
   case 138:
-#line 588 "config-parser.y" /* yacc.c:1646  */
+#line 589 "config-parser.y" /* yacc.c:1646  */
     {
    struct BlacklistConf *item = tmp;
 
    MyFree(item->name);
    item->name = xstrdup((yyvsp[-1].string));
 }
-#line 2147 "config-parser.c" /* yacc.c:1646  */
+#line 2148 "config-parser.c" /* yacc.c:1646  */
     break;
 
   case 139:
-#line 595 "config-parser.y" /* yacc.c:1646  */
+#line 596 "config-parser.y" /* yacc.c:1646  */
     {
    struct BlacklistConf *item = tmp;
 
    MyFree(item->kline);
    item->kline = xstrdup((yyvsp[-1].string));
 }
-#line 2158 "config-parser.c" /* yacc.c:1646  */
+#line 2159 "config-parser.c" /* yacc.c:1646  */
     break;
 
   case 140:
-#line 602 "config-parser.y" /* yacc.c:1646  */
+#line 603 "config-parser.y" /* yacc.c:1646  */
     {
    struct BlacklistConf *item = tmp;
    
@@ -2169,21 +2170,21 @@ yyreduce:
    else
       yyerror("Unknown blacklist type defined");
 }
-#line 2173 "config-parser.c" /* yacc.c:1646  */
+#line 2174 "config-parser.c" /* yacc.c:1646  */
     break;
 
   case 141:
-#line 613 "config-parser.y" /* yacc.c:1646  */
+#line 614 "config-parser.y" /* yacc.c:1646  */
     {
    struct BlacklistConf *item = tmp;
 
    item->ban_unknown = (yyvsp[-1].number);
 }
-#line 2183 "config-parser.c" /* yacc.c:1646  */
+#line 2184 "config-parser.c" /* yacc.c:1646  */
     break;
 
   case 145:
-#line 625 "config-parser.y" /* yacc.c:1646  */
+#line 626 "config-parser.y" /* yacc.c:1646  */
     {
    struct BlacklistReplyConf *item;
    struct BlacklistConf *blacklist = tmp;
@@ -2197,22 +2198,22 @@ yyreduce:
    node = node_create(item);
    list_add(blacklist->reply, node);
 }
-#line 2201 "config-parser.c" /* yacc.c:1646  */
+#line 2202 "config-parser.c" /* yacc.c:1646  */
     break;
 
   case 151:
-#line 651 "config-parser.y" /* yacc.c:1646  */
+#line 652 "config-parser.y" /* yacc.c:1646  */
     {
    node_t *node;
    node = node_create(xstrdup((yyvsp[-1].string)));
 
    list_add(ExemptItem->masks, node);
 }
-#line 2212 "config-parser.c" /* yacc.c:1646  */
+#line 2213 "config-parser.c" /* yacc.c:1646  */
     break;
 
 
-#line 2216 "config-parser.c" /* yacc.c:1646  */
+#line 2217 "config-parser.c" /* yacc.c:1646  */
       default: break;
     }
   /* User semantic actions sometimes alter yychar, and that requires
@@ -2440,5 +2441,5 @@ yyreturn:
 #endif
   return yyresult;
 }
-#line 658 "config-parser.y" /* yacc.c:1906  */
+#line 659 "config-parser.y" /* yacc.c:1906  */
 
index 2e226154173db76dc8c0a97d14d5b2d368297d9b..20eaee2883ffc1c5f5ed478bec6f4f9376aa7236 100644 (file)
@@ -170,7 +170,7 @@ extern int yydebug;
 typedef union YYSTYPE YYSTYPE;
 union YYSTYPE
 {
-#line 87 "config-parser.y" /* yacc.c:1909  */
+#line 88 "config-parser.y" /* yacc.c:1909  */
 
         int number;
         char *string;
index 67c67e513e1a3e6bd255d8e584ff334eb5b0a90d..7c6e9eb6d1b408e3aeaac3d3d3ac9673f9649445 100644 (file)
@@ -25,7 +25,8 @@
 %{
 #include <stdio.h>
 #include <string.h>
-#include "malloc.h"
+
+#include "memory.h"
 #include "config.h"
 
 int yylex(void);
index 423d00aeea2acd96f656e6fc00fe17f9b9c23b65..34c542f2e30ecb6ea89b89eec26f61a83d5003c3 100644 (file)
 #include <stdio.h>
 #include <errno.h>
 #include <string.h>
+#include <stdlib.h>
 
 #include "config.h"
 #include "config-parser.h"
-#include "malloc.h"
+#include "memory.h"
 #include "log.h"
 #include "scan.h"
 #include "irc.h"
index 23e7ef72a6593666025223fa82f91c885ce3b884..d7a9e9515790fb53cd61ca309d5c9f9ba6e3de3a 100644 (file)
@@ -39,7 +39,7 @@ along with this program; if not, write to the Free Software
 #include "list.h"
 #include "log.h"
 #include "main.h"
-#include "malloc.h"
+#include "memory.h"
 #include "match.h"
 #include "scan.h"
 #include "irc.h"
index 29266a38476276b08f4255d6b4c279c6219815e6..49ed14912f88acfaf235d65a4a268dcde8a64177 100644 (file)
@@ -37,7 +37,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 #include <fcntl.h>
 
 #include "compat.h"
-#include "malloc.h"
+#include "memory.h"
 #include "firedns.h"
 #include "config.h"
 #include "list.h"
index 11efa71c24b15cf8b63855e2c3d024d2f5add73f..21ced4a635a636038bb672aa3c5a8e7ed2dc9b35 100644 (file)
--- a/src/irc.c
+++ b/src/irc.c
@@ -50,7 +50,7 @@
 #include "match.h"
 #include "compat.h"
 #include "negcache.h"
-#include "malloc.h"
+#include "memory.h"
 #include "main.h"
 
 
index 53a0a41307a39a1279d89a12a277ada13b2b9c7d..c8688411f1866cf7e0dc64b9a3e5e6e7b60f3b5f 100644 (file)
@@ -21,7 +21,9 @@
  *
  */
 
-#include "malloc.h"
+#include <stdlib.h>
+
+#include "memory.h"
 #include "list.h"
 
 
index cff06c72deb98ac2e858f5e49ea392efa56e8b60..87a91a927b68148a5f6d9889ebcbfb9b3d13807a 100644 (file)
@@ -45,7 +45,7 @@ along with this program; if not, write to the Free Software
 #include "stats.h"
 #include "negcache.h"
 #include "options.h"
-#include "malloc.h"
+#include "memory.h"
 #include "firedns.h"
 #include "main.h"
 
diff --git a/src/malloc.c b/src/malloc.c
deleted file mode 100644 (file)
index f1c34fe..0000000
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * Copyright (C) 2002  Erik Fears
- *
- * 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.
- *       59 Temple Place - Suite 330
- *       Boston, MA  02111-1307, USA.
- *
- *
- */
-
-#include <malloc.h>
-#include <assert.h>
-#include <string.h>
-#include "malloc.h"
-
-
-/* xcalloc
- *  
- *   A wrapper function for malloc(), for catching memory issues
- *   and error handling.
- *
- * Parameters
- *    bytes: amount in bytes to allocate
- *    
- * Return:
- *    Pointer to allocated memory
- */
-
-void *xcalloc(size_t bytes)
-{
-   void *ret = calloc(1, bytes);
-   assert(ret);
-
-   return ret;
-}
-
-
-
-/*  MyFree
- *
- *  Free memory allocated with xcalloc
- *
- *  Parameters:
- *     var: pointer to memory to free
- *     
- *  Return:
- *     None
- */
-
-void _MyFree(void **var)
-{
-   assert(var != NULL);
-
-   if(*var != NULL)
-      free(*var);
-   *var = NULL;
-}
-
-void *
-xstrdup(const char *s)
-{
-  void *ret = malloc(strlen(s) + 1);
-
-  assert(ret);
-  strcpy(ret, s);
-
-  return ret;
-}
diff --git a/src/malloc.h b/src/malloc.h
deleted file mode 100644 (file)
index c777064..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-#ifndef MALLOC_H
-#define MALLOC_H
-
-#include <stdlib.h>
-
-#define MyFree(X) _MyFree((void **) &X)
-
-extern void *xcalloc(size_t bytes);
-extern void _MyFree(void **var);
-extern void *xstrdup(const char *);
-
-#endif /* MALLOC_H */
diff --git a/src/memory.c b/src/memory.c
new file mode 100644 (file)
index 0000000..f1c34fe
--- /dev/null
@@ -0,0 +1,81 @@
+/*
+ * Copyright (C) 2002  Erik Fears
+ *
+ * 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.
+ *       59 Temple Place - Suite 330
+ *       Boston, MA  02111-1307, USA.
+ *
+ *
+ */
+
+#include <malloc.h>
+#include <assert.h>
+#include <string.h>
+#include "malloc.h"
+
+
+/* xcalloc
+ *  
+ *   A wrapper function for malloc(), for catching memory issues
+ *   and error handling.
+ *
+ * Parameters
+ *    bytes: amount in bytes to allocate
+ *    
+ * Return:
+ *    Pointer to allocated memory
+ */
+
+void *xcalloc(size_t bytes)
+{
+   void *ret = calloc(1, bytes);
+   assert(ret);
+
+   return ret;
+}
+
+
+
+/*  MyFree
+ *
+ *  Free memory allocated with xcalloc
+ *
+ *  Parameters:
+ *     var: pointer to memory to free
+ *     
+ *  Return:
+ *     None
+ */
+
+void _MyFree(void **var)
+{
+   assert(var != NULL);
+
+   if(*var != NULL)
+      free(*var);
+   *var = NULL;
+}
+
+void *
+xstrdup(const char *s)
+{
+  void *ret = malloc(strlen(s) + 1);
+
+  assert(ret);
+  strcpy(ret, s);
+
+  return ret;
+}
diff --git a/src/memory.h b/src/memory.h
new file mode 100644 (file)
index 0000000..c777064
--- /dev/null
@@ -0,0 +1,12 @@
+#ifndef MALLOC_H
+#define MALLOC_H
+
+#include <stdlib.h>
+
+#define MyFree(X) _MyFree((void **) &X)
+
+extern void *xcalloc(size_t bytes);
+extern void _MyFree(void **var);
+extern void *xstrdup(const char *);
+
+#endif /* MALLOC_H */
index ef4e0333b553447226b2dce099f04b827e1e3411..912bbdd17a659ab1b4d564257f7f33ecf4b69c6d 100644 (file)
@@ -52,7 +52,7 @@ along with this program; if not, write to:
 #include "irc.h"
 #include "negcache.h"
 #include "config.h"
-#include "malloc.h"
+#include "memory.h"
 #include "log.h"
 
 
index 4cd7c82d47396b110bed144288682a8f54667c2f..a59d120bf309296aabe511e782ff7c15a57de33e 100644 (file)
@@ -36,7 +36,7 @@ along with this program; if not, write to the Free Software
 #include "opercmd.h"
 #include "scan.h"
 #include "config.h"
-#include "malloc.h"
+#include "memory.h"
 #include "list.h"
 #include "stats.h"
 
index b3d3a5b0704e7627b1f306c5323d0f53f3cdf067..dcef6363bbd410906d5ed79b9b3b1c8dd8968e30 100644 (file)
@@ -47,7 +47,7 @@
 #include "options.h"
 #include "negcache.h"
 #include "main.h"
-#include "malloc.h"
+#include "memory.h"
 #include "match.h"
 #include "scan.h"