diff options
-rw-r--r-- | source3/include/proto.h | 2 | ||||
-rw-r--r-- | source3/printing/nt_printing.c | 66 |
2 files changed, 0 insertions, 68 deletions
diff --git a/source3/include/proto.h b/source3/include/proto.h index 43e2723679..4aee813f0d 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -4722,8 +4722,6 @@ void notify_printer_byname( const char *printername, uint32 change, const char * /* The following definitions come from printing/nt_printing.c */ bool nt_printing_init(struct messaging_context *msg_ctx); -uint32 update_c_setprinter(bool initialize); -uint32 get_c_setprinter(void); int get_builtin_ntforms(nt_forms_struct **list); bool get_a_builtin_ntform_by_string(const char *form_name, nt_forms_struct *form); int get_ntforms(nt_forms_struct **list); diff --git a/source3/printing/nt_printing.c b/source3/printing/nt_printing.c index 3a3b72abbc..aa1e2f7cbd 100644 --- a/source3/printing/nt_printing.c +++ b/source3/printing/nt_printing.c @@ -659,72 +659,6 @@ static NTSTATUS driver_unix_convert(connection_struct *conn, return NT_STATUS_OK; } -/******************************************************************* - tdb traversal function for counting printers. -********************************************************************/ - -static int traverse_counting_printers(TDB_CONTEXT *t, TDB_DATA key, - TDB_DATA data, void *context) -{ - int *printer_count = (int*)context; - - if (memcmp(PRINTERS_PREFIX, key.dptr, sizeof(PRINTERS_PREFIX)-1) == 0) { - (*printer_count)++; - DEBUG(10,("traverse_counting_printers: printer = [%s] printer_count = %d\n", key.dptr, *printer_count)); - } - - return 0; -} - -/******************************************************************* - Update the spooler global c_setprinter. This variable is initialized - when the parent smbd starts with the number of existing printers. It - is monotonically increased by the current number of printers *after* - each add or delete printer RPC. Only Microsoft knows why... JRR020119 -********************************************************************/ - -uint32 update_c_setprinter(bool initialize) -{ - int32 c_setprinter; - int32 printer_count = 0; - - tdb_lock_bystring(tdb_printers, GLOBAL_C_SETPRINTER); - - /* Traverse the tdb, counting the printers */ - tdb_traverse(tdb_printers, traverse_counting_printers, (void *)&printer_count); - - /* If initializing, set c_setprinter to current printers count - * otherwise, bump it by the current printer count - */ - if (!initialize) - c_setprinter = tdb_fetch_int32(tdb_printers, GLOBAL_C_SETPRINTER) + printer_count; - else - c_setprinter = printer_count; - - DEBUG(10,("update_c_setprinter: c_setprinter = %u\n", (unsigned int)c_setprinter)); - tdb_store_int32(tdb_printers, GLOBAL_C_SETPRINTER, c_setprinter); - - tdb_unlock_bystring(tdb_printers, GLOBAL_C_SETPRINTER); - - return (uint32)c_setprinter; -} - -/******************************************************************* - Get the spooler global c_setprinter, accounting for initialization. -********************************************************************/ - -uint32 get_c_setprinter(void) -{ - int32 c_setprinter = tdb_fetch_int32(tdb_printers, GLOBAL_C_SETPRINTER); - - if (c_setprinter == (int32)-1) - c_setprinter = update_c_setprinter(True); - - DEBUG(10,("get_c_setprinter: c_setprinter = %d\n", c_setprinter)); - - return (uint32)c_setprinter; -} - /**************************************************************************** Get builtin form struct list. ****************************************************************************/ |