]> git.ipfire.org Git - thirdparty/cups.git/blobdiff - scheduler/testmime.c
Move debug printfs to internal usage only.
[thirdparty/cups.git] / scheduler / testmime.c
index 9d68abb4d2ecbe4e022086b6cb89978fb5e9dd5d..221a65a0e256d3220263b9240851de2de0d81a64 100644 (file)
@@ -1,24 +1,10 @@
 /*
- * "$Id: testmime.c 7670 2008-06-17 22:42:08Z mike $"
+ * MIME test program for CUPS.
  *
- *   MIME test program for CUPS.
+ * Copyright 2007-2014 by Apple Inc.
+ * Copyright 1997-2006 by Easy Software Products, all rights reserved.
  *
- *   Copyright 2007-2011 by Apple Inc.
- *   Copyright 1997-2006 by Easy Software Products, all rights reserved.
- *
- *   These coded instructions, statements, and computer programs are the
- *   property of Apple Inc. and are protected by Federal copyright
- *   law.  Distribution and use rights are outlined in the file "LICENSE.txt"
- *   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/".
- *
- * Contents:
- *
- *   main()            - Main entry for the test program.
- *   add_ppd_filter()  - Add a printer filter from a PPD.
- *   add_ppd_filters() - Add all filters from a PPD.
- *   print_rules()     - Print the rules for a file type...
- *   type_dir()        - Show the MIME types for a given directory.
+ * Licensed under Apache License v2.0.  See the file "LICENSE" for more information.
  */
 
 /*
@@ -132,10 +118,10 @@ main(int  argc,                           /* I - Number of command-line args */
     }
     else
     {
-      sscanf(argv[i], "%15[^/]/%31s", super, type);
+      sscanf(argv[i], "%15[^/]/%255s", super, type);
       dst = mimeType(mime, super, type);
 
-      filters = mimeFilter2(mime, src, srcinfo.st_size, dst, &cost);
+      filters = mimeFilter2(mime, src, (size_t)srcinfo.st_size, dst, &cost);
 
       if (!filters)
       {
@@ -226,9 +212,6 @@ add_ppd_filter(mime_t      *mime,   /* I - MIME database */
   mime_filter_t        *filterptr;             /* MIME filter */
 
 
-  DEBUG_printf(("add_ppd_filter(mime=%p, filtertype=%p(%s/%s), filter=\"%s\")",
-                mime, filtertype, filtertype->super, filtertype->type, filter));
-
  /*
   * Parse the filter string; it should be in one of the following formats:
   *
@@ -264,7 +247,7 @@ add_ppd_filter(mime_t      *mime,   /* I - MIME database */
   {
     char       *ptr;                   /* Pointer into maxsize(nnnn) program */
 
-    maxsize = strtoll(program + 8, &ptr, 10);
+    maxsize = (size_t)strtoll(program + 8, &ptr, 10);
 
     if (*ptr != ')')
     {
@@ -292,26 +275,13 @@ add_ppd_filter(mime_t      *mime, /* I - MIME database */
     {
       if (desttype != filtertype)
       {
-        DEBUG_printf(("add_ppd_filter: Adding filter %s/%s %s/%s %d %s",
-                     temptype->super, temptype->type, desttype->super,
-                     desttype->type, cost, program));
         filterptr = mimeAddFilter(mime, temptype, desttype, cost, program);
 
         if (!mimeFilterLookup(mime, desttype, filtertype))
-        {
-          DEBUG_printf(("add_printer_filter: Adding filter %s/%s %s/%s 0 -",
-                       desttype->super, desttype->type, filtertype->super,
-                       filtertype->type));
           mimeAddFilter(mime, desttype, filtertype, 0, "-");
-        }
       }
       else
-      {
-        DEBUG_printf(("add_printer_filter: Adding filter %s/%s %s/%s %d %s",
-                     temptype->super, temptype->type, filtertype->super,
-                     filtertype->type, cost, program));
         filterptr = mimeAddFilter(mime, temptype, filtertype, cost, program);
-      }
 
       if (filterptr)
        filterptr->maxsize = maxsize;
@@ -524,8 +494,3 @@ type_dir(mime_t     *mime,          /* I - MIME database */
 
   cupsDirClose(dir);
 }
-
-
-/*
- * End of "$Id: testmime.c 7670 2008-06-17 22:42:08Z mike $".
- */