svn commit: samba r24816 - in branches/SAMBA_4_0: . source/include source/libcli source/librpc/idl source/ntvfs/common source/param source/pidl/lib/Parse/Pidl source/pidl/lib/Parse/Pidl/Samba4 source/pidl/tests source/torture

jelmer at samba.org jelmer at samba.org
Fri Aug 31 00:31:34 GMT 2007


Author: jelmer
Date: 2007-08-31 00:31:32 +0000 (Fri, 31 Aug 2007)
New Revision: 24816

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=24816

Log:
Move the rest of the contents of core.h to more appropriate places. 
include/ now only contains build system related headers, all other headers are 
now near the source code they're related to.

Removed:
   branches/SAMBA_4_0/source/include/core.h
Modified:
   branches/SAMBA_4_0/
   branches/SAMBA_4_0/source/include/includes.h
   branches/SAMBA_4_0/source/libcli/libcli.h
   branches/SAMBA_4_0/source/librpc/idl/security.idl
   branches/SAMBA_4_0/source/ntvfs/common/brlock.h
   branches/SAMBA_4_0/source/param/loadparm.h
   branches/SAMBA_4_0/source/param/param.h
   branches/SAMBA_4_0/source/pidl/lib/Parse/Pidl/Samba4/Header.pm
   branches/SAMBA_4_0/source/pidl/lib/Parse/Pidl/Util.pm
   branches/SAMBA_4_0/source/pidl/tests/util.pl
   branches/SAMBA_4_0/source/torture/locktest.c


Changeset:

Property changes on: branches/SAMBA_4_0
___________________________________________________________________
Name: bzr:revision-info
...skipped...
Name: bzr:revision-id:v3-trunk0
...skipped...

Deleted: branches/SAMBA_4_0/source/include/core.h
===================================================================
--- branches/SAMBA_4_0/source/include/core.h	2007-08-31 00:03:54 UTC (rev 24815)
+++ branches/SAMBA_4_0/source/include/core.h	2007-08-31 00:31:32 UTC (rev 24816)
@@ -1,69 +0,0 @@
-/* 
-   Unix SMB/CIFS implementation.
-   Core Samba data types
-
-   Copyright (C) Andrew Tridgell              1992-2000
-   Copyright (C) Stefan Metzmacher			  2004
-   Copyright (C) Jelmer Vernooij			  2005
-   
-   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 3 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, see <http://www.gnu.org/licenses/>.
-*/
-
-#ifndef _SAMBA_CORE_H
-#define _SAMBA_CORE_H
-
-#include "libcli/util/nt_status.h"
-
-#include <stdlib.h>
-
-/* 
-   use the same structure for dom_sid2 as dom_sid. A dom_sid2 is really
-   just a dom sid, but with the sub_auths represented as a conformant
-   array. As with all in-structure conformant arrays, the array length
-   is placed before the start of the structure. That's what gives rise
-   to the extra num_auths elemenent. We don't want the Samba code to
-   have to bother with such esoteric NDR details, so its easier to just
-   define it as a dom_sid and use pidl magic to make it all work. It
-   just means you need to mark a sid as a "dom_sid2" in the IDL when you
-   know it is of the conformant array variety
-*/
-#define dom_sid2 dom_sid
-
-/* same struct as dom_sid but inside a 28 bytes fixed buffer in NDR */
-#define dom_sid28 dom_sid
-
-
-
-/* passed to br lock code. FIXME: Move to one of the smb-specific headers */
-enum brl_type {
-	READ_LOCK,
-	WRITE_LOCK,
-	PENDING_READ_LOCK,
-	PENDING_WRITE_LOCK
-};
-
-enum server_role {
-	ROLE_STANDALONE=0,
-	ROLE_DOMAIN_MEMBER=1,
-	ROLE_DOMAIN_CONTROLLER=2,
-};
-
-enum announce_as {/* Types of machine we can announce as. */
-	ANNOUNCE_AS_NT_SERVER=1,
-	ANNOUNCE_AS_WIN95=2,
-	ANNOUNCE_AS_WFW=3,
-	ANNOUNCE_AS_NT_WORKSTATION=4
-};
-
-#endif /* _SAMBA_CORE_H */

Modified: branches/SAMBA_4_0/source/include/includes.h
===================================================================
--- branches/SAMBA_4_0/source/include/includes.h	2007-08-31 00:03:54 UTC (rev 24815)
+++ branches/SAMBA_4_0/source/include/includes.h	2007-08-31 00:31:32 UTC (rev 24816)
@@ -109,9 +109,10 @@
 #endif
 
 /* Lists, trees, caching, database... */
+#include <stdlib.h>
+#include <stdbool.h>
 #include <talloc.h>
-#include "core.h"
-#include <stdbool.h>
+#include "libcli/util/nt_status.h"
 #include "charset/charset.h"
 #include "util/util.h"
 #include "param/param.h"

Modified: branches/SAMBA_4_0/source/libcli/libcli.h
===================================================================
--- branches/SAMBA_4_0/source/libcli/libcli.h	2007-08-31 00:03:54 UTC (rev 24815)
+++ branches/SAMBA_4_0/source/libcli/libcli.h	2007-08-31 00:31:32 UTC (rev 24816)
@@ -50,6 +50,17 @@
 
 struct cli_credentials;
 struct event_context;
+
+/* passed to br lock code. */
+enum brl_type {
+	READ_LOCK,
+	WRITE_LOCK,
+	PENDING_READ_LOCK,
+	PENDING_WRITE_LOCK
+};
+
+
+
 #include "libcli/raw/libcliraw.h"
 #include "libcli/libcli_proto.h"
 

Modified: branches/SAMBA_4_0/source/librpc/idl/security.idl
===================================================================
--- branches/SAMBA_4_0/source/librpc/idl/security.idl	2007-08-31 00:03:54 UTC (rev 24815)
+++ branches/SAMBA_4_0/source/librpc/idl/security.idl	2007-08-31 00:31:32 UTC (rev 24816)
@@ -6,6 +6,22 @@
 
 import "misc.idl";
 
+/* 
+   use the same structure for dom_sid2 as dom_sid. A dom_sid2 is really
+   just a dom sid, but with the sub_auths represented as a conformant
+   array. As with all in-structure conformant arrays, the array length
+   is placed before the start of the structure. That's what gives rise
+   to the extra num_auths elemenent. We don't want the Samba code to
+   have to bother with such esoteric NDR details, so its easier to just
+   define it as a dom_sid and use pidl magic to make it all work. It
+   just means you need to mark a sid as a "dom_sid2" in the IDL when you
+   know it is of the conformant array variety
+*/
+cpp_quote("#define dom_sid2 dom_sid")
+
+/* same struct as dom_sid but inside a 28 bytes fixed buffer in NDR */
+cpp_quote("#define dom_sid28 dom_sid")
+
 [
 	pointer_default(unique)
 ]

Modified: branches/SAMBA_4_0/source/ntvfs/common/brlock.h
===================================================================
--- branches/SAMBA_4_0/source/ntvfs/common/brlock.h	2007-08-31 00:03:54 UTC (rev 24815)
+++ branches/SAMBA_4_0/source/ntvfs/common/brlock.h	2007-08-31 00:31:32 UTC (rev 24816)
@@ -19,6 +19,8 @@
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
 
+#include "libcli/libcli.h"
+
 struct brlock_ops {
 	struct brl_context *(*brl_init)(TALLOC_CTX *, struct server_id , 
 					struct messaging_context *);

Modified: branches/SAMBA_4_0/source/param/loadparm.h
===================================================================
--- branches/SAMBA_4_0/source/param/loadparm.h	2007-08-31 00:03:54 UTC (rev 24815)
+++ branches/SAMBA_4_0/source/param/loadparm.h	2007-08-31 00:31:32 UTC (rev 24816)
@@ -78,3 +78,4 @@
 #define HOMES_NAME "homes"
 #endif
 
+

Modified: branches/SAMBA_4_0/source/param/param.h
===================================================================
--- branches/SAMBA_4_0/source/param/param.h	2007-08-31 00:03:54 UTC (rev 24815)
+++ branches/SAMBA_4_0/source/param/param.h	2007-08-31 00:31:32 UTC (rev 24816)
@@ -44,6 +44,21 @@
 
 typedef NTSTATUS (*init_module_fn) (void);
 
+enum server_role {
+	ROLE_STANDALONE=0,
+	ROLE_DOMAIN_MEMBER=1,
+	ROLE_DOMAIN_CONTROLLER=2,
+};
+
+enum announce_as {/* Types of machine we can announce as. */
+	ANNOUNCE_AS_NT_SERVER=1,
+	ANNOUNCE_AS_WIN95=2,
+	ANNOUNCE_AS_WFW=3,
+	ANNOUNCE_AS_NT_WORKSTATION=4
+};
+
+
+
 #include "param/proto.h"
 
 #endif /* _PARAM_H */

Modified: branches/SAMBA_4_0/source/pidl/lib/Parse/Pidl/Samba4/Header.pm
===================================================================
--- branches/SAMBA_4_0/source/pidl/lib/Parse/Pidl/Samba4/Header.pm	2007-08-31 00:03:54 UTC (rev 24815)
+++ branches/SAMBA_4_0/source/pidl/lib/Parse/Pidl/Samba4/Header.pm	2007-08-31 00:31:32 UTC (rev 24816)
@@ -9,7 +9,7 @@
 use strict;
 use Parse::Pidl qw(fatal);
 use Parse::Pidl::Typelist qw(mapTypeName scalar_is_reference);
-use Parse::Pidl::Util qw(has_property is_constant);
+use Parse::Pidl::Util qw(has_property is_constant unmake_str);
 use Parse::Pidl::Samba4 qw(is_intree ElementStars ArrayBrackets);
 
 use vars qw($VERSION);
@@ -375,7 +375,7 @@
 {
 	my($quote) = shift;
 
-	pidl $quote->{DATA};
+	pidl unmake_str($quote->{DATA}) . "\n";
 }
 
 #####################################################################

Modified: branches/SAMBA_4_0/source/pidl/lib/Parse/Pidl/Util.pm
===================================================================
--- branches/SAMBA_4_0/source/pidl/lib/Parse/Pidl/Util.pm	2007-08-31 00:03:54 UTC (rev 24815)
+++ branches/SAMBA_4_0/source/pidl/lib/Parse/Pidl/Util.pm	2007-08-31 00:31:32 UTC (rev 24816)
@@ -6,7 +6,7 @@
 
 require Exporter;
 @ISA = qw(Exporter);
- at EXPORT = qw(has_property property_matches ParseExpr ParseExprExt is_constant make_str print_uuid MyDumper);
+ at EXPORT = qw(has_property property_matches ParseExpr ParseExprExt is_constant make_str unmake_str print_uuid MyDumper);
 use vars qw($VERSION);
 $VERSION = '0.01';
 
@@ -104,6 +104,19 @@
 	return "\"$str\"";
 }
 
+=item B<unmake_str>
+unquote a "" quoted string
+
+=cut
+sub unmake_str($)
+{
+	my $str = shift;
+	
+	$str =~ s/^\"(.*)\"$/$1/;
+
+	return $str;
+}
+
 =item B<print_uuid>
 Print C representation of a UUID.
 

Modified: branches/SAMBA_4_0/source/pidl/tests/util.pl
===================================================================
--- branches/SAMBA_4_0/source/pidl/tests/util.pl	2007-08-31 00:03:54 UTC (rev 24815)
+++ branches/SAMBA_4_0/source/pidl/tests/util.pl	2007-08-31 00:31:32 UTC (rev 24816)
@@ -4,7 +4,7 @@
 use strict;
 use warnings;
 
-use Test::More tests => 70;
+use Test::More tests => 72;
 use FindBin qw($RealBin);
 use lib "$RealBin";
 use Util;
@@ -33,6 +33,9 @@
 is("\"bla\"\"", make_str("bla\""));
 is("\"foo\"bar\"", make_str("foo\"bar"));
 
+is("bla", unmake_str("\"bla\""));
+is("\"bla\"", unmake_str("\"\"bla\"\""));
+
 # print_uuid()
 is(undef, print_uuid("invalid"));
 is("{0x12345778,0x1234,0xabcd,{0xef,0x00},{0x01,0x23,0x45,0x67,0x89,0xac}}", 

Modified: branches/SAMBA_4_0/source/torture/locktest.c
===================================================================
--- branches/SAMBA_4_0/source/torture/locktest.c	2007-08-31 00:03:54 UTC (rev 24815)
+++ branches/SAMBA_4_0/source/torture/locktest.c	2007-08-31 00:31:32 UTC (rev 24816)
@@ -191,7 +191,7 @@
 
 
 
-static BOOL test_one(struct smbcli_state *cli[NSERVERS][NCONNECTIONS], 
+static bool test_one(struct smbcli_state *cli[NSERVERS][NCONNECTIONS], 
 		     int fnum[NSERVERS][NCONNECTIONS][NFILES],
 		     struct record *rec)
 {



More information about the samba-cvs mailing list