r10588: Remove more unused files, macros
authorJelmer Vernooij <jelmer@samba.org>
Wed, 28 Sep 2005 19:56:21 +0000 (19:56 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 18:39:08 +0000 (13:39 -0500)
(This used to be commit d2f80c0457f7404b2cac9df59a400130e9ad025f)

source4/include/clitar.h [deleted file]
source4/include/includes.h
source4/include/interfaces.h [deleted file]
source4/include/module.h [deleted file]
source4/include/mutex.h
source4/include/smb_macros.h
source4/lib/registry/tools/regpatch.c
source4/param/loadparm.c
source4/smb_server/trans2.c

diff --git a/source4/include/clitar.h b/source4/include/clitar.h
deleted file mode 100644 (file)
index b773117..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Unix SMB/CIFS implementation. 
- * clitar file format
- * Copyright (C) Andrew Tridgell              2000
- * 
- * 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.  
- */
-
-#ifndef _CLITAR_H
-#define _CLITAR_H
-
-#define TBLOCK 512
-#define NAMSIZ 100
-union hblock {
-  char dummy[TBLOCK];
-  struct header {
-    char name[NAMSIZ];
-    char mode[8];
-    char uid[8];
-    char gid[8];
-    char size[12];
-    char mtime[12];
-    char chksum[8];
-    char linkflag;
-    char linkname[NAMSIZ];
-  } dbuf;
-};
-
-#endif /* _CLITAR_H */
index ee1ac6d96e5586d8ef175356364877aac0ee1e5b..b7acae90196f17a768eba8004200200072365799 100644 (file)
@@ -102,7 +102,6 @@ struct ipv4_addr {
 #include "smb_macros.h"
 #include "smb.h"
 #include "byteorder.h"
-#include "module.h"
 #include "lib/tdr/tdr.h"
 #include "librpc/ndr/libndr.h"
 #include "librpc/gen_ndr/misc.h"
@@ -116,10 +115,6 @@ struct ipv4_addr {
 #include "lib/com/com.h"
 #include "credentials.h"
 
-#define malloc_p(type) (type *)malloc(sizeof(type))
-#define malloc_array_p(type, count) (type *)realloc_array(NULL, sizeof(type), count)
-#define realloc_p(p, type, count) (type *)realloc_array(p, sizeof(type), count)
-
 /***** automatically generated prototypes *****/
 #define _PRINTF_ATTRIBUTE(a1, a2) PRINTF_ATTRIBUTE(a1, a2)
 #include "include/proto.h"
@@ -170,9 +165,4 @@ extern int DEBUGLEVEL;
 #define UINT16_MAX 65535
 #endif
 
-/*
-  type safe varient of smb_xmalloc()
-*/
-#define smb_xmalloc_p(type) (type *)smb_xmalloc(sizeof(type))
-
 #endif /* _INCLUDES_H */
diff --git a/source4/include/interfaces.h b/source4/include/interfaces.h
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/source4/include/module.h b/source4/include/module.h
deleted file mode 100644 (file)
index 5994b85..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
-   Unix SMB/CIFS implementation.
-   Handling of idle/exit events
-   Copyright (C) Jelmer Vernooij 2003
-
-   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.
-*/
-
-#ifndef _MODULE_H
-#define _MODULE_H
-
-/* Module support */
-typedef NTSTATUS (*init_module_function) (void);
-
-/* Module that registers a backend for a certain subsystem */
-typedef NTSTATUS (*register_backend_function) (const void *data);
-
-#endif /* _MODULE_H */
index c0b7d26744d3dcf1fe1eed5561c5e9e88605f9fd..bb26c84f5dcb077d7a6705c3a2b91e51c89f12eb 100644 (file)
@@ -66,4 +66,4 @@ struct mutex_ops {
        int (*rwlock_destroy)(smb_rwlock_t *rwlock, const char *name);
 };
 
-#endif /* ndef _MUTEX_H_ */
+#endif /* endif _MUTEX_H_ */
index f5ac3ac96d24c5261c37535893087f73d737b0c7..f1c62ab024cea60cc29403f275a1f8346edd5eb2 100644 (file)
@@ -70,4 +70,8 @@
 #define SAFE_FREE(x) do { if ((x) != NULL) {free(discard_const_p(void *, (x))); (x)=NULL;} } while(0)
 #endif
 
+#define malloc_p(type) (type *)malloc(sizeof(type))
+#define malloc_array_p(type, count) (type *)realloc_array(NULL, sizeof(type), count)
+#define realloc_p(p, type, count) (type *)realloc_array(p, sizeof(type), count)
+
 #endif /* _SMB_MACROS_H */
index 887f53df37db77e1f8286ece7388a68ece700c44..98e6c0ff5d26d67ecc7fbb20022fcd8942a6103c 100644 (file)
@@ -156,10 +156,13 @@ static void print_line(struct cmd_line *cl)
  */
 static struct cmd_line *get_cmd_line(int fd)
 {
-  CMD_LINE *cl = smb_xmalloc_p(CMD_LINE);
+  CMD_LINE *cl = malloc_p(CMD_LINE);
   int i = 0, rc;
   uint8_t ch;
 
+  if (!cl)
+         return NULL;
+
   cl->len = INIT_ALLOC;
 
   /*
@@ -447,7 +450,9 @@ static CMD *regedit4_get_cmd(int fd)
   struct cmd_line *cl = NULL;
   struct val_spec_list *vl = NULL;
 
-  cmd = smb_xmalloc_p(struct command_s);
+  cmd = malloc_p(struct command_s);
+  if (!cmd)
+         return NULL;
 
   cmd->cmd = CMD_NONE;
   cmd->key = NULL;
@@ -490,7 +495,9 @@ static CMD *regedit4_get_cmd(int fd)
         * There could be a \ on the end which we need to 
         * handle at some time
         */
-       vl = smb_xmalloc_p(struct val_spec_list);
+       vl = malloc_p(struct val_spec_list);
+       if (!vl)
+               return NULL;
        vl->next = NULL;
        vl->val = NULL;
        vl->name = parse_value(cl, &vl->type, &vl->val);
@@ -609,7 +616,9 @@ static CMD_FILE *cmd_file_create(const char *file)
     return NULL;
   }
 
-  tmp = smb_xmalloc_p(CMD_FILE); 
+  tmp = malloc_p(CMD_FILE); 
+  if (!tmp)
+         return NULL;
 
   /*
    * Let's fill in some of the fields;
index 7576b05d8358c3abedf0ed1adfe8f6fe4d6ae594..18c8d47746495d58b28641eb7d436b6241bce7f8 100644 (file)
@@ -1485,7 +1485,9 @@ static void copy_service(service * pserviceDest, service * pserviceSource, BOOL
                        pdata = pdata->next;
                }
                if (not_added) {
-                       paramo = smb_xmalloc_p(struct param_opt);
+                       paramo = malloc_p(struct param_opt);
+                       if (!paramo)
+                               smb_panic("OOM");
                        paramo->key = strdup(data->key);
                        paramo->value = strdup(data->value);
                        DLIST_ADD(pserviceDest->param_opt, paramo);
@@ -1742,7 +1744,9 @@ static BOOL lp_do_parameter_parametric(int snum, const char *pszParmName, const
                }
        }
 
-       paramo = smb_xmalloc_p(struct param_opt);
+       paramo = malloc_p(struct param_opt);
+       if (!paramo)
+               smb_panic("OOM");
        paramo->key = strdup(name);
        paramo->value = strdup(pszParmValue);
        paramo->flags = flags;
index 694cd969ecdd94164e2d455eee9b31fa64f1bc5d..c9a357523b12199c6ed237485f92799a2aa1a50d 100644 (file)
@@ -26,8 +26,6 @@
 #include "smb_server/smb_server.h"
 #include "librpc/gen_ndr/ndr_misc.h"
 
-
-
 #define CHECK_MIN_BLOB_SIZE(blob, size) do { \
        if ((blob)->length < (size)) { \
                return NT_STATUS_INFO_LENGTH_MISMATCH; \