]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
The lpadmin command now allows the cupsIPPSupplies and cupsSNMPSupplies keywords
authormike <mike@7a7537e8-13f0-0310-91df-b6672ffda945>
Wed, 11 May 2011 04:46:50 +0000 (04:46 +0000)
committermike <mike@7a7537e8-13f0-0310-91df-b6672ffda945>
Wed, 11 May 2011 04:46:50 +0000 (04:46 +0000)
to be set in a PPD file (STR #3825)

git-svn-id: svn+ssh://src.apple.com/svn/cups/cups.org/trunk@9761 7a7537e8-13f0-0310-91df-b6672ffda945

CHANGES.txt
man/lpadmin.man
systemv/lpadmin.c
xcode/CUPS.xcodeproj/project.pbxproj

index 6fa5ea36ba8843da3bf7d307e71e425445cb34f2..37bbf46f15e14b13c7258620abed0c47d53f0047 100644 (file)
@@ -3,6 +3,8 @@ CHANGES.txt - 2011-05-10
 
 CHANGES IN CUPS V1.5b1
 
+       - The lpadmin command now allows the cupsIPPSupplies and
+         cupsSNMPSupplies keywords to be set in a PPD file (STR #3825)
        - Moving a held job no longer releases it (STR #3839)
        - Restored support for GNU TLS and OpenSSL with threading enabled
          (STR #3605)
index 2402d89c2233cd84a6dd50c84da3c761d7d43103..84e321815922ebf38de4e5210a67c5322ce6bc6f 100644 (file)
@@ -12,7 +12,7 @@
 .\"   which should have been included with this file.  If this file is
 .\"   file is missing or damaged, see the license at "http://www.cups.org/".
 .\"
-.TH lpadmin 8 "CUPS" "7 January 2011" "Apple Inc."
+.TH lpadmin 8 "CUPS" "10 May 2011" "Apple Inc."
 .SH NAME
 lpadmin \- configure cups printers and classes
 .SH SYNOPSIS
@@ -82,6 +82,18 @@ Sets a standard System V interface script or PPD file for the printer from the
 \fImodel\fR directory or using one of the driver interfaces. Use the \fI-m\fR
 option with the \fIlpinfo(8)\fR command to get a list of supported models.
 .TP 5
+-o cupsIPPSupplies=true
+.TP 5
+-o cupsIPPSupplies=false
+.br
+Specifies whether IPP supply level values should be reported.
+.TP 5
+-o cupsSNMPSupplies=true
+.TP 5
+-o cupsSNMPSupplies=false
+.br
+Specifies whether SNMP supply level (RFC 3805) values should be reported.
+.TP 5
 -o job-k-limit=value
 .br
 Sets the kilobyte limit for per-user quotas. The value is an
@@ -123,8 +135,8 @@ specified port monitor must be listed in the printer's PPD file.
 .TP 5
 -o printer-error-policy=name
 .br
-Sets the error policy to be used when the printer backend is 
-unable to send the job to the printer. The name must be one of 
+Sets the error policy to be used when the printer backend is
+unable to send the job to the printer. The name must be one of
 "abort-job", "retry-job", "retry-current-job", or "stop-printer". The default
 error policy is "stop-printer" for printers and "retry-current-job" for
 classes.
index aa1dba8e80e69d5d4a50794312aa2cdad410baf2..631ffbf544b5d59c7b88f561777d883bd1d6786e 100644 (file)
@@ -1127,7 +1127,10 @@ set_printer_options(
   cups_file_t  *in,                    /* PPD file */
                *out;                   /* Temporary file */
   const char   *protocol,              /* Old protocol option */
-               *customval;             /* Custom option value */
+               *customval,             /* Custom option value */
+               *boolval;               /* Boolean value */
+  int          wrote_ipp_supplies = 0, /* Wrote cupsIPPSupplies keyword? */
+               wrote_snmp_supplies = 0;/* Wrote cupsSNMPSupplies keyword? */
 
 
   DEBUG_printf(("set_printer_options(http=%p, printer=\"%s\", num_options=%d, "
@@ -1256,7 +1259,27 @@ set_printer_options(
 
     while (cupsFileGets(in, line, sizeof(line)))
     {
-      if (strncmp(line, "*Default", 8))
+      if (!strncmp(line, "*cupsIPPSupplies:", 17) &&
+         (boolval = cupsGetOption("cupsIPPSupplies", num_options,
+                                  options)) != NULL)
+      {
+        wrote_ipp_supplies = 1;
+        cupsFilePrintf(out, "*cupsIPPSupplies: %s\n",
+                      (!strcasecmp(boolval, "true") ||
+                       !strcasecmp(boolval, "yes") ||
+                       !strcasecmp(boolval, "on")) ? "True" : "False");
+      }
+      else if (!strncmp(line, "*cupsSNMPSupplies:", 18) &&
+              (boolval = cupsGetOption("cupsSNMPSupplies", num_options,
+                                       options)) != NULL)
+      {
+        wrote_snmp_supplies = 1;
+        cupsFilePrintf(out, "*cupsSNMPSupplies: %s\n",
+                      (!strcasecmp(boolval, "true") ||
+                       !strcasecmp(boolval, "yes") ||
+                       !strcasecmp(boolval, "on")) ? "True" : "False");
+      }
+      else if (strncmp(line, "*Default", 8))
         cupsFilePrintf(out, "%s\n", line);
       else
       {
@@ -1306,6 +1329,26 @@ set_printer_options(
       }
     }
 
+    if (!wrote_ipp_supplies &&
+       (boolval = cupsGetOption("cupsIPPSupplies", num_options,
+                                options)) != NULL)
+    {
+      cupsFilePrintf(out, "*cupsIPPSupplies: %s\n",
+                    (!strcasecmp(boolval, "true") ||
+                     !strcasecmp(boolval, "yes") ||
+                     !strcasecmp(boolval, "on")) ? "True" : "False");
+    }
+
+    if (!wrote_snmp_supplies &&
+        (boolval = cupsGetOption("cupsSNMPSupplies", num_options,
+                                options)) != NULL)
+    {
+      cupsFilePrintf(out, "*cupsSNMPSupplies: %s\n",
+                    (!strcasecmp(boolval, "true") ||
+                     !strcasecmp(boolval, "yes") ||
+                     !strcasecmp(boolval, "on")) ? "True" : "False");
+    }
+
     cupsFileClose(in);
     cupsFileClose(out);
     ppdClose(ppd);
index 01fef6b9c33e3841a9848d208c4c54c82428eea4..208f545d7a5af7c163fb7a439cee6ea3664b94e1 100644 (file)
 /* Begin PBXFileReference section */
                270CCDA7135E3C9E00007BE2 /* testmime */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = testmime; sourceTree = BUILT_PRODUCTS_DIR; };
                270CCDBB135E3D3E00007BE2 /* testmime.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = testmime.c; path = ../scheduler/testmime.c; sourceTree = "<group>"; };
+               2732E089137A3F5200FAFEF6 /* cancel.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = cancel.c; path = ../systemv/cancel.c; sourceTree = "<group>"; };
+               2732E08A137A3F5200FAFEF6 /* cupsaccept.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = cupsaccept.c; path = ../systemv/cupsaccept.c; sourceTree = "<group>"; };
+               2732E08B137A3F5200FAFEF6 /* cupstestdsc.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = cupstestdsc.c; path = ../systemv/cupstestdsc.c; sourceTree = "<group>"; };
+               2732E08C137A3F5200FAFEF6 /* lp.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = lp.c; path = ../systemv/lp.c; sourceTree = "<group>"; };
+               2732E08D137A3F5200FAFEF6 /* lpadmin.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = lpadmin.c; path = ../systemv/lpadmin.c; sourceTree = "<group>"; };
+               2732E08E137A3F5200FAFEF6 /* lpinfo.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = lpinfo.c; path = ../systemv/lpinfo.c; sourceTree = "<group>"; };
+               2732E08F137A3F5200FAFEF6 /* lpmove.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = lpmove.c; path = ../systemv/lpmove.c; sourceTree = "<group>"; };
+               2732E090137A3F5200FAFEF6 /* lpoptions.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = lpoptions.c; path = ../systemv/lpoptions.c; sourceTree = "<group>"; };
+               2732E091137A3F5200FAFEF6 /* lppasswd.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = lppasswd.c; path = ../systemv/lppasswd.c; sourceTree = "<group>"; };
+               2732E092137A3F5200FAFEF6 /* lpstat.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = lpstat.c; path = ../systemv/lpstat.c; sourceTree = "<group>"; };
                273BF6BD1333B5000022CAAB /* testcups */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = testcups; sourceTree = BUILT_PRODUCTS_DIR; };
                273BF6C61333B5370022CAAB /* testcups.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = testcups.c; path = ../cups/testcups.c; sourceTree = "<group>"; };
                273BF6CB1333B5950022CAAB /* CoreFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreFoundation.framework; path = SDKs/MacOSX10.6.sdk/System/Library/Frameworks/CoreFoundation.framework; sourceTree = DEVELOPER_DIR; };
                274FF67313333B0A00317ECB /* commands */ = {
                        isa = PBXGroup;
                        children = (
+                               2732E089137A3F5200FAFEF6 /* cancel.c */,
+                               2732E08A137A3F5200FAFEF6 /* cupsaccept.c */,
                                276684101337FA7C000D33D0 /* cupsaddsmb.c */,
                                276683681337AA00000D33D0 /* cupsctl.c */,
                                274FF68713333B6E00317ECB /* cupsfilter.c */,
+                               2732E08B137A3F5200FAFEF6 /* cupstestdsc.c */,
                                72F75A5B1336F988004BB496 /* cupstestppd.c */,
                                726AD701135E8A90002C930D /* ippserver.c */,
                                276683F91337F7A9000D33D0 /* ipptool.c */,
+                               2732E08C137A3F5200FAFEF6 /* lp.c */,
+                               2732E08D137A3F5200FAFEF6 /* lpadmin.c */,
+                               2732E08E137A3F5200FAFEF6 /* lpinfo.c */,
+                               2732E08F137A3F5200FAFEF6 /* lpmove.c */,
+                               2732E090137A3F5200FAFEF6 /* lpoptions.c */,
+                               2732E091137A3F5200FAFEF6 /* lppasswd.c */,
+                               2732E092137A3F5200FAFEF6 /* lpstat.c */,
                        );
                        name = commands;
                        sourceTree = "<group>";