s3:registry: extract reg_perfcount prototypes into header of their own.
authorMichael Adam <obnox@samba.org>
Mon, 24 May 2010 20:59:04 +0000 (22:59 +0200)
committerMichael Adam <obnox@samba.org>
Tue, 25 May 2010 08:35:26 +0000 (10:35 +0200)
And use them only when necessary.

source3/include/registry.h
source3/registry/reg_backend_hkpt_params.c
source3/registry/reg_backend_perflib.c
source3/registry/reg_init_full.c
source3/registry/reg_perfcount.c
source3/registry/reg_perfcount.h [new file with mode: 0644]
source3/rpc_server/srv_winreg_nt.c

index a36c8dae9e47e0dcb2b6a0c7b571caca4fdeda90..3496f13c49fc9ebb44f53312cbea9d93c3a7d32e 100644 (file)
@@ -77,16 +77,6 @@ NTSTATUS registry_create_admin_token(TALLOC_CTX *mem_ctx,
                                     NT_USER_TOKEN **ptoken);
 WERROR registry_init_smbconf(const char *keyname);
 
-/* The following definitions come from registry/reg_perfcount.c  */
-
-void perfcount_init_keys( void );
-uint32 reg_perfcount_get_base_index(void);
-uint32 reg_perfcount_get_last_counter(uint32 base_index);
-uint32 reg_perfcount_get_last_help(uint32 last_counter);
-uint32 reg_perfcount_get_counter_help(uint32 base_index, char **retbuf);
-uint32 reg_perfcount_get_counter_names(uint32 base_index, char **retbuf);
-WERROR reg_perfcount_get_hkpd(prs_struct *ps, uint32 max_buf_size, uint32 *outbuf_len, const char *object_ids);
-
 /* The following definitions come from lib/util_reg_api.c  */
 
 WERROR registry_pull_value(TALLOC_CTX *mem_ctx,
index f0212f3e1b23be34017ada546b296a0c70f1c9d3..a303e72517e65b80a64a339f858de8842a7a92bd 100644 (file)
@@ -26,6 +26,7 @@
 
 #include "includes.h"
 #include "registry.h"
+#include "reg_perfcount.h"
 
 #undef DBGC_CLASS
 #define DBGC_CLASS DBGC_REGISTRY
index 35564b43095cbeedb46d45df86168d12171280fb..f13c37ac2bd37f3a6acc79bfc1051a14bd518e40 100644 (file)
@@ -27,6 +27,7 @@
 #include "includes.h"
 #include "registry.h"
 #include "reg_util.h"
+#include "reg_perfcount.h"
 
 #undef DBGC_CLASS
 #define DBGC_CLASS DBGC_REGISTRY
index 2eec48a8ea6516ae233b8b7eb6d02b620aa19cbf..a3604e6c3875fbeb6ded5528f85245c3f165064d 100644 (file)
@@ -24,6 +24,7 @@
 #include "registry.h"
 #include "reg_cachehook.h"
 #include "reg_backend_db.h"
+#include "reg_perfcount.h"
 
 #undef DBGC_CLASS
 #define DBGC_CLASS DBGC_REGISTRY
index d71f40ce31fb40e28730ca060c5bdb9b134c4f66..c53036fc8bf33f4e77d30738f8be1cc06b3ccc53 100644 (file)
@@ -22,6 +22,7 @@
 #include "includes.h"
 #include "../librpc/gen_ndr/perfcount.h"
 #include "registry.h"
+#include "reg_perfcount.h"
 
 #undef DBGC_CLASS
 #define DBGC_CLASS DBGC_REGISTRY
diff --git a/source3/registry/reg_perfcount.h b/source3/registry/reg_perfcount.h
new file mode 100644 (file)
index 0000000..c6b76a5
--- /dev/null
@@ -0,0 +1,33 @@
+/* 
+ *  Unix SMB/CIFS implementation.
+ *  Virtual Windows Registry Layer
+ *
+ *  Copyright (C) Marcin Krzysztof Porwit    2005,
+ *  Copyright (C) Gerald (Jerry) Carter      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 _REG_PERFCOUNT_H
+#define _REG_PERFCOUNT_H
+
+void perfcount_init_keys( void );
+uint32 reg_perfcount_get_base_index(void);
+uint32 reg_perfcount_get_last_counter(uint32 base_index);
+uint32 reg_perfcount_get_last_help(uint32 last_counter);
+uint32 reg_perfcount_get_counter_help(uint32 base_index, char **retbuf);
+uint32 reg_perfcount_get_counter_names(uint32 base_index, char **retbuf);
+WERROR reg_perfcount_get_hkpd(prs_struct *ps, uint32 max_buf_size, uint32 *outbuf_len, const char *object_ids);
+
+#endif /* _REG_PERFCOUNT_H */
index 9f8c75acea17130afc9bf80f17eb10dd5e512944..b84740ba041b5a9049121bea0b037bb39c97c47d 100644 (file)
@@ -23,6 +23,7 @@
 #include "includes.h"
 #include "../librpc/gen_ndr/srv_winreg.h"
 #include "registry.h"
+#include "registry/reg_perfcount.h"
 
 #undef DBGC_CLASS
 #define DBGC_CLASS DBGC_RPC_SRV