- Moved malloc.c to memory.c
authormichael <michael@82007160-df01-0410-b94d-b575c5fd34c7>
Thu, 7 May 2015 18:59:02 +0000 (18:59 +0000)
committermichael <michael@82007160-df01-0410-b94d-b575c5fd34c7>
Thu, 7 May 2015 18:59:02 +0000 (18:59 +0000)
git-svn-id: svn://svn.ircd-hybrid.org/svnroot/hopm/trunk@5947 82007160-df01-0410-b94d-b575c5fd34c7

configure
src/libopm/src/Makefile.am
src/libopm/src/Makefile.in
src/libopm/src/config.c
src/libopm/src/libopm.c
src/libopm/src/list.c
src/libopm/src/malloc.c [deleted file]
src/libopm/src/malloc.h [deleted file]
src/libopm/src/memory.c [new file with mode: 0644]
src/libopm/src/memory.h [new file with mode: 0644]

index 298e535931ffdec9993eb128b8c2ad2198ab61c7..b3c56223804fbefccc93a4ed8f820b525464b722 100755 (executable)
--- a/configure
+++ b/configure
@@ -1,5 +1,5 @@
 #! /bin/sh
-# From configure.ac Id: configure.ac 5314 2015-01-06 13:27:34Z michael .
+# From configure.ac Id: configure.ac 5943 2015-05-06 19:09:49Z michael .
 # Guess values for system-dependent variables and create Makefiles.
 # Generated by GNU Autoconf 2.69 for hopm TRUNK.
 #
index 184b8a26dceee03008b8e5f6b3ce80eb7b29ff00..a4ce8526885e880d9c4f28a550ec2bc909db8046 100644 (file)
@@ -7,8 +7,8 @@ libopm_la_SOURCES = config.c     \
                     libopm.h     \
                     list.c       \
                     list.h       \
-                    malloc.c     \
-                    malloc.h     \
+                    memory.c     \
+                    memory.h     \
                     opm_common.h \
                     opm_error.h  \
                     opm.h        \
index 1cbdc7808f30714bb5611998815978ff44f25f46..6061b1f980b70c3d3149cf65b7d6b4c1673c04de 100644 (file)
@@ -100,7 +100,7 @@ CONFIG_CLEAN_FILES =
 CONFIG_CLEAN_VPATH_FILES =
 LTLIBRARIES = $(noinst_LTLIBRARIES)
 libopm_la_DEPENDENCIES = @LTLIBOBJS@
-am_libopm_la_OBJECTS = config.lo libopm.lo list.lo malloc.lo proxy.lo
+am_libopm_la_OBJECTS = config.lo libopm.lo list.lo memory.lo proxy.lo
 libopm_la_OBJECTS = $(am_libopm_la_OBJECTS)
 AM_V_lt = $(am__v_lt_@AM_V@)
 am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
@@ -298,8 +298,8 @@ libopm_la_SOURCES = config.c     \
                     libopm.h     \
                     list.c       \
                     list.h       \
-                    malloc.c     \
-                    malloc.h     \
+                    memory.c     \
+                    memory.h     \
                     opm_common.h \
                     opm_error.h  \
                     opm.h        \
@@ -365,7 +365,7 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/config.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libopm.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/list.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/malloc.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/memory.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/proxy.Plo@am__quote@
 
 .c.o:
index bcb82b0dd2a25cac6e638dd059d360254d25bbad..7cc5f59b0a81077980f5142ef428323482e3f6a5 100644 (file)
@@ -25,7 +25,7 @@
 
 #include <string.h>
 
-#include "malloc.h"
+#include "memory.h"
 #include "config.h"
 #include "inet.h"
 #include "opm_error.h"
index 817b7684523add0f74b13318b377d2ff37c91c08..bd5b1b2c47f56eab8ffd9090d790deda19d6a8c0 100644 (file)
@@ -25,7 +25,7 @@
 
 #include "config.h"
 #include "libopm.h"
-#include "malloc.h"
+#include "memory.h"
 #include "opm_error.h"
 #include "opm_types.h"
 #include "opm_common.h"
index 8e0a72d4980797d703504b5044f92afbb9e30e37..5fd707afe5d409eb334d53956e6926bce3c3a824 100644 (file)
@@ -25,7 +25,7 @@
 
 #include "opm_common.h"
 #include "list.h"
-#include "malloc.h"
+#include "memory.h"
 #include "opm.h"
 
 
diff --git a/src/libopm/src/malloc.c b/src/libopm/src/malloc.c
deleted file mode 100644 (file)
index f7988b4..0000000
+++ /dev/null
@@ -1,82 +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 <assert.h>
-#include <string.h>
-#include "setup.h"
-
-#include "malloc.h"
-#include "opm.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 *libopm_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 libopm_MyFree(void **var)
-{
-   if(*var != NULL)
-      free(*var);
-   *var = NULL;
-}
-
-void *
-libopm_xstrdup(const char *s)
-{
-  void *ret = malloc(strlen(s) + 1);
-
-  assert(ret);
-  strcpy(ret, s);
-
-  return ret;
-}
diff --git a/src/libopm/src/malloc.h b/src/libopm/src/malloc.h
deleted file mode 100644 (file)
index 4e4a79c..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-#ifndef MALLOC_H
-#define MALLOC_H
-
-#include "setup.h"
-
-#include <stdlib.h>
-
-#define xcalloc(SIZE) libopm_xcalloc(SIZE)
-#define MyFree(X) libopm_MyFree((void **) &X)
-
-void *libopm_xcalloc(size_t bytes);
-void libopm_MyFree(void **var);
-extern void *libopm_xstrdup(const char *);
-
-#endif /* MALLOC_H */
diff --git a/src/libopm/src/memory.c b/src/libopm/src/memory.c
new file mode 100644 (file)
index 0000000..569a526
--- /dev/null
@@ -0,0 +1,82 @@
+/*
+ * 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 <assert.h>
+#include <string.h>
+#include "setup.h"
+
+#include "memory.h"
+#include "opm.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 *libopm_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 libopm_MyFree(void **var)
+{
+   if(*var != NULL)
+      free(*var);
+   *var = NULL;
+}
+
+void *
+libopm_xstrdup(const char *s)
+{
+  void *ret = malloc(strlen(s) + 1);
+
+  assert(ret);
+  strcpy(ret, s);
+
+  return ret;
+}
diff --git a/src/libopm/src/memory.h b/src/libopm/src/memory.h
new file mode 100644 (file)
index 0000000..4e4a79c
--- /dev/null
@@ -0,0 +1,15 @@
+#ifndef MALLOC_H
+#define MALLOC_H
+
+#include "setup.h"
+
+#include <stdlib.h>
+
+#define xcalloc(SIZE) libopm_xcalloc(SIZE)
+#define MyFree(X) libopm_MyFree((void **) &X)
+
+void *libopm_xcalloc(size_t bytes);
+void libopm_MyFree(void **var);
+extern void *libopm_xstrdup(const char *);
+
+#endif /* MALLOC_H */