r12523: Convert the registry subsystem to use a seperate prototype header
authorJelmer Vernooij <jelmer@samba.org>
Tue, 27 Dec 2005 21:11:09 +0000 (21:11 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 18:47:51 +0000 (13:47 -0500)
(note that this doesn't use the distinction between private
 and public prototypes yet)
(This used to be commit 60e11f575821c1762b25ad66441b6e69ad1167ef)

source4/build/smb_build/input.pm
source4/build/smb_build/makefile.pm
source4/include/structs.h
source4/lib/registry/config.mk
source4/lib/registry/registry.h
source4/main.mk
source4/smbd/server.c
source4/torture/local/registry.c

index 53cd0f218eadf383bc31643293391d93415eddf7..ad0a27512083fcf138d096e264fce191d41b5cce 100644 (file)
@@ -140,10 +140,14 @@ sub check($$$$$)
                        $part->{NOPROTO} = "NO";
                }
 
-               if (defined($part->{PRIVATE_PROTO_HEADER}) or 
-                       defined($part->{PUBLIC_PROTO_HEADER})) {
+               if (defined($part->{PRIVATE_PROTO_HEADER})) {
                        $part->{NOPROTO} = "YES";
                }
+               
+               if (defined($part->{PUBLIC_PROTO_HEADER})) {
+                       $part->{NOPROTO} = "YES";
+                       push (@{$part->{PUBLIC_HEADERS}}, $part->{PUBLIC_PROTO_HEADER});
+               }
 
                if (defined($enabled->{$part->{NAME}})) { 
                        $part->{ENABLE} = $enabled->{$part->{NAME}};
index bae6fd5b93469917ac49fbe499a4c2bbbee53a49..4669180b5666a082a4b55509c7d711b78071932d 100644 (file)
@@ -25,6 +25,7 @@ sub new($$$)
        $self->{shared_libs} = [];
        $self->{headers} = [];
        $self->{pc_files} = [];
+       $self->{proto_headers} = [];
        $self->{output} = "";
 
        $self->{mkfile} = $mkfile;
@@ -426,7 +427,7 @@ sub Manpage($$)
 
        my $dir = $ctx->{BASEDIR};
        
-       $ctx->{BASEDIR} =~ s/^\.\///g;
+       $dir =~ s/^\.\///g;
 
        push (@{$self->{manpages}}, "$dir/$ctx->{MANPAGE}");
 }
@@ -464,17 +465,19 @@ sub ProtoHeader($$)
        my ($self,$ctx) = @_;
 
        my $dir = $ctx->{BASEDIR};
-       $ctx->{BASEDIR} =~ s/^\.\///g;
+
+       $dir =~ s/^\.\///g;
 
        my $comment = "";
-       my $target = "$dir/$ctx->{PRIVATE_PROTO_HEADER}";
        if (defined($ctx->{PUBLIC_PROTO_HEADER})) {
-               $comment.= " and $dir/$ctx->{PRIVATE_PROTO_HEADER}";
+               $comment.= " and $dir/$ctx->{PUBLIC_PROTO_HEADER}";
+               push (@{$self->{proto_headers}}, "$dir/$ctx->{PUBLIC_PROTO_HEADER}");
        } else {
                $ctx->{PUBLIC_PROTO_HEADER} = $ctx->{PRIVATE_PROTO_HEADER};
        }       
+       push (@{$self->{proto_headers}}, "$dir/$ctx->{PRIVATE_PROTO_HEADER}");
 
-       $self->output("$target: \$($ctx->{TYPE}_$ctx->{NAME}_OBJ_LIST:.o=.c)\n");
+       $self->output("$dir/$ctx->{PUBLIC_PROTO_HEADER}: \$($ctx->{TYPE}_$ctx->{NAME}_OBJ_LIST:.o=.c)\n");
        $self->output("\t\@echo \"Creating $dir/$ctx->{PRIVATE_PROTO_HEADER}$comment\"\n");
 
        $self->output("\t\@\$(PERL) \${srcdir}/script/mkproto.pl --private=$dir/$ctx->{PRIVATE_PROTO_HEADER} --public=$dir/$ctx->{PUBLIC_PROTO_HEADER} \$($ctx->{TYPE}_$ctx->{NAME}_OBJ_LIST)\n\n");
@@ -494,6 +497,7 @@ sub write($$)
        $self->output("PC_FILES = " . array2oneperline($self->{pc_files}) . "\n");
        $self->output("ALL_OBJS = " . array2oneperline($self->{all_objs}) . "\n");
        $self->output("PROTO_OBJS = " . array2oneperline($self->{proto_objs}) .  "\n");
+       $self->output("PROTO_HEADERS = " . array2oneperline($self->{proto_headers}) .  "\n");
 
        $self->_prepare_mk_files();
 
index 39226cacbc0638e74c326d6df8353dba73763f44..153902d13a2e9d255d037a2a8b9db627c212edbb 100644 (file)
@@ -138,10 +138,6 @@ struct ldap_connection;
 struct ldap_message;
 struct ldap_Result;
 struct rw_buffer;
-struct registry_context;
-struct registry_key;
-struct registry_value;
-struct reg_diff_file;
 
 struct rap_NetShareEnum;
 struct rap_NetServerEnum2;
@@ -375,3 +371,5 @@ struct IUnknown;
 struct IUnknown_vtable;
 
 struct MprVar;
+
+struct registry_context;
index 9d949a5c1dd2a115d16c4e826daf723cabe284c1..3f63c5be98e86a6a19653fe202fb5abcbc304037 100644 (file)
@@ -90,6 +90,7 @@ OBJ_FILES = \
                patchfile.o
 REQUIRED_SUBSYSTEMS = \
                LIBBASIC
+PRIVATE_PROTO_HEADER = registry_proto.h
 PUBLIC_HEADERS = registry.h
 # End MODULE registry_ldb
 ################################################
index ebfb2caf5c7008e211020e3fec4aad5e27ae7e69..7f57a9244d22822ead891be8e87e14c7eae53b23 100644 (file)
@@ -161,4 +161,6 @@ struct reg_diff
        struct reg_diff_key *keys;
 };
 
+#include "registry_proto.h"
+
 #endif /* _REGISTRY_H */
index 2bafa588d6309cd27375cec0da1b05dd0faf25ac..b185ec97e4c0c8e0f5b11b7b5f1fbdb7c9d94f11 100644 (file)
@@ -216,7 +216,8 @@ clean_pch:
 basics: include/config.h \
        include/proto.h \
        idl \
-       heimdal_basics
+       heimdal_basics \
+       $(PROTO_HEADERS)
 
 clean: heimdal_clean
        @echo Removing headers
@@ -234,6 +235,8 @@ clean: heimdal_clean
        @echo Removing generated files
        @-rm -rf librpc/gen_* 
        @-rm -f lib/registry/regf.h lib/registry/tdr_regf*
+       @echo Removing proto headers
+       @-rm -f $(PROTO_HEADERS)
 
 distclean: clean
        -rm -f bin/.dummy 
index 9fa7cad0c7f309805d55649fb5c535331699ab78..a753a1668bb09d8a074ff0c3bbc5da0ed148ff69 100644 (file)
@@ -31,6 +31,7 @@
 #include "system/filesys.h"
 #include "system/kerberos.h"
 #include "smb_build.h"
+#include "registry/registry.h"
 
 /*
   recursively delete a directory tree
index 5e7f2b0f5ff55bd53d5fb003702fc51c0cc52583..21b42d6129fa49e195199d82472c80bbcfdd1339 100644 (file)
@@ -23,6 +23,7 @@
 #include "includes.h"
 #include "librpc/gen_ndr/security.h"
 #include "librpc/gen_ndr/ndr_epmapper.h"
+#include "lib/registry/registry.h"
 
 static BOOL test_hive(TALLOC_CTX *mem_ctx, const char *backend, const char *location)
 {