[SCM] Samba Shared Repository - branch master updated

Günther Deschner gd at samba.org
Thu May 6 05:42:20 MDT 2010


The branch, master has been updated
       via  049416c... s3-spoolss: make several notify functions static.
       via  d2d7174... s3-eventlog: move all eventlog headers to lib/eventlog and only include where required.
      from  0dfe1b9... s3: fix the merged build - it required $LD

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 049416c285026c03fffc2e27225bfef5c2f16469
Author: Günther Deschner <gd at samba.org>
Date:   Wed Apr 28 01:38:08 2010 +0200

    s3-spoolss: make several notify functions static.
    
    Guenther

commit d2d7174394c1283a3ae8e313f9a6d97df8708334
Author: Günther Deschner <gd at samba.org>
Date:   Thu May 6 11:42:52 2010 +0200

    s3-eventlog: move all eventlog headers to lib/eventlog and only include where required.
    
    Guenther

-----------------------------------------------------------------------

Summary of changes:
 source3/include/eventlog.h           |   41 -------------
 source3/include/includes.h           |    1 -
 source3/include/proto.h              |  105 ----------------------------------
 source3/lib/eventlog/eventlog.c      |    1 +
 source3/lib/eventlog/eventlog.h      |   43 ++++++++++++++
 source3/lib/eventlog/proto.h         |   35 +++++++++++
 source3/rpc_server/srv_eventlog_nt.c |    1 +
 source3/rpc_server/srv_spoolss_nt.c  |   31 ++++++----
 source3/utils/eventlogadm.c          |    1 +
 source3/utils/net_eventlog.c         |    1 +
 10 files changed, 100 insertions(+), 160 deletions(-)
 delete mode 100644 source3/include/eventlog.h
 create mode 100644 source3/lib/eventlog/eventlog.h
 create mode 100644 source3/lib/eventlog/proto.h


Changeset truncated at 500 lines:

diff --git a/source3/include/eventlog.h b/source3/include/eventlog.h
deleted file mode 100644
index 16affe3..0000000
--- a/source3/include/eventlog.h
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- *  Unix SMB/CIFS implementation.
- *  RPC Pipe client / server routines
- *  Copyright (C) Marcin Krzysztof Porwit    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/>.
- */
-
-/* Defines for TDB keys */
-#define  EVT_OLDEST_ENTRY  "INFO/oldest_entry"
-#define  EVT_NEXT_RECORD   "INFO/next_record"
-#define  EVT_VERSION       "INFO/version"
-#define  EVT_MAXSIZE       "INFO/maxsize"
-#define  EVT_RETENTION     "INFO/retention"
-
-#define ELOG_APPL	"Application"
-#define ELOG_SYS	"System"
-#define ELOG_SEC	"Security"
-
-typedef struct elog_tdb {
-	struct elog_tdb *prev, *next;
-	char *name;
-	TDB_CONTEXT *tdb;
-	int ref_count;
-} ELOG_TDB;
-
-#define ELOG_TDB_CTX(x) ((x)->tdb)
-
-
-#define  EVENTLOG_DATABASE_VERSION_V1    1
diff --git a/source3/include/includes.h b/source3/include/includes.h
index 5b682bb..9ab2556 100644
--- a/source3/include/includes.h
+++ b/source3/include/includes.h
@@ -686,7 +686,6 @@ struct ntlmssp_state;
 #include "../lib/async_req/async_sock.h"
 #include "talloc_dict.h"
 #include "services.h"
-#include "eventlog.h"
 #include "../lib/util/smb_threads.h"
 #include "../lib/util/smb_threads_internal.h"
 #include "tldap.h"
diff --git a/source3/include/proto.h b/source3/include/proto.h
index 9c169ed..e16cae5 100644
--- a/source3/include/proto.h
+++ b/source3/include/proto.h
@@ -2107,7 +2107,6 @@ WERROR reg_apply_registry_entry(TALLOC_CTX *mem_ctx,
 				uint32_t flags);
 
 
-#include "librpc/gen_ndr/ndr_eventlog.h"
 #include "librpc/gen_ndr/ndr_krb5pac.h"
 #include "librpc/gen_ndr/ndr_spoolss.h"
 
@@ -5760,41 +5759,6 @@ void init_rpc_hdr_auth(RPC_HDR_AUTH *rai,
 				uint32 auth_context_id);
 bool smb_io_rpc_hdr_auth(const char *desc, RPC_HDR_AUTH *rai, prs_struct *ps, int depth);
 
-/* The following definitions come from lib/eventlog/eventlog.c  */
-
-TDB_CONTEXT *elog_init_tdb( char *tdbfilename );
-char *elog_tdbname(TALLOC_CTX *ctx, const char *name );
-int elog_tdb_size( TDB_CONTEXT * tdb, int *MaxSize, int *Retention );
-bool prune_eventlog( TDB_CONTEXT * tdb );
-ELOG_TDB *elog_open_tdb( const char *logname, bool force_clear, bool read_only );
-int elog_close_tdb( ELOG_TDB *etdb, bool force_close );
-bool parse_logentry( TALLOC_CTX *mem_ctx, char *line, struct eventlog_Record_tdb *entry, bool * eor );
-size_t fixup_eventlog_record_tdb(struct eventlog_Record_tdb *r);
-struct eventlog_Record_tdb *evlog_pull_record_tdb(TALLOC_CTX *mem_ctx,
-						  TDB_CONTEXT *tdb,
-						  uint32_t record_number);
-NTSTATUS evlog_push_record_tdb(TALLOC_CTX *mem_ctx,
-			       TDB_CONTEXT *tdb,
-			       struct eventlog_Record_tdb *r,
-			       uint32_t *record_number);
-NTSTATUS evlog_push_record(TALLOC_CTX *mem_ctx,
-			   TDB_CONTEXT *tdb,
-			   struct EVENTLOGRECORD *r,
-			   uint32_t *record_number);
-struct EVENTLOGRECORD *evlog_pull_record(TALLOC_CTX *mem_ctx,
-					 TDB_CONTEXT *tdb,
-					 uint32_t record_number);
-NTSTATUS evlog_evt_entry_to_tdb_entry(TALLOC_CTX *mem_ctx,
-				      const struct EVENTLOGRECORD *e,
-				      struct eventlog_Record_tdb *t);
-NTSTATUS evlog_tdb_entry_to_evt_entry(TALLOC_CTX *mem_ctx,
-				      const struct eventlog_Record_tdb *t,
-				      struct EVENTLOGRECORD *e);
-NTSTATUS evlog_convert_tdb_to_evt(TALLOC_CTX *mem_ctx,
-				  ELOG_TDB *etdb,
-				  DATA_BLOB *blob_p,
-				  uint32_t *num_records_p);
-
 /* The following definitions come from rpc_server/srv_eventlog_nt.c  */
 
 /* The following definitions come from rpc_server/srv_lsa_hnd.c  */
@@ -5928,75 +5892,6 @@ bool convert_devicemode(const char *printername,
 WERROR set_printer_dataex(NT_PRINTER_INFO_LEVEL *printer,
 			  const char *key, const char *value,
 			  uint32_t type, uint8_t *data, int real_len);
-void spoolss_notify_server_name(int snum,
-				       struct spoolss_Notify *data,
-				       print_queue_struct *queue,
-				       NT_PRINTER_INFO_LEVEL *printer,
-				       TALLOC_CTX *mem_ctx);
-void spoolss_notify_printer_name(int snum,
-					struct spoolss_Notify *data,
-					print_queue_struct *queue,
-					NT_PRINTER_INFO_LEVEL *printer,
-					TALLOC_CTX *mem_ctx);
-void spoolss_notify_share_name(int snum,
-				      struct spoolss_Notify *data,
-				      print_queue_struct *queue,
-				      NT_PRINTER_INFO_LEVEL *printer,
-				      TALLOC_CTX *mem_ctx);
-void spoolss_notify_port_name(int snum,
-				     struct spoolss_Notify *data,
-				     print_queue_struct *queue,
-				     NT_PRINTER_INFO_LEVEL *printer,
-				     TALLOC_CTX *mem_ctx);
-void spoolss_notify_driver_name(int snum,
-				       struct spoolss_Notify *data,
-				       print_queue_struct *queue,
-				       NT_PRINTER_INFO_LEVEL *printer,
-				       TALLOC_CTX *mem_ctx);
-void spoolss_notify_comment(int snum,
-				   struct spoolss_Notify *data,
-				   print_queue_struct *queue,
-				   NT_PRINTER_INFO_LEVEL *printer,
-				   TALLOC_CTX *mem_ctx);
-void spoolss_notify_location(int snum,
-				    struct spoolss_Notify *data,
-				    print_queue_struct *queue,
-				    NT_PRINTER_INFO_LEVEL *printer,
-				    TALLOC_CTX *mem_ctx);
-void spoolss_notify_sepfile(int snum,
-				   struct spoolss_Notify *data,
-				   print_queue_struct *queue,
-				   NT_PRINTER_INFO_LEVEL *printer,
-				   TALLOC_CTX *mem_ctx);
-void spoolss_notify_print_processor(int snum,
-					   struct spoolss_Notify *data,
-					   print_queue_struct *queue,
-					   NT_PRINTER_INFO_LEVEL *printer,
-					   TALLOC_CTX *mem_ctx);
-void spoolss_notify_parameters(int snum,
-				      struct spoolss_Notify *data,
-				      print_queue_struct *queue,
-				      NT_PRINTER_INFO_LEVEL *printer,
-				      TALLOC_CTX *mem_ctx);
-void spoolss_notify_datatype(int snum,
-				    struct spoolss_Notify *data,
-				    print_queue_struct *queue,
-				    NT_PRINTER_INFO_LEVEL *printer,
-				    TALLOC_CTX *mem_ctx);
-void spoolss_notify_attributes(int snum,
-				      struct spoolss_Notify *data,
-				      print_queue_struct *queue,
-				      NT_PRINTER_INFO_LEVEL *printer,
-				      TALLOC_CTX *mem_ctx);
-void spoolss_notify_cjobs(int snum,
-				 struct spoolss_Notify *data,
-				 print_queue_struct *queue,
-				 NT_PRINTER_INFO_LEVEL *printer,
-				 TALLOC_CTX *mem_ctx);
-void construct_info_data(struct spoolss_Notify *info_data,
-			 enum spoolss_NotifyType type,
-			 uint16_t field,
-			 int id);
 struct spoolss_DeviceMode *construct_dev_mode(TALLOC_CTX *mem_ctx,
 					      const char *servicename);
 bool add_printer_hook(TALLOC_CTX *ctx, NT_USER_TOKEN *token, NT_PRINTER_INFO_LEVEL *printer);
diff --git a/source3/lib/eventlog/eventlog.c b/source3/lib/eventlog/eventlog.c
index dc14214..c218467 100644
--- a/source3/lib/eventlog/eventlog.c
+++ b/source3/lib/eventlog/eventlog.c
@@ -21,6 +21,7 @@
  */
 
 #include "includes.h"
+#include "lib/eventlog/eventlog.h"
 
 /* maintain a list of open eventlog tdbs with reference counts */
 
diff --git a/source3/lib/eventlog/eventlog.h b/source3/lib/eventlog/eventlog.h
new file mode 100644
index 0000000..29c25c3
--- /dev/null
+++ b/source3/lib/eventlog/eventlog.h
@@ -0,0 +1,43 @@
+/*
+ *  Unix SMB/CIFS implementation.
+ *  RPC Pipe client / server routines
+ *  Copyright (C) Marcin Krzysztof Porwit    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/>.
+ */
+
+/* Defines for TDB keys */
+#define  EVT_OLDEST_ENTRY  "INFO/oldest_entry"
+#define  EVT_NEXT_RECORD   "INFO/next_record"
+#define  EVT_VERSION       "INFO/version"
+#define  EVT_MAXSIZE       "INFO/maxsize"
+#define  EVT_RETENTION     "INFO/retention"
+
+#define ELOG_APPL	"Application"
+#define ELOG_SYS	"System"
+#define ELOG_SEC	"Security"
+
+typedef struct elog_tdb {
+	struct elog_tdb *prev, *next;
+	char *name;
+	TDB_CONTEXT *tdb;
+	int ref_count;
+} ELOG_TDB;
+
+#define ELOG_TDB_CTX(x) ((x)->tdb)
+
+#define  EVENTLOG_DATABASE_VERSION_V1    1
+
+#include "../librpc/gen_ndr/ndr_eventlog.h"
+#include "lib/eventlog/proto.h"
diff --git a/source3/lib/eventlog/proto.h b/source3/lib/eventlog/proto.h
new file mode 100644
index 0000000..21790d0
--- /dev/null
+++ b/source3/lib/eventlog/proto.h
@@ -0,0 +1,35 @@
+
+/* The following definitions come from lib/eventlog/eventlog.c  */
+
+TDB_CONTEXT *elog_init_tdb( char *tdbfilename );
+char *elog_tdbname(TALLOC_CTX *ctx, const char *name );
+int elog_tdb_size( TDB_CONTEXT * tdb, int *MaxSize, int *Retention );
+bool prune_eventlog( TDB_CONTEXT * tdb );
+ELOG_TDB *elog_open_tdb( const char *logname, bool force_clear, bool read_only );
+int elog_close_tdb( ELOG_TDB *etdb, bool force_close );
+bool parse_logentry( TALLOC_CTX *mem_ctx, char *line, struct eventlog_Record_tdb *entry, bool * eor );
+size_t fixup_eventlog_record_tdb(struct eventlog_Record_tdb *r);
+struct eventlog_Record_tdb *evlog_pull_record_tdb(TALLOC_CTX *mem_ctx,
+						  TDB_CONTEXT *tdb,
+						  uint32_t record_number);
+NTSTATUS evlog_push_record_tdb(TALLOC_CTX *mem_ctx,
+			       TDB_CONTEXT *tdb,
+			       struct eventlog_Record_tdb *r,
+			       uint32_t *record_number);
+NTSTATUS evlog_push_record(TALLOC_CTX *mem_ctx,
+			   TDB_CONTEXT *tdb,
+			   struct EVENTLOGRECORD *r,
+			   uint32_t *record_number);
+struct EVENTLOGRECORD *evlog_pull_record(TALLOC_CTX *mem_ctx,
+					 TDB_CONTEXT *tdb,
+					 uint32_t record_number);
+NTSTATUS evlog_evt_entry_to_tdb_entry(TALLOC_CTX *mem_ctx,
+				      const struct EVENTLOGRECORD *e,
+				      struct eventlog_Record_tdb *t);
+NTSTATUS evlog_tdb_entry_to_evt_entry(TALLOC_CTX *mem_ctx,
+				      const struct eventlog_Record_tdb *t,
+				      struct EVENTLOGRECORD *e);
+NTSTATUS evlog_convert_tdb_to_evt(TALLOC_CTX *mem_ctx,
+				  ELOG_TDB *etdb,
+				  DATA_BLOB *blob_p,
+				  uint32_t *num_records_p);
diff --git a/source3/rpc_server/srv_eventlog_nt.c b/source3/rpc_server/srv_eventlog_nt.c
index 52ecc89..3b10955 100644
--- a/source3/rpc_server/srv_eventlog_nt.c
+++ b/source3/rpc_server/srv_eventlog_nt.c
@@ -22,6 +22,7 @@
 
 #include "includes.h"
 #include "../librpc/gen_ndr/srv_eventlog.h"
+#include "lib/eventlog/eventlog.h"
 
 #undef  DBGC_CLASS
 #define DBGC_CLASS DBGC_RPC_SRV
diff --git a/source3/rpc_server/srv_spoolss_nt.c b/source3/rpc_server/srv_spoolss_nt.c
index 954212a..3a71e7c 100644
--- a/source3/rpc_server/srv_spoolss_nt.c
+++ b/source3/rpc_server/srv_spoolss_nt.c
@@ -936,6 +936,11 @@ static int notify_msg_ctr_addmsg( SPOOLSS_NOTIFY_MSG_CTR *ctr, SPOOLSS_NOTIFY_MS
 	return ctr->num_groups;
 }
 
+void construct_info_data(struct spoolss_Notify *info_data,
+			 enum spoolss_NotifyType type,
+			 uint16_t field,
+			 int id);
+
 /***********************************************************************
  Send a change notication message on all handles which have a call
  back registered
@@ -2575,7 +2580,7 @@ WERROR _spoolss_RemoteFindFirstPrinterChangeNotifyEx(pipes_struct *p,
  * fill a notify_info_data with the servername
  ********************************************************************/
 
-void spoolss_notify_server_name(int snum,
+static void spoolss_notify_server_name(int snum,
 				       struct spoolss_Notify *data,
 				       print_queue_struct *queue,
 				       NT_PRINTER_INFO_LEVEL *printer,
@@ -2588,7 +2593,7 @@ void spoolss_notify_server_name(int snum,
  * fill a notify_info_data with the printername (not including the servername).
  ********************************************************************/
 
-void spoolss_notify_printer_name(int snum,
+static void spoolss_notify_printer_name(int snum,
 					struct spoolss_Notify *data,
 					print_queue_struct *queue,
 					NT_PRINTER_INFO_LEVEL *printer,
@@ -2610,7 +2615,7 @@ void spoolss_notify_printer_name(int snum,
  * fill a notify_info_data with the servicename
  ********************************************************************/
 
-void spoolss_notify_share_name(int snum,
+static void spoolss_notify_share_name(int snum,
 				      struct spoolss_Notify *data,
 				      print_queue_struct *queue,
 				      NT_PRINTER_INFO_LEVEL *printer,
@@ -2623,7 +2628,7 @@ void spoolss_notify_share_name(int snum,
  * fill a notify_info_data with the port name
  ********************************************************************/
 
-void spoolss_notify_port_name(int snum,
+static void spoolss_notify_port_name(int snum,
 				     struct spoolss_Notify *data,
 				     print_queue_struct *queue,
 				     NT_PRINTER_INFO_LEVEL *printer,
@@ -2637,7 +2642,7 @@ void spoolss_notify_port_name(int snum,
  * but it doesn't exist, have to see what to do
  ********************************************************************/
 
-void spoolss_notify_driver_name(int snum,
+static void spoolss_notify_driver_name(int snum,
 				       struct spoolss_Notify *data,
 				       print_queue_struct *queue,
 				       NT_PRINTER_INFO_LEVEL *printer,
@@ -2650,7 +2655,7 @@ void spoolss_notify_driver_name(int snum,
  * fill a notify_info_data with the comment
  ********************************************************************/
 
-void spoolss_notify_comment(int snum,
+static void spoolss_notify_comment(int snum,
 				   struct spoolss_Notify *data,
 				   print_queue_struct *queue,
 				   NT_PRINTER_INFO_LEVEL *printer,
@@ -2672,7 +2677,7 @@ void spoolss_notify_comment(int snum,
  * location = "Room 1, floor 2, building 3"
  ********************************************************************/
 
-void spoolss_notify_location(int snum,
+static void spoolss_notify_location(int snum,
 				    struct spoolss_Notify *data,
 				    print_queue_struct *queue,
 				    NT_PRINTER_INFO_LEVEL *printer,
@@ -2700,7 +2705,7 @@ static void spoolss_notify_devmode(int snum,
  * fill a notify_info_data with the separator file name
  ********************************************************************/
 
-void spoolss_notify_sepfile(int snum,
+static void spoolss_notify_sepfile(int snum,
 				   struct spoolss_Notify *data,
 				   print_queue_struct *queue,
 				   NT_PRINTER_INFO_LEVEL *printer,
@@ -2714,7 +2719,7 @@ void spoolss_notify_sepfile(int snum,
  * jfm:xxxx return always winprint to indicate we don't do anything to it
  ********************************************************************/
 
-void spoolss_notify_print_processor(int snum,
+static void spoolss_notify_print_processor(int snum,
 					   struct spoolss_Notify *data,
 					   print_queue_struct *queue,
 					   NT_PRINTER_INFO_LEVEL *printer,
@@ -2728,7 +2733,7 @@ void spoolss_notify_print_processor(int snum,
  * jfm:xxxx send an empty string
  ********************************************************************/
 
-void spoolss_notify_parameters(int snum,
+static void spoolss_notify_parameters(int snum,
 				      struct spoolss_Notify *data,
 				      print_queue_struct *queue,
 				      NT_PRINTER_INFO_LEVEL *printer,
@@ -2742,7 +2747,7 @@ void spoolss_notify_parameters(int snum,
  * jfm:xxxx always send RAW as data type
  ********************************************************************/
 
-void spoolss_notify_datatype(int snum,
+static void spoolss_notify_datatype(int snum,
 				    struct spoolss_Notify *data,
 				    print_queue_struct *queue,
 				    NT_PRINTER_INFO_LEVEL *printer,
@@ -2773,7 +2778,7 @@ static void spoolss_notify_security_desc(int snum,
  * jfm:xxxx a samba printer is always shared
  ********************************************************************/
 
-void spoolss_notify_attributes(int snum,
+static void spoolss_notify_attributes(int snum,
 				      struct spoolss_Notify *data,
 				      print_queue_struct *queue,
 				      NT_PRINTER_INFO_LEVEL *printer,
@@ -2854,7 +2859,7 @@ static void spoolss_notify_status(int snum,
  * fill a notify_info_data with the number of jobs queued
  ********************************************************************/
 
-void spoolss_notify_cjobs(int snum,
+static void spoolss_notify_cjobs(int snum,
 				 struct spoolss_Notify *data,
 				 print_queue_struct *queue,
 				 NT_PRINTER_INFO_LEVEL *printer,
diff --git a/source3/utils/eventlogadm.c b/source3/utils/eventlogadm.c
index d94f25b..73d851d 100644
--- a/source3/utils/eventlogadm.c
+++ b/source3/utils/eventlogadm.c
@@ -23,6 +23,7 @@
 
 
 #include "includes.h"
+#include "lib/eventlog/eventlog.h"
 
 #undef  DBGC_CLASS
 #define DBGC_CLASS DBGC_UTIL_EVENTLOG
diff --git a/source3/utils/net_eventlog.c b/source3/utils/net_eventlog.c
index c889efb..28a010c 100644
--- a/source3/utils/net_eventlog.c
+++ b/source3/utils/net_eventlog.c
@@ -21,6 +21,7 @@
 
 #include "includes.h"
 #include "utils/net.h"
+#include "lib/eventlog/eventlog.h"
 
 /**
  * Dump an *evt win32 eventlog file


-- 
Samba Shared Repository


More information about the samba-cvs mailing list