]> git.ipfire.org Git - thirdparty/cups.git/blobdiff - scheduler/testmime.c
Merge changes from CUPS 1.4svn-r8227.
[thirdparty/cups.git] / scheduler / testmime.c
index bd65fc77056634dd9e8a8a8dcee0a221f17b6079..cf14e223b9cbb76b7b62e7e1c18b1d1ee5467bfc 100644 (file)
@@ -1,25 +1,16 @@
 /*
- * "$Id: testmime.c 5051 2006-02-02 16:13:16Z mike $"
+ * "$Id: testmime.c 7670 2008-06-17 22:42:08Z mike $"
  *
  *   MIME test program for the Common UNIX Printing System (CUPS).
  *
+ *   Copyright 2007-2009 by Apple Inc.
  *   Copyright 1997-2006 by Easy Software Products, all rights reserved.
  *
  *   These coded instructions, statements, and computer programs are the
- *   property of Easy Software Products 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 missing or damaged please contact Easy Software Products
- *   at:
- *
- *       Attn: CUPS Licensing Information
- *       Easy Software Products
- *       44141 Airport View Drive, Suite 204
- *       Hollywood, Maryland 20636 USA
- *
- *       Voice: (301) 373-9600
- *       EMail: cups-info@cups.org
- *         WWW: http://www.cups.org
+ *   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:
  *
@@ -71,7 +62,7 @@ main(int  argc,                               /* I - Number of command-line args */
   mime        = NULL;
   src         = NULL;
   dst         = NULL;
-  filter_path = "../filter:../pdftops";
+  filter_path = "../filter:../pdftops:" CUPS_SERVERBIN "/filter";
 
   for (i = 1; i < argc; i ++)
     if (!strcmp(argv[i], "-d"))
@@ -98,6 +89,8 @@ main(int  argc,                               /* I - Number of command-line args */
       if (src)
        printf("%s: %s/%s%s\n", argv[i], src->super, src->type,
               compression ? " (gzipped)" : "");
+      else if ((src = mimeType(mime, "application", "octet-stream")) != NULL)
+       printf("%s: application/octet-stream\n", argv[i]);
       else
       {
        printf("%s: unknown\n", argv[i]);
@@ -111,7 +104,7 @@ main(int  argc,                             /* I - Number of command-line args */
       sscanf(argv[i], "%15[^/]/%31s", super, type);
       dst = mimeType(mime, super, type);
 
-      filters = mimeFilter(mime, src, dst, &cost, 10);
+      filters = mimeFilter(mime, src, dst, &cost);
 
       if (!filters)
       {
@@ -144,7 +137,7 @@ main(int  argc,                             /* I - Number of command-line args */
     puts("MIME database types:");
     for (src = mimeFirstType(mime); src; src = mimeNextType(mime))
     {
-      printf("\t%s/%s:\n", src->super, src->type);
+      printf("\t%s/%s (%d):\n", src->super, src->type, src->priority);
       print_rules(src->rules);
       puts("");
     }
@@ -158,7 +151,8 @@ main(int  argc,                             /* I - Number of command-line args */
             filter->dst->super, filter->dst->type,
             filter->filter, filter->cost);
 
-    type_dir(mime, "..");
+    type_dir(mime, "../doc");
+    type_dir(mime, "../man");
   }
 
   return (0);
@@ -280,6 +274,9 @@ type_dir(mime_t     *mime,          /* I - MIME database */
 
   while ((dent = cupsDirRead(dir)) != NULL)
   {
+    if (dent->filename[0] == '.')
+      continue;
+
     snprintf(filename, sizeof(filename), "%s/%s", dirname, dent->filename);
 
     if (S_ISDIR(dent->fileinfo.st_mode))
@@ -295,7 +292,7 @@ type_dir(mime_t     *mime,          /* I - MIME database */
       printf("%s: %s/%s%s\n", filename, filetype->super, filetype->type,
              compression ? " (compressed)" : "");
 
-      filters = mimeFilter(mime, filetype, pstype, &cost, 10);
+      filters = mimeFilter(mime, filetype, pstype, &cost);
 
       if (!filters)
        puts("    No filters to convert application/vnd.cups-postscript.");
@@ -325,5 +322,5 @@ type_dir(mime_t     *mime,          /* I - MIME database */
 
 
 /*
- * End of "$Id: testmime.c 5051 2006-02-02 16:13:16Z mike $".
+ * End of "$Id: testmime.c 7670 2008-06-17 22:42:08Z mike $".
  */