r3494: got rid of include/rewrite.h, and split out the dynconfig.h header
authorAndrew Tridgell <tridge@samba.org>
Wed, 3 Nov 2004 00:17:12 +0000 (00:17 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 18:05:22 +0000 (13:05 -0500)
29 files changed:
source/client/client.c
source/gtk/tools/gepdump.c
source/gtk/tools/gregedit.c
source/gtk/tools/gwcrontab.c
source/gtk/tools/gwsam.c
source/include/charset.h
source/include/includes.h
source/include/pstring.h
source/include/rewrite.h [deleted file]
source/include/smb.h
source/ldap_server/ldap_rootdse.c
source/lib/cmdline/popt_common.c
source/lib/debug.c
source/lib/registry/tools/regdiff.c
source/lib/registry/tools/regpatch.c
source/lib/registry/tools/regshell.c
source/lib/registry/tools/regtree.c
source/lib/substitute.c
source/lib/util.c
source/libcli/namequery.c
source/nsswitch/winbind_nss_config.h
source/param/loadparm.c
source/smbd/rewrite.c
source/torture/gentest.c
source/torture/locktest.c
source/torture/masktest.c
source/torture/torture.c
source/utils/net/net.c
source/utils/ntlm_auth.c

index 9c9b623920d3bdef2a0edf64fe04456b893ae9b2..82377e82a94a6ed23bd9f8cf44dedf7fa0127f5b 100644 (file)
@@ -22,6 +22,7 @@
 */
 
 #include "includes.h"
+#include "dynconfig.h"
 #include "client.h"
 #include "lib/cmdline/popt_common.h"
 #include "librpc/gen_ndr/ndr_srvsvc.h"
index 52e6bdad7db4f27852046463510ff4b6843fd3fb..1ad84b99f55533a2ef0722ef20018bf70052988b 100644 (file)
@@ -20,6 +20,7 @@
 */
 
 #include "includes.h"
+#include "dynconfig.h"
 #include "librpc/gen_ndr/ndr_epmapper.h"
 #include "gtk/common/select.h"
 #include "gtk/common/gtk-smb.h"
@@ -322,9 +323,9 @@ static GtkWidget* create_mainwindow (void)
  int main(int argc, char **argv)
 {
        gtk_init(&argc, &argv);
-    lp_load(dyn_CONFIGFILE,True,False,False);
-    load_interfaces();
-    setup_logging("gepdump", True);
+       lp_load(dyn_CONFIGFILE,True,False,False);
+       load_interfaces();
+       setup_logging("gepdump", True);
        mainwin = create_mainwindow();
        gtk_widget_show_all(mainwin);
        gtk_main();
index 10d9a127c44e7515e1119ec6ae379abb281935e3..f5c2fd595725d596ae097c316e9028e4a6f60878 100644 (file)
@@ -20,6 +20,7 @@
 */
 
 #include "includes.h"
+#include "dynconfig.h"
 #include "registry.h"
 #include "lib/cmdline/popt_common.h"
 #include "gtk/common/select.h"
index 38e4e11103c1671fc19964f99324cb61d911f8d4..b1176a3fa8bf624f93fbee1894eb5aa51bb13210 100644 (file)
@@ -20,6 +20,7 @@
 */
 
 #include "includes.h"
+#include "dynconfig.h"
 #include "librpc/gen_ndr/ndr_atsvc.h"
 #include "gtk/common/select.h"
 #include "gtk/common/gtk-smb.h"
index cf8e1d5b5fe5d2ea5b25f22755d1afcdac1ac393..18fd578f64c28ff542a934e03c475729e88679cb 100644 (file)
@@ -20,6 +20,7 @@
 */
 
 #include "includes.h"
+#include "dynconfig.h"
 #include "librpc/gen_ndr/ndr_samr.h"
 #include "gtk/common/select.h"
 #include "gtk/common/gtk-smb.h"
index 6c3ad2d916d6ded497105d5a675ea0006d30e3c6..ba1402acb3c1d9260465932004f944a81497b945 100644 (file)
@@ -42,3 +42,16 @@ struct charset_functions {
 typedef uint32_t codepoint_t;
 
 #define INVALID_CODEPOINT ((codepoint_t)-1)
+
+
+/* generic iconv conversion structure */
+typedef struct {
+       size_t (*direct)(void *cd, const char **inbuf, size_t *inbytesleft,
+                        char **outbuf, size_t *outbytesleft);
+       size_t (*pull)(void *cd, const char **inbuf, size_t *inbytesleft,
+                      char **outbuf, size_t *outbytesleft);
+       size_t (*push)(void *cd, const char **inbuf, size_t *inbytesleft,
+                      char **outbuf, size_t *outbytesleft);
+       void *cd_direct, *cd_pull, *cd_push;
+} *smb_iconv_t;
+
index 78397faac65cd699ab5b69e3c940d4e02ca0b198..9f2c233e73926a014ef1b037a6ac7bde96171adb 100644 (file)
 #define uint64 uint64_t
 #endif
 
+#define False (0)
+#define True (1)
+#define Auto (2)
+
+typedef int BOOL;
+
 /*
   we use struct ipv4_addr to avoid having to include all the
   system networking headers everywhere
@@ -152,11 +158,7 @@ extern char *sys_errlist[];
 extern int errno;
 #endif
 
-/* Our own pstrings and fstrings */
-#include "pstring.h"
-
 /* Lists, trees, caching, database... */
-#include "dynconfig.h"
 #include "version.h"
 #include "xfile.h"
 #include "talloc.h"
@@ -169,7 +171,12 @@ extern int errno;
 #include "trans2.h"
 #include "nterr.h"
 #include "charset.h"
-#include "rewrite.h"
+#include "debug.h"
+#include "doserr.h"
+#include "enums.h"
+#include "pstring.h"
+#include "smb_macros.h"
+#include "rpc_secdes.h"
 #include "smb.h"
 #include "ads.h"
 #include "lib/socket/socket.h"
index 92870e4cae55bc915e47c0bd366e8ead82243704..5bd03ec0d8f89dc6b6600b3f247efd67f40806aa 100644 (file)
@@ -1,6 +1,8 @@
 /* 
    samba -- Unix SMB/CIFS implementation.
-   Safe standardized string types
+
+   ugly string types from Samba3. Will be removed 
+   with glee when we finally don't use them.
    
    Copyright (C) Andrew Tridgell              1992-2000
    Copyright (C) John H Terpstra              1996-2000
@@ -23,8 +25,6 @@
    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 */
 
-#ifndef _PSTRING
-
 #define PSTRING_LEN 1024
 #define FSTRING_LEN 256
 
@@ -32,5 +32,3 @@ typedef char pstring[PSTRING_LEN];
 typedef char fstring[FSTRING_LEN];
 
 #define _PSTRING
-
-#endif /* ndef _PSTRING */
diff --git a/source/include/rewrite.h b/source/include/rewrite.h
deleted file mode 100644 (file)
index fa2168b..0000000
+++ /dev/null
@@ -1,91 +0,0 @@
-/* 
-   Unix SMB/CIFS implementation.
-   SMB parameters and setup, plus a whole lot more.
-   
-   Copyright (C) Andrew Tridgell              1992-2000
-   Copyright (C) John H Terpstra              1996-2002
-   Copyright (C) Luke Kenneth Casson Leighton 1996-2000
-   Copyright (C) Paul Ashton                  1998-2000
-   Copyright (C) Simo Sorce                   2001-2002
-   Copyright (C) Martin Pool                 2002
-   
-   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 _REWRITE_H
-#define _REWRITE_H
-
-#define False (0)
-#define True (1)
-#define Auto (2)
-
-#ifndef _BOOL
-typedef int BOOL;
-#define _BOOL       /* So we don't typedef BOOL again in vfs.h */
-#endif
-
-/* string manipulation flags - see clistr.c and srvstr.c */
-#define STR_TERMINATE 1
-#define STR_UPPER 2
-#define STR_ASCII 4
-#define STR_UNICODE 8
-#define STR_NOALIGN 16
-#define STR_NO_RANGE_CHECK 32
-#define STR_LEN8BIT 64
-#define STR_TERMINATE_ASCII 128 /* only terminate if ascii */
-#define STR_LEN_NOTERM 256 /* the length field is the unterminated length */
-
-/* Debugging stuff */
-#include "debug.h"
-#include "doserr.h"
-
-#include "enums.h"
-
-/*
- * Loopback command offsets.
- */
-
-#define OPBRK_CMD_LEN_OFFSET 0
-#define OPBRK_CMD_PORT_OFFSET 4
-#define OPBRK_CMD_HEADER_LEN 6
-
-#define OPBRK_MESSAGE_CMD_OFFSET 0
-
-/* Message types */
-#define OPLOCK_BREAK_CMD 0x1
-#define KERNEL_OPLOCK_BREAK_CMD 0x2
-#define LEVEL_II_OPLOCK_BREAK_CMD 0x3
-#define ASYNC_LEVEL_II_OPLOCK_BREAK_CMD 0x4
-
-#define CMD_REPLY 0x8000
-
-#include "smb_macros.h"
-
-#include "rpc_secdes.h"
-
-#define SAFE_NETBIOS_CHARS ". -_"
-
-/* generic iconv conversion structure */
-typedef struct {
-       size_t (*direct)(void *cd, const char **inbuf, size_t *inbytesleft,
-                        char **outbuf, size_t *outbytesleft);
-       size_t (*pull)(void *cd, const char **inbuf, size_t *inbytesleft,
-                      char **outbuf, size_t *outbytesleft);
-       size_t (*push)(void *cd, const char **inbuf, size_t *inbytesleft,
-                      char **outbuf, size_t *outbytesleft);
-       void *cd_direct, *cd_pull, *cd_push;
-} *smb_iconv_t;
-
-#endif /* _REWRITE_H */
index bc9eb2acb8e4f1484e849210c2344d354e5279b4..940af75671d27c3831d0ecdd7dd85975a7909ffd 100644 (file)
@@ -592,4 +592,16 @@ typedef uint64_t HYPER_T;
 /* passed to br lock code */
 enum brl_type {READ_LOCK, WRITE_LOCK, PENDING_READ_LOCK, PENDING_WRITE_LOCK};
 
+/* string manipulation flags - see clistr.c and srvstr.c */
+#define STR_TERMINATE 1
+#define STR_UPPER 2
+#define STR_ASCII 4
+#define STR_UNICODE 8
+#define STR_NOALIGN 16
+#define STR_NO_RANGE_CHECK 32
+#define STR_LEN8BIT 64
+#define STR_TERMINATE_ASCII 128 /* only terminate if ascii */
+#define STR_LEN_NOTERM 256 /* the length field is the unterminated length */
+
+
 #endif /* _SMB_H */
index db8be0546783d645ec85180556f8fbaa408eee3d..2b9efa11b47374d0f50a272891f15f1a2e013afd 100644 (file)
@@ -19,6 +19,7 @@
 */
 
 #include "includes.h"
+#include "dynconfig.h"
 #include "ldap_server/ldap_server.h"
 #include "system/time.h"
 
index 7d4dead4de5837a66ca7b6ff32e273e69f4b09d1..6422b84b446586339a7ec9cfa51c8f13ff764d9d 100644 (file)
@@ -21,6 +21,7 @@
 */
 
 #include "includes.h"
+#include "dynconfig.h"
 #include "system/passwd.h"
 #include "lib/cmdline/popt_common.h"
 
index 4f6ba125d354cf253465449964391d781df92994..f1e9cec38e8b39aff77ff230015611d2d5d1209a 100644 (file)
@@ -20,6 +20,7 @@
 */
 
 #include "includes.h"
+#include "dynconfig.h"
 
 /* this global variable determines what messages are printed */
 int DEBUGLEVEL;
index c1b8d2949ed8ed7b59511729b4f1b1b8f632f287..80f4a5c49fb2be65dd151c025ad1f868d1200adc 100644 (file)
@@ -20,6 +20,7 @@
 */
 
 #include "includes.h"
+#include "dynconfig.h"
 #include "registry.h"
 #include "lib/cmdline/popt_common.h"
 
index ae4d331e3c9562b374098cfddf8f525e06b9bcf7..38eabb60a9ebad07a4a16895b0037078c24bfb0c 100644 (file)
@@ -21,6 +21,7 @@
 */
 
 #include "includes.h"
+#include "dynconfig.h"
 #include "registry.h"
 #include "lib/cmdline/popt_common.h"
 
index 583624fbab6171830225d4a94883a3e9d863aa30..d705a0b802347341e0ef17d92a80725792c9ea4c 100644 (file)
@@ -20,6 +20,7 @@
 */
 
 #include "includes.h"
+#include "dynconfig.h"
 #include "registry.h"
 #include "lib/cmdline/popt_common.h"
 #include "system/time.h"
index 8fd73aef85b1de23505f4ae24b0076283762b6fa..a8225c026d9e973752a139805c19dbd8112f0f5b 100644 (file)
@@ -20,6 +20,7 @@
 */
 
 #include "includes.h"
+#include "dynconfig.h"
 #include "registry.h"
 #include "lib/cmdline/popt_common.h"
 
index a01b90450a2c138ee3ffba556ff1138886b125a6..a351db1af21aa2b17ca502ea5cedc6e59ac98b17 100644 (file)
@@ -37,6 +37,7 @@ void sub_set_context(struct substitute_context *subptr)
 */
 static void setup_string(char **dest, const char *str)
 {
+#define SAFE_NETBIOS_CHARS ". -_"
        char *s;
 
        s = strdup(str);
index 5385174ce4589b5183de5e561127434bc72f4e51..d8e9cb50f9cd75cbaf2cd3bb70c1e5a717500a00 100644 (file)
@@ -23,6 +23,7 @@
 */
 
 #include "includes.h"
+#include "dynconfig.h"
 #include "system/network.h"
 #include "system/iconv.h"
 
index 2a67df5ffd21e85a42f730105559af4255d1022b..85270c10019265f24fd5be672af978372399b5db 100644 (file)
@@ -456,118 +456,6 @@ struct ipv4_addr *name_query(int fd,const char *name,int name_type,
        return ip_list;
 }
 
-/********************************************************
- Start parsing the lmhosts file.
-*********************************************************/
-
-XFILE *startlmhosts(char *fname)
-{
-       XFILE *fp = x_fopen(fname,O_RDONLY, 0);
-       if (!fp) {
-               DEBUG(4,("startlmhosts: Can't open lmhosts file %s. Error was %s\n",
-                        fname, strerror(errno)));
-               return NULL;
-       }
-       return fp;
-}
-
-/********************************************************
- Parse the next line in the lmhosts file.
-*********************************************************/
-
-BOOL getlmhostsent( TALLOC_CTX *mem_ctx,
-               XFILE *fp, pstring name, int *name_type, struct ipv4_addr *ipaddr)
-{
-  pstring line;
-
-  while(!x_feof(fp) && !x_ferror(fp)) {
-    pstring ip,flags,extra;
-    const char *ptr;
-    char *ptr1;
-    int count = 0;
-
-    *name_type = -1;
-
-    if (!fgets_slash(line,sizeof(pstring),fp))
-      continue;
-
-    if (*line == '#')
-      continue;
-
-    pstrcpy(ip,"");
-    pstrcpy(name,"");
-    pstrcpy(flags,"");
-
-    ptr = line;
-
-    if (next_token(&ptr,ip   ,NULL,sizeof(ip)))
-      ++count;
-    if (next_token(&ptr,name ,NULL, sizeof(pstring)))
-      ++count;
-    if (next_token(&ptr,flags,NULL, sizeof(flags)))
-      ++count;
-    if (next_token(&ptr,extra,NULL, sizeof(extra)))
-      ++count;
-
-    if (count <= 0)
-      continue;
-
-    if (count > 0 && count < 2)
-    {
-      DEBUG(0,("getlmhostsent: Ill formed hosts line [%s]\n",line));
-      continue;
-    }
-
-    if (count >= 4)
-    {
-      DEBUG(0,("getlmhostsent: too many columns in lmhosts file (obsolete syntax)\n"));
-      continue;
-    }
-
-    DEBUG(4, ("getlmhostsent: lmhost entry: %s %s %s\n", ip, name, flags));
-
-    if (strchr_m(flags,'G') || strchr_m(flags,'S'))
-    {
-      DEBUG(0,("getlmhostsent: group flag in lmhosts ignored (obsolete)\n"));
-      continue;
-    }
-
-    *ipaddr = interpret_addr2(ip);
-
-    /* Extra feature. If the name ends in '#XX', where XX is a hex number,
-       then only add that name type. */
-    if((ptr1 = strchr_m(name, '#')) != NULL)
-    {
-      char *endptr;
-
-      ptr1++;
-      *name_type = (int)strtol(ptr1, &endptr, 16);
-
-      if(!*ptr1 || (endptr == ptr1))
-      {
-        DEBUG(0,("getlmhostsent: invalid name %s containing '#'.\n", name));
-        continue;
-      }
-
-      *(--ptr1) = '\0'; /* Truncate at the '#' */
-    }
-
-    return True;
-  }
-
-  return False;
-}
-
-/********************************************************
- Finish parsing the lmhosts file.
-*********************************************************/
-
-void endlmhosts(XFILE *fp)
-{
-       x_fclose(fp);
-}
-
-
 /********************************************************
  Resolve via "bcast" method.
 *********************************************************/
index 77d1dbe26e031d855471d6ad472758c8a318a0c4..06dda984ee18af60e0985d45892780def1e4c1fd 100644 (file)
@@ -89,8 +89,7 @@ typedef char pstring[PSTRING_LEN];
 typedef char fstring[FSTRING_LEN];
 #endif
 
-#ifndef _BOOL
-#define _BOOL                  /* So we don't typedef BOOL again in vfs.h */
+#ifndef Auto
 #define False (0)
 #define True (1)
 #define Auto (2)
index 37595c7a4f1cac33583a7b7d1c9b20d2dffbb958..c535509ca6080afc2a583f5183b5d5d6dd80e881 100644 (file)
@@ -53,6 +53,7 @@
  */
 
 #include "includes.h"
+#include "dynconfig.h"
 #include "system/time.h"
 #include "system/iconv.h"
 #include "system/network.h"
index ff311c6680dd8763071863c6ee479d9b59bd6e38..44db95cdad00f132ea68756056b3244c4e6f8da3 100644 (file)
@@ -1,4 +1,5 @@
 #include "includes.h"
+#include "dynconfig.h"
 
 /*
 
index c7ed8eb7711ef4cad2bea6433bd4bd13d6d85f75..07ad0929dec16bdcaf74be3e363a7f3a6fb9dea2 100644 (file)
@@ -19,6 +19,7 @@
 */
 
 #include "includes.h"
+#include "dynconfig.h"
 #include "system/time.h"
 #include "request.h"
 #include "libcli/raw/libcliraw.h"
index 246178551270bd9ef0cb297ab8381a8e580eb0fa..6c55190d6b535a751503b82f8fdf58cc2f5c8e1f 100644 (file)
@@ -19,6 +19,7 @@
 */
 
 #include "includes.h"
+#include "dynconfig.h"
 #include "system/time.h"
 
 static int numops = 1000;
index 964d000d49833c6c2416d947f3af14c70ed06de3..ad5f70300852b2b71e0944dfea5e7a76a7d0d5da 100644 (file)
@@ -19,6 +19,7 @@
 */
 
 #include "includes.h"
+#include "dynconfig.h"
 #include "client.h"
 #include "libcli/raw/libcliraw.h"
 #include "system/time.h"
index 6d68f03967244af06b624a808073828cd0567cc3..656607d93448246c0605500299f1306aaf4566b6 100644 (file)
@@ -19,6 +19,7 @@
 */
 
 #include "includes.h"
+#include "dynconfig.h"
 #include "client.h"
 #include "lib/cmdline/popt_common.h"
 #include "libcli/raw/libcliraw.h"
index 3409101b7138a950e6bd43f585ad358ed0befa8a..380afd61203f2dac37509d9d636858d7583b45d3 100644 (file)
@@ -42,6 +42,7 @@
 /*****************************************************/
 
 #include "includes.h"
+#include "dynconfig.h"
 #include "utils/net/net.h"
 #include "lib/cmdline/popt_common.h"
 
index 14f8e46b2125ccd57a2e67b248f5df0f9e0cb96e..b038ad98793337a00fe82e82c727966202a27f37 100644 (file)
@@ -23,6 +23,7 @@
 */
 
 #include "includes.h"
+#include "dynconfig.h"
 #include "system/passwd.h"
 #include "lib/cmdline/popt_common.h"
 #include "auth/auth.h"