s3-eventlog: move all eventlog headers to lib/eventlog and only include where required.
authorGünther Deschner <gd@samba.org>
Thu, 6 May 2010 09:42:52 +0000 (11:42 +0200)
committerGünther Deschner <gd@samba.org>
Thu, 6 May 2010 11:41:51 +0000 (13:41 +0200)
Guenther

source3/include/includes.h
source3/include/proto.h
source3/lib/eventlog/eventlog.c
source3/lib/eventlog/eventlog.h [moved from source3/include/eventlog.h with 94% similarity]
source3/lib/eventlog/proto.h [new file with mode: 0644]
source3/rpc_server/srv_eventlog_nt.c
source3/utils/eventlogadm.c
source3/utils/net_eventlog.c

index 5b682bb4e31f674ca7b6f032d777bfda2f2fe232..9ab25569a414eb10c57f2e8d3b6a2b800fdceadc 100644 (file)
@@ -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"
index 9c169ed11c3b648acf4a6143d6ab8e7d2eed99e2..43de9e5b33b530d69c8b5fe030bfc4eb49ec6c28 100644 (file)
@@ -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  */
index dc14214e3680b45760c1a7f5ff9213845a1b1ce9..c218467c4724fbb15e8546dc98121406d5d27134 100644 (file)
@@ -21,6 +21,7 @@
  */
 
 #include "includes.h"
+#include "lib/eventlog/eventlog.h"
 
 /* maintain a list of open eventlog tdbs with reference counts */
 
similarity index 94%
rename from source3/include/eventlog.h
rename to source3/lib/eventlog/eventlog.h
index 16affe3313867902610220f4df7730e386077b1d..29c25c312228dbd3163969a6810a7e0e05a769a5 100644 (file)
@@ -37,5 +37,7 @@ typedef struct 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 (file)
index 0000000..21790d0
--- /dev/null
@@ -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);
index 52ecc8911223e5ae44a6cf5c55834d24cc4142a1..3b109558f07bbb31a92a9ec0c255ea6669ee5d8a 100644 (file)
@@ -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
index d94f25b42dfbe30ade9f318fa979bca05de4285c..73d851db6f1459819cc4b8dcd2eabc48a7a7bb3e 100644 (file)
@@ -23,6 +23,7 @@
 
 
 #include "includes.h"
+#include "lib/eventlog/eventlog.h"
 
 #undef  DBGC_CLASS
 #define DBGC_CLASS DBGC_UTIL_EVENTLOG
index c889efbf958173c7ab5fef0373c2f271e4fff199..28a010c5a7d78e6ca02bd33ab97ea71ef817d4e6 100644 (file)
@@ -21,6 +21,7 @@
 
 #include "includes.h"
 #include "utils/net.h"
+#include "lib/eventlog/eventlog.h"
 
 /**
  * Dump an *evt win32 eventlog file