From 8225c0ad6c5fbcb522912fa5f5af605f721e5216 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Tue, 22 Feb 2011 19:24:31 +0100 Subject: s3-printing: only include printing where really needed. Guenther --- source3/include/printing.h | 23 +++++++++++++++++++++++ source3/include/proto.h | 29 ----------------------------- source3/printing/load.c | 2 +- source3/printing/load.h | 4 ++++ source3/smbd/lanman.c | 1 + source3/smbd/server.c | 1 + source3/smbd/server_exit.c | 1 + source3/smbd/server_reload.c | 1 + source3/web/swat.c | 1 + 9 files changed, 33 insertions(+), 30 deletions(-) create mode 100644 source3/printing/load.h diff --git a/source3/include/printing.h b/source3/include/printing.h index 9f0fcde28a..0316eb58c9 100644 --- a/source3/include/printing.h +++ b/source3/include/printing.h @@ -101,6 +101,8 @@ struct tdb_print_db { #define NOTIFY_PID_LIST_KEY "NOTIFY_PID_LIST" +/* The following definitions come from printing/printspoolss.c */ + NTSTATUS print_spool_open(files_struct *fsp, const char *fname, uint16_t current_vuid); @@ -157,5 +159,26 @@ WERROR print_queue_resume(const struct auth_serversupplied_info *server_info, struct messaging_context *msg_ctx, int snum); WERROR print_queue_purge(const struct auth_serversupplied_info *server_info, struct messaging_context *msg_ctx, int snum); +uint16 pjobid_to_rap(const char* sharename, uint32 jobid); +bool rap_to_pjobid(uint16 rap_jobid, fstring sharename, uint32 *pjobid); +void rap_jobid_delete(const char* sharename, uint32 jobid); +bool print_backend_init(struct messaging_context *msg_ctx); +void start_background_queue(struct tevent_context *ev, + struct messaging_context *msg); +void printing_end(void); + +/* The following definitions come from printing/lpq_parse.c */ + +bool parse_lpq_entry(enum printing_types printing_type,char *line, + print_queue_struct *buf, + print_status_struct *status,bool first); +uint32_t print_parse_jobid(const char *fname); + +/* The following definitions come from printing/printing_db.c */ + +struct tdb_print_db *get_print_db_byname(const char *printername); +void release_print_db( struct tdb_print_db *pdb); +void close_all_print_db(void); +TDB_DATA get_printer_notify_pid_list(TDB_CONTEXT *tdb, const char *printer_name, bool cleanlist); #endif /* PRINTING_H_ */ diff --git a/source3/include/proto.h b/source3/include/proto.h index 8770145ef1..69585182eb 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -3948,35 +3948,6 @@ bool lookup_wellknown_sid(TALLOC_CTX *mem_ctx, const struct dom_sid *sid, bool lookup_wellknown_name(TALLOC_CTX *mem_ctx, const char *name, struct dom_sid *sid, const char **domain); -/* The following definitions come from printing/load.c */ - -void load_printers(struct tevent_context *ev, - struct messaging_context *msg_ctx); - -/* The following definitions come from printing/lpq_parse.c */ - -bool parse_lpq_entry(enum printing_types printing_type,char *line, - print_queue_struct *buf, - print_status_struct *status,bool first); -uint32_t print_parse_jobid(const char *fname); - -/* The following definitions come from printing/printing.c */ - -uint16 pjobid_to_rap(const char* sharename, uint32 jobid); -bool rap_to_pjobid(uint16 rap_jobid, fstring sharename, uint32 *pjobid); -void rap_jobid_delete(const char* sharename, uint32 jobid); -bool print_backend_init(struct messaging_context *msg_ctx); -void start_background_queue(struct tevent_context *ev, - struct messaging_context *msg); -void printing_end(void); - -/* The following definitions come from printing/printing_db.c */ - -struct tdb_print_db *get_print_db_byname(const char *printername); -void release_print_db( struct tdb_print_db *pdb); -void close_all_print_db(void); -TDB_DATA get_printer_notify_pid_list(TDB_CONTEXT *tdb, const char *printer_name, bool cleanlist); - /* The following definitions come from profile/profile.c */ void set_profile_level(int level, struct server_id src); diff --git a/source3/printing/load.c b/source3/printing/load.c index 66c3ffd22c..5acc25833d 100644 --- a/source3/printing/load.c +++ b/source3/printing/load.c @@ -19,7 +19,7 @@ #include "includes.h" #include "printing/pcap.h" - +#include "printing/load.h" /*************************************************************************** auto-load some homes and printer services diff --git a/source3/printing/load.h b/source3/printing/load.h new file mode 100644 index 0000000000..df401a4377 --- /dev/null +++ b/source3/printing/load.h @@ -0,0 +1,4 @@ +/* The following definitions come from printing/load.c */ + +void load_printers(struct tevent_context *ev, + struct messaging_context *msg_ctx); diff --git a/source3/smbd/lanman.c b/source3/smbd/lanman.c index 259da3dc46..64e0439557 100644 --- a/source3/smbd/lanman.c +++ b/source3/smbd/lanman.c @@ -40,6 +40,7 @@ #include "rpc_client/init_lsa.h" #include "rpc_server/rpc_ncacn_np.h" #include "../libcli/security/security.h" +#include "printing.h" #ifdef CHECK_TYPES #undef CHECK_TYPES diff --git a/source3/smbd/server.c b/source3/smbd/server.c index 965a0e81f7..81283f0ec9 100644 --- a/source3/smbd/server.c +++ b/source3/smbd/server.c @@ -34,6 +34,7 @@ #include "printing/printer_list.h" #include "rpc_server/rpc_ep_setup.h" #include "printing/pcap.h" +#include "printing.h" #ifdef WITH_DFS extern int dcelogin_atmost_once; diff --git a/source3/smbd/server_exit.c b/source3/smbd/server_exit.c index 43626ae862..72bac8b127 100644 --- a/source3/smbd/server_exit.c +++ b/source3/smbd/server_exit.c @@ -41,6 +41,7 @@ #include "../librpc/gen_ndr/srv_winreg.h" #include "../librpc/gen_ndr/srv_wkssvc.h" #include "printing/notify.h" +#include "printing.h" static struct files_struct *log_writeable_file_fn( struct files_struct *fsp, void *private_data) diff --git a/source3/smbd/server_reload.c b/source3/smbd/server_reload.c index f60130bd11..e4b039d189 100644 --- a/source3/smbd/server_reload.c +++ b/source3/smbd/server_reload.c @@ -26,6 +26,7 @@ #include "librpc/gen_ndr/messaging.h" #include "nt_printing.h" #include "printing/pcap.h" +#include "printing/load.h" /**************************************************************************** purge stale printers and reload from pre-populated pcap cache diff --git a/source3/web/swat.c b/source3/web/swat.c index 93fe36827c..00fbb87856 100644 --- a/source3/web/swat.c +++ b/source3/web/swat.c @@ -31,6 +31,7 @@ #include "popt_common.h" #include "web/swat_proto.h" #include "printing/pcap.h" +#include "printing/load.h" static int demo_mode = False; static int passwd_only = False; -- cgit