s3-printing: Removed unsuded c_setprinter functions.
authorAndreas Schneider <asn@samba.org>
Tue, 11 May 2010 08:52:11 +0000 (10:52 +0200)
committerSimo Sorce <idra@samba.org>
Tue, 27 Jul 2010 14:27:12 +0000 (10:27 -0400)
Signed-off-by: Jim McDonough <jmcd@samba.org>
source3/include/proto.h
source3/printing/nt_printing.c

index 43e2723679cac8203b766ba88723fea4bb3edc13..4aee813f0d958a28210c61069bd4ec945d97a545 100644 (file)
@@ -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);
index 3a3b72abbcb958c96f4d7af15fc7e3d5a32e9f2a..aa1e2f7cbd80d2fb218875a8ec864ecf26f3edc3 100644 (file)
@@ -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.
 ****************************************************************************/