summaryrefslogtreecommitdiff
path: root/source3/printing
diff options
context:
space:
mode:
authorGerald Carter <jerry@samba.org>2002-08-08 20:54:37 +0000
committerGerald Carter <jerry@samba.org>2002-08-08 20:54:37 +0000
commit14d385439d99f0eadca5296aeef800c67038916b (patch)
tree67273c5955127e563bf845bc0ed47788f6fd59b4 /source3/printing
parent4267fcccdab729a54de68d15f6d2fc36584e7e92 (diff)
downloadsamba-14d385439d99f0eadca5296aeef800c67038916b.tar.gz
samba-14d385439d99f0eadca5296aeef800c67038916b.tar.bz2
samba-14d385439d99f0eadca5296aeef800c67038916b.zip
printing change notification merge from APPLIANCE_HEAD
(This used to be commit 11ddfd9cfa550dcd3186c8aaf0cc038ce7f1791f)
Diffstat (limited to 'source3/printing')
-rw-r--r--source3/printing/notify.c54
-rw-r--r--source3/printing/nt_printing.c12
2 files changed, 47 insertions, 19 deletions
diff --git a/source3/printing/notify.c b/source3/printing/notify.c
index 1b2b7805e5..925d49a21d 100644
--- a/source3/printing/notify.c
+++ b/source3/printing/notify.c
@@ -3,6 +3,7 @@
Version 2.2
printing backend routines
Copyright (C) Tim Potter, 2002
+ Copyright (C) Gerald Carter, 2002
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
@@ -128,7 +129,7 @@ void notify_printer_status_byname(const char *printer_name, uint32 status)
void notify_printer_status(int snum, uint32 status)
{
- const char *printer_name = PRINTERNAME(snum);
+ const char *printer_name = SERVICE(snum);
if (printer_name)
notify_printer_status_byname(printer_name, status);
@@ -146,14 +147,14 @@ void notify_job_status_byname(const char *printer_name, uint32 jobid, uint32 sta
void notify_job_status(int snum, uint32 jobid, uint32 status)
{
- const char *printer_name = PRINTERNAME(snum);
+ const char *printer_name = SERVICE(snum);
notify_job_status_byname(printer_name, jobid, status, 0);
}
void notify_job_total_bytes(int snum, uint32 jobid, uint32 size)
{
- const char *printer_name = PRINTERNAME(snum);
+ const char *printer_name = SERVICE(snum);
/* Job id stored in id field, status in value1 */
@@ -164,7 +165,7 @@ void notify_job_total_bytes(int snum, uint32 jobid, uint32 size)
void notify_job_total_pages(int snum, uint32 jobid, uint32 pages)
{
- const char *printer_name = PRINTERNAME(snum);
+ const char *printer_name = SERVICE(snum);
/* Job id stored in id field, status in value1 */
@@ -175,7 +176,7 @@ void notify_job_total_pages(int snum, uint32 jobid, uint32 pages)
void notify_job_username(int snum, uint32 jobid, char *name)
{
- const char *printer_name = PRINTERNAME(snum);
+ const char *printer_name = SERVICE(snum);
send_notify_field_buffer(
printer_name, JOB_NOTIFY_TYPE, JOB_NOTIFY_USER_NAME,
@@ -184,7 +185,7 @@ void notify_job_username(int snum, uint32 jobid, char *name)
void notify_job_name(int snum, uint32 jobid, char *name)
{
- const char *printer_name = PRINTERNAME(snum);
+ const char *printer_name = SERVICE(snum);
send_notify_field_buffer(
printer_name, JOB_NOTIFY_TYPE, JOB_NOTIFY_DOCUMENT,
@@ -193,37 +194,54 @@ void notify_job_name(int snum, uint32 jobid, char *name)
void notify_job_submitted(int snum, uint32 jobid, time_t submitted)
{
- const char *printer_name = PRINTERNAME(snum);
+ const char *printer_name = SERVICE(snum);
send_notify_field_buffer(
printer_name, JOB_NOTIFY_TYPE, JOB_NOTIFY_SUBMITTED,
jobid, sizeof(submitted), (char *)&submitted);
}
-void notify_printer_delete(char *printer_name)
+void notify_printer_driver(int snum, char *driver_name)
{
-}
+ const char *printer_name = SERVICE(snum);
-void notify_printer_add(char *printer_name)
-{
+ send_notify_field_buffer(
+ printer_name, PRINTER_NOTIFY_TYPE, PRINTER_NOTIFY_DRIVER_NAME,
+ snum, strlen(driver_name) + 1, driver_name);
}
-void notify_printer_driver(int num, char *driver_name)
+void notify_printer_comment(int snum, char *comment)
{
-}
+ const char *printer_name = SERVICE(snum);
-void notify_printer_comment(int num, char *comment)
-{
+ send_notify_field_buffer(
+ printer_name, PRINTER_NOTIFY_TYPE, PRINTER_NOTIFY_COMMENT,
+ snum, strlen(comment) + 1, comment);
}
-void notify_printer_sharename(int num, char *share_name)
+void notify_printer_sharename(int snum, char *share_name)
{
+ const char *printer_name = SERVICE(snum);
+
+ send_notify_field_buffer(
+ printer_name, PRINTER_NOTIFY_TYPE, PRINTER_NOTIFY_SHARE_NAME,
+ snum, strlen(share_name) + 1, share_name);
}
-void notify_printer_port(int num, char *port_name)
+void notify_printer_port(int snum, char *port_name)
{
+ const char *printer_name = SERVICE(snum);
+
+ send_notify_field_buffer(
+ printer_name, PRINTER_NOTIFY_TYPE, PRINTER_NOTIFY_PORT_NAME,
+ snum, strlen(port_name) + 1, port_name);
}
-void notify_printer_location(int num, char *location)
+void notify_printer_location(int snum, char *location)
{
+ const char *printer_name = SERVICE(snum);
+
+ send_notify_field_buffer(
+ printer_name, PRINTER_NOTIFY_TYPE, PRINTER_NOTIFY_LOCATION,
+ snum, strlen(location) + 1, location);
}
diff --git a/source3/printing/nt_printing.c b/source3/printing/nt_printing.c
index f0995db06d..2348bbe3d4 100644
--- a/source3/printing/nt_printing.c
+++ b/source3/printing/nt_printing.c
@@ -319,7 +319,17 @@ BOOL nt_printing_init(void)
* register callback to handle updating printers as new
* drivers are installed
*/
- message_register(MSG_PRINTER_DRVUPGRADE, do_drv_upgrade_printer);
+
+ message_register( MSG_PRINTER_DRVUPGRADE, do_drv_upgrade_printer );
+
+ /*
+ * register callback to handle updating printer data
+ * when a driver is initialized
+ */
+
+ message_register( MSG_PRINTERDATA_INIT_RESET, reset_all_printerdata );
+
+
return True;
}