]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
Update testmime.c to register PPD filters just like cupsd, for testing.
authormike <mike@7a7537e8-13f0-0310-91df-b6672ffda945>
Tue, 19 Apr 2011 22:25:38 +0000 (22:25 +0000)
committermike <mike@7a7537e8-13f0-0310-91df-b6672ffda945>
Tue, 19 Apr 2011 22:25:38 +0000 (22:25 +0000)
Clean up cupsPreFilter support.

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

scheduler/printers.c
scheduler/testmime.c
xcode/CUPS.xcodeproj/project.pbxproj

index f705bf3bb6795f24391d2879698832a2c11332de..bc560d55afbfe1c67f908a6bdf5f13cc2d9f3fd1 100644 (file)
@@ -1409,8 +1409,11 @@ cupsdRenamePrinter(
   mimeDeleteType(MimeDatabase, p->filetype);
   p->filetype = mimeAddType(MimeDatabase, "printer", name);
 
-  mimeDeleteType(MimeDatabase, p->prefiltertype);
-  p->prefiltertype = mimeAddType(MimeDatabase, "prefilter", name);
+  if (p->prefiltertype)
+  {
+    mimeDeleteType(MimeDatabase, p->prefiltertype);
+    p->prefiltertype = mimeAddType(MimeDatabase, "prefilter", name);
+  }
 
  /*
   * Rename the printer...
@@ -2447,7 +2450,8 @@ cupsdSetPrinterAttrs(cupsd_printer_t *p)/* I - Printer to setup */
 
       if (p->pc && p->pc->prefilters)
       {
-        p->prefiltertype = mimeAddType(MimeDatabase, "prefilter", p->name);
+        if (!p->prefiltertype)
+          p->prefiltertype = mimeAddType(MimeDatabase, "prefilter", p->name);
 
         for (filter = (char *)cupsArrayFirst(p->pc->prefilters);
             filter;
index 36414e2a5bea5c047910b891e89941de26f6e62d..15fb52438cac5a5b1e3a01276b76b38e6ad8299a 100644 (file)
  *
  * Contents:
  *
- *   main()        - Main entry for the test program.
- *   print_rules() - Print the rules for a file type...
- *   type_dir()    - Show the MIME types for a given directory.
+ *   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.
  */
 
 /*
@@ -25,6 +27,8 @@
 
 #include <cups/string-private.h>
 #include <cups/dir.h>
+#include <cups/debug-private.h>
+#include <cups/ppd-private.h>
 #include "mime.h"
 
 
@@ -32,6 +36,9 @@
  * Local functions...
  */
 
+static void    add_ppd_filter(mime_t *mime, mime_type_t *filtertype,
+                              const char *filter);
+static void    add_ppd_filters(mime_t *mime, ppd_file_t *ppd);
 static void    print_rules(mime_magic_t *rules);
 static void    type_dir(mime_t *mime, const char *dirname);
 
@@ -53,6 +60,8 @@ main(int  argc,                               /* I - Number of command-line args */
   mime_t       *mime;                  /* MIME database */
   mime_type_t  *src,                   /* Source type */
                *dst;                   /* Destination type */
+  struct stat  srcinfo;                /* Source information */
+  ppd_file_t   *ppd;                   /* PPD file */
   cups_array_t *filters;               /* Filters for the file */
   mime_filter_t        *filter;                /* Current filter */
 
@@ -60,7 +69,10 @@ main(int  argc,                              /* I - Number of command-line args */
   mime        = NULL;
   src         = NULL;
   dst         = NULL;
-  filter_path = "../filter:../pdftops:" CUPS_SERVERBIN "/filter";
+  ppd         = NULL;
+  filter_path = "../filter:" CUPS_SERVERBIN "/filter";
+
+  srcinfo.st_size = 0;
 
   for (i = 1; i < argc; i ++)
     if (!strcmp(argv[i], "-d"))
@@ -68,7 +80,12 @@ main(int  argc,                              /* I - Number of command-line args */
       i ++;
 
       if (i < argc)
+      {
         mime = mimeLoad(argv[i], filter_path);
+
+       if (ppd)
+         add_ppd_filters(mime, ppd);
+      }
     }
     else if (!strcmp(argv[i], "-f"))
     {
@@ -77,12 +94,28 @@ main(int  argc,                             /* I - Number of command-line args */
       if (i < argc)
         filter_path = argv[i];
     }
+    else if (!strcmp(argv[i], "-p"))
+    {
+      i ++;
+
+      if (i < argc)
+      {
+        ppd = ppdOpenFile(argv[i]);
+
+       if (mime)
+         add_ppd_filters(mime, ppd);
+      }
+    }
     else if (!src)
     {
       if (!mime)
        mime = mimeLoad("../conf", filter_path);
 
+      if (ppd)
+        add_ppd_filters(mime, ppd);
+
       src = mimeFileType(mime, argv[i], NULL, &compression);
+      stat(argv[i], &srcinfo);
 
       if (src)
        printf("%s: %s/%s%s\n", argv[i], src->super, src->type,
@@ -102,7 +135,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);
+      filters = mimeFilter2(mime, src, srcinfo.st_size, dst, &cost);
 
       if (!filters)
       {
@@ -111,15 +144,25 @@ main(int  argc,                           /* I - Number of command-line args */
       }
       else
       {
-        printf("Filter cost = %d\n", cost);
+        int first = 1;                 /* First filter shown? */
 
-        filter = (mime_filter_t *)cupsArrayFirst(filters);
-       fputs(filter->filter, stdout);
+        printf("Filter cost = %d\n", cost);
 
-       for (filter = (mime_filter_t *)cupsArrayNext(filters);
+        for (filter = (mime_filter_t *)cupsArrayFirst(filters);
             filter;
             filter = (mime_filter_t *)cupsArrayNext(filters))
-         printf(" | %s", filter->filter);
+       {
+         if (!strcmp(filter->filter, "-"))
+           continue;
+
+          if (first)
+         {
+           first = 0;
+           fputs(filter->filter, stdout);
+         }
+         else
+           printf(" | %s", filter->filter);
+       }
 
         putchar('\n');
 
@@ -128,7 +171,11 @@ main(int  argc,                            /* I - Number of command-line args */
     }
 
   if (!mime)
+  {
     mime = mimeLoad("../conf", filter_path);
+    if (ppd)
+      add_ppd_filters(mime, ppd);
+  }
 
   if (!src)
   {
@@ -150,13 +197,173 @@ main(int  argc,                          /* I - Number of command-line args */
             filter->filter, filter->cost);
 
     type_dir(mime, "../doc");
-    type_dir(mime, "../man");
   }
 
   return (0);
 }
 
 
+/*
+ * 'add_printer_filter()' - Add a printer filter from a PPD.
+ */
+
+static void
+add_ppd_filter(mime_t      *mime,      /* I - MIME database */
+               mime_type_t *filtertype,        /* I - Filter or prefilter MIME type */
+              const char  *filter)     /* I - Filter to add */
+{
+  char         super[MIME_MAX_SUPER],  /* Super-type for filter */
+               type[MIME_MAX_TYPE],    /* Type for filter */
+               dsuper[MIME_MAX_SUPER], /* Destination super-type for filter */
+               dtype[MIME_MAX_TYPE],   /* Destination type for filter */
+               dest[MIME_MAX_SUPER + MIME_MAX_TYPE + 2],
+                                       /* Destination super/type */
+               program[1024];          /* Program/filter name */
+  int          cost;                   /* Cost of filter */
+  size_t       maxsize = 0;            /* Maximum supported file size */
+  mime_type_t  *temptype,              /* MIME type looping var */
+               *desttype;              /* Destination MIME type */
+  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:
+  *
+  *     source/type cost program
+  *     source/type cost maxsize(nnnn) program
+  *     source/type dest/type cost program
+  *     source/type dest/type cost maxsize(nnnn) program
+  */
+
+  if (sscanf(filter, "%15[^/]/%255s%*[ \t]%15[^/]/%255s%d%*[ \t]%1023[^\n]",
+             super, type, dsuper, dtype, &cost, program) == 6)
+  {
+    snprintf(dest, sizeof(dest), "test/%s/%s", dsuper, dtype);
+
+    if ((desttype = mimeType(mime, "printer", dest)) == NULL)
+      desttype = mimeAddType(mime, "printer", dest);
+  }
+  else
+  {
+    if (sscanf(filter, "%15[^/]/%255s%d%*[ \t]%1023[^\n]", super, type, &cost,
+               program) == 4)
+    {
+      desttype = filtertype;
+    }
+    else
+    {
+      printf("testmime: Invalid filter string \"%s\".\n", filter);
+      return;
+    }
+  }
+
+  if (!strncmp(program, "maxsize(", 8))
+  {
+    char       *ptr;                   /* Pointer into maxsize(nnnn) program */
+
+    maxsize = strtoll(program + 8, &ptr, 10);
+
+    if (*ptr != ')')
+    {
+      printf("testmime: Invalid filter string \"%s\".\n", filter);
+      return;
+    }
+
+    ptr ++;
+    while (_cups_isspace(*ptr))
+      ptr ++;
+
+    _cups_strcpy(program, ptr);
+  }
+
+ /*
+  * Add the filter to the MIME database, supporting wildcards as needed...
+  */
+
+  for (temptype = mimeFirstType(mime);
+       temptype;
+       temptype = mimeNextType(mime))
+    if (((super[0] == '*' && strcasecmp(temptype->super, "printer")) ||
+         !strcasecmp(temptype->super, super)) &&
+        (type[0] == '*' || !strcasecmp(temptype->type, type)))
+    {
+      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, cost, "-");
+        }
+      }
+      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;
+    }
+}
+
+
+/*
+ * 'add_ppd_filters()' - Add all filters from a PPD.
+ */
+
+static void
+add_ppd_filters(mime_t     *mime,      /* I - MIME database */
+                ppd_file_t *ppd)       /* I - PPD file */
+{
+  _ppd_cache_t *pc;                    /* Cache data for PPD */
+  const char   *value;                 /* Filter definition value */
+  mime_type_t  *filter,                /* Filter type */
+               *prefilter;             /* Pre-filter type */
+
+
+  pc = _ppdCacheCreateWithPPD(ppd);
+  if (!pc)
+    return;
+
+  filter = mimeAddType(mime, "printer", "test");
+
+  if (pc->filters)
+  {
+    for (value = (const char *)cupsArrayFirst(pc->filters);
+         value;
+         value = (const char *)cupsArrayNext(pc->filters))
+      add_ppd_filter(mime, filter, value);
+  }
+  else
+  {
+    add_ppd_filter(mime, filter, "application/vnd.cups-raw 0 -");
+    add_ppd_filter(mime, filter, "application/vnd.cups-postscript 0 -");
+  }
+
+  if (pc->prefilters)
+  {
+    prefilter = mimeAddType(mime, "prefilter", "test");
+
+    for (value = (const char *)cupsArrayFirst(pc->prefilters);
+         value;
+         value = (const char *)cupsArrayNext(pc->prefilters))
+      add_ppd_filter(mime, prefilter, value);
+  }
+}
+
+
 /*
  * 'print_rules()' - Print the rules for a file type...
  */
index 4a23dc924b0d1a3f14e185fc27afb712a772be15..b977a4e90969a4adb94145a1e7c88e3540d3064e 100644 (file)
@@ -13,6 +13,7 @@
                        buildPhases = (
                        );
                        dependencies = (
+                               270CCDB2135E3CDE00007BE2 /* PBXTargetDependency */,
                                273BF6DE1333B6370022CAAB /* PBXTargetDependency */,
                        );
                        name = Tests;
@@ -58,6 +59,9 @@
 /* End PBXAggregateTarget section */
 
 /* Begin PBXBuildFile section */
+               270CCDB9135E3D0900007BE2 /* libcups_static.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 72F75A4C1336F31B004BB496 /* libcups_static.dylib */; };
+               270CCDBA135E3D0900007BE2 /* libcupsmime.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 72220FAC13330B2200FCA411 /* libcupsmime.dylib */; };
+               270CCDBC135E3D3E00007BE2 /* testmime.c in Sources */ = {isa = PBXBuildFile; fileRef = 270CCDBB135E3D3E00007BE2 /* testmime.c */; };
                273BF6C71333B5370022CAAB /* testcups.c in Sources */ = {isa = PBXBuildFile; fileRef = 273BF6C61333B5370022CAAB /* testcups.c */; };
                273BF6CE1333B5950022CAAB /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 273BF6CB1333B5950022CAAB /* CoreFoundation.framework */; };
                273BF6CF1333B5950022CAAB /* libiconv.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 273BF6CC1333B5950022CAAB /* libiconv.dylib */; };
 /* End PBXBuildFile section */
 
 /* Begin PBXContainerItemProxy section */
+               270CCDB1135E3CDE00007BE2 /* PBXContainerItemProxy */ = {
+                       isa = PBXContainerItemProxy;
+                       containerPortal = 72BF96371333042100B1EAD7 /* Project object */;
+                       proxyType = 1;
+                       remoteGlobalIDString = 270CCDA6135E3C9E00007BE2;
+                       remoteInfo = testmime;
+               };
+               270CCDB5135E3CF700007BE2 /* PBXContainerItemProxy */ = {
+                       isa = PBXContainerItemProxy;
+                       containerPortal = 72BF96371333042100B1EAD7 /* Project object */;
+                       proxyType = 1;
+                       remoteGlobalIDString = 72220FAB13330B2200FCA411;
+                       remoteInfo = libcupsmime;
+               };
+               270CCDB7135E3CFD00007BE2 /* PBXContainerItemProxy */ = {
+                       isa = PBXContainerItemProxy;
+                       containerPortal = 72BF96371333042100B1EAD7 /* Project object */;
+                       proxyType = 1;
+                       remoteGlobalIDString = 274FF6891333B1C400317ECB;
+                       remoteInfo = libcups_static;
+               };
                273BF6C81333B5410022CAAB /* PBXContainerItemProxy */ = {
                        isa = PBXContainerItemProxy;
                        containerPortal = 72BF96371333042100B1EAD7 /* Project object */;
 /* End PBXContainerItemProxy section */
 
 /* Begin PBXCopyFilesBuildPhase section */
+               270CCDA5135E3C9E00007BE2 /* CopyFiles */ = {
+                       isa = PBXCopyFilesBuildPhase;
+                       buildActionMask = 2147483647;
+                       dstPath = /usr/share/man/man1/;
+                       dstSubfolderSpec = 0;
+                       files = (
+                       );
+                       runOnlyForDeploymentPostprocessing = 1;
+               };
                273BF6BB1333B5000022CAAB /* CopyFiles */ = {
                        isa = PBXCopyFilesBuildPhase;
                        buildActionMask = 2147483647;
 /* End PBXCopyFilesBuildPhase section */
 
 /* 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>"; };
                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; };
 /* End PBXFileReference section */
 
 /* Begin PBXFrameworksBuildPhase section */
+               270CCDA4135E3C9E00007BE2 /* Frameworks */ = {
+                       isa = PBXFrameworksBuildPhase;
+                       buildActionMask = 2147483647;
+                       files = (
+                               270CCDB9135E3D0900007BE2 /* libcups_static.dylib in Frameworks */,
+                               270CCDBA135E3D0900007BE2 /* libcupsmime.dylib in Frameworks */,
+                       );
+                       runOnlyForDeploymentPostprocessing = 0;
+               };
                273BF6BA1333B5000022CAAB /* Frameworks */ = {
                        isa = PBXFrameworksBuildPhase;
                        buildActionMask = 2147483647;
                273BF6B81333B4A90022CAAB /* tests */ = {
                        isa = PBXGroup;
                        children = (
+                               270CCDBB135E3D3E00007BE2 /* testmime.c */,
                                273BF6C61333B5370022CAAB /* testcups.c */,
                        );
                        name = tests;
                                724379301333FB85009631B9 /* socket */,
                                724379471333FEA9009631B9 /* dnssd */,
                                7243795B1333FF1D009631B9 /* usb */,
-                               72F75A4C1336F31B004BB496 /* libcups_static.dylib */,
                                72F75A521336F950004BB496 /* cupstestppd */,
                                2766835C1337A9B6000D33D0 /* cupsctl */,
                                276683701337AC79000D33D0 /* ppdc */,
                                276684041337FA1D000D33D0 /* cupsaddsmb */,
                                7258EAE2134594C4009286F1 /* rastertopwg */,
                                720DD6C21358FD5F0064AA82 /* snmp */,
+                               270CCDA7135E3C9E00007BE2 /* testmime */,
                        );
                        name = Products;
                        sourceTree = "<group>";
                72220FB113330B4A00FCA411 /* Frameworks */ = {
                        isa = PBXGroup;
                        children = (
+                               72F75A4C1336F31B004BB496 /* libcups_static.dylib */,
                                72220FAC13330B2200FCA411 /* libcupsmime.dylib */,
+                               72220EAE1333047D00FCA411 /* libcups.dylib */,
+                               72F75A611336F9A3004BB496 /* libcupsimage.dylib */,
+                               274FF5EE133330C800317ECB /* libcupsppdc.dylib */,
+                               724379C81333FFF3009631B9 /* CoreFoundation.framework */,
+                               724379671333FF3B009631B9 /* IOKit.framework */,
+                               273BF6D51333B5F60022CAAB /* libresolv.dylib */,
+                               273BF6D61333B5F60022CAAB /* SystemConfiguration.framework */,
+                               273BF6D11333B5C30022CAAB /* Kerberos.framework */,
+                               273BF6D21333B5C30022CAAB /* Security.framework */,
+                               273BF6CB1333B5950022CAAB /* CoreFoundation.framework */,
+                               273BF6CC1333B5950022CAAB /* libiconv.dylib */,
+                               273BF6CD1333B5950022CAAB /* libz.dylib */,
                                7263EE3913330EC500BA4D44 /* libldap.dylib */,
                                7263EE3713330E7500BA4D44 /* libz.dylib */,
                                7263EE3513330E4E00BA4D44 /* CoreFoundation.framework */,
                72BF96351333042100B1EAD7 = {
                        isa = PBXGroup;
                        children = (
-                               72220EAE1333047D00FCA411 /* libcups.dylib */,
-                               72F75A611336F9A3004BB496 /* libcupsimage.dylib */,
-                               274FF5EE133330C800317ECB /* libcupsppdc.dylib */,
-                               724379C81333FFF3009631B9 /* CoreFoundation.framework */,
-                               724379671333FF3B009631B9 /* IOKit.framework */,
-                               273BF6D51333B5F60022CAAB /* libresolv.dylib */,
-                               273BF6D61333B5F60022CAAB /* SystemConfiguration.framework */,
-                               273BF6D11333B5C30022CAAB /* Kerberos.framework */,
-                               273BF6D21333B5C30022CAAB /* Security.framework */,
-                               273BF6CB1333B5950022CAAB /* CoreFoundation.framework */,
-                               273BF6CC1333B5950022CAAB /* libiconv.dylib */,
-                               273BF6CD1333B5950022CAAB /* libz.dylib */,
                                72220FB113330B4A00FCA411 /* Frameworks */,
                                72220F45133305D000FCA411 /* Public Headers */,
                                72220F461333060C00FCA411 /* Private Headers */,
 /* End PBXHeadersBuildPhase section */
 
 /* Begin PBXNativeTarget section */
+               270CCDA6135E3C9E00007BE2 /* testmime */ = {
+                       isa = PBXNativeTarget;
+                       buildConfigurationList = 270CCDAF135E3C9E00007BE2 /* Build configuration list for PBXNativeTarget "testmime" */;
+                       buildPhases = (
+                               270CCDA3135E3C9E00007BE2 /* Sources */,
+                               270CCDA4135E3C9E00007BE2 /* Frameworks */,
+                               270CCDA5135E3C9E00007BE2 /* CopyFiles */,
+                       );
+                       buildRules = (
+                       );
+                       dependencies = (
+                               270CCDB8135E3CFD00007BE2 /* PBXTargetDependency */,
+                               270CCDB6135E3CF700007BE2 /* PBXTargetDependency */,
+                       );
+                       name = testmime;
+                       productName = testmime;
+                       productReference = 270CCDA7135E3C9E00007BE2 /* testmime */;
+                       productType = "com.apple.product-type.tool";
+               };
                273BF6BC1333B5000022CAAB /* testcups */ = {
                        isa = PBXNativeTarget;
                        buildConfigurationList = 273BF6C31333B5000022CAAB /* Build configuration list for PBXNativeTarget "testcups" */;
                                720DD6C11358FD5F0064AA82 /* snmp */,
                                7243792F1333FB85009631B9 /* socket */,
                                273BF6BC1333B5000022CAAB /* testcups */,
+                               270CCDA6135E3C9E00007BE2 /* testmime */,
                                7243795A1333FF1D009631B9 /* usb */,
                        );
                };
 /* End PBXProject section */
 
 /* Begin PBXSourcesBuildPhase section */
+               270CCDA3135E3C9E00007BE2 /* Sources */ = {
+                       isa = PBXSourcesBuildPhase;
+                       buildActionMask = 2147483647;
+                       files = (
+                               270CCDBC135E3D3E00007BE2 /* testmime.c in Sources */,
+                       );
+                       runOnlyForDeploymentPostprocessing = 0;
+               };
                273BF6B91333B5000022CAAB /* Sources */ = {
                        isa = PBXSourcesBuildPhase;
                        buildActionMask = 2147483647;
 /* End PBXSourcesBuildPhase section */
 
 /* Begin PBXTargetDependency section */
+               270CCDB2135E3CDE00007BE2 /* PBXTargetDependency */ = {
+                       isa = PBXTargetDependency;
+                       target = 270CCDA6135E3C9E00007BE2 /* testmime */;
+                       targetProxy = 270CCDB1135E3CDE00007BE2 /* PBXContainerItemProxy */;
+               };
+               270CCDB6135E3CF700007BE2 /* PBXTargetDependency */ = {
+                       isa = PBXTargetDependency;
+                       target = 72220FAB13330B2200FCA411 /* libcupsmime */;
+                       targetProxy = 270CCDB5135E3CF700007BE2 /* PBXContainerItemProxy */;
+               };
+               270CCDB8135E3CFD00007BE2 /* PBXTargetDependency */ = {
+                       isa = PBXTargetDependency;
+                       target = 274FF6891333B1C400317ECB /* libcups_static */;
+                       targetProxy = 270CCDB7135E3CFD00007BE2 /* PBXContainerItemProxy */;
+               };
                273BF6C91333B5410022CAAB /* PBXTargetDependency */ = {
                        isa = PBXTargetDependency;
                        target = 274FF6891333B1C400317ECB /* libcups_static */;
 /* End PBXTargetDependency section */
 
 /* Begin XCBuildConfiguration section */
+               270CCDAD135E3C9E00007BE2 /* Debug */ = {
+                       isa = XCBuildConfiguration;
+                       buildSettings = {
+                               ALWAYS_SEARCH_USER_PATHS = NO;
+                               ARCHS = "$(ARCHS_STANDARD_32_64_BIT)";
+                               COPY_PHASE_STRIP = NO;
+                               GCC_C_LANGUAGE_STANDARD = gnu99;
+                               GCC_DYNAMIC_NO_PIC = NO;
+                               GCC_ENABLE_OBJC_EXCEPTIONS = YES;
+                               GCC_OPTIMIZATION_LEVEL = 0;
+                               GCC_PREPROCESSOR_DEFINITIONS = DEBUG;
+                               GCC_SYMBOLS_PRIVATE_EXTERN = NO;
+                               GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
+                               GCC_WARN_ABOUT_RETURN_TYPE = YES;
+                               GCC_WARN_UNUSED_VARIABLE = YES;
+                               ONLY_ACTIVE_ARCH = YES;
+                               PRODUCT_NAME = "$(TARGET_NAME)";
+                               SKIP_INSTALL = NO;
+                       };
+                       name = Debug;
+               };
+               270CCDAE135E3C9E00007BE2 /* Release */ = {
+                       isa = XCBuildConfiguration;
+                       buildSettings = {
+                               ALWAYS_SEARCH_USER_PATHS = NO;
+                               COPY_PHASE_STRIP = YES;
+                               DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
+                               GCC_C_LANGUAGE_STANDARD = gnu99;
+                               GCC_ENABLE_OBJC_EXCEPTIONS = YES;
+                               GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
+                               GCC_WARN_ABOUT_RETURN_TYPE = YES;
+                               GCC_WARN_UNUSED_VARIABLE = YES;
+                               PRODUCT_NAME = "$(TARGET_NAME)";
+                               SKIP_INSTALL = NO;
+                       };
+                       name = Release;
+               };
                273BF6C41333B5000022CAAB /* Debug */ = {
                        isa = XCBuildConfiguration;
                        buildSettings = {
 /* End XCBuildConfiguration section */
 
 /* Begin XCConfigurationList section */
+               270CCDAF135E3C9E00007BE2 /* Build configuration list for PBXNativeTarget "testmime" */ = {
+                       isa = XCConfigurationList;
+                       buildConfigurations = (
+                               270CCDAD135E3C9E00007BE2 /* Debug */,
+                               270CCDAE135E3C9E00007BE2 /* Release */,
+                       );
+                       defaultConfigurationIsVisible = 0;
+               };
                273BF6C31333B5000022CAAB /* Build configuration list for PBXNativeTarget "testcups" */ = {
                        isa = XCConfigurationList;
                        buildConfigurations = (
                                720DD6CA1358FD5F0064AA82 /* Release */,
                        );
                        defaultConfigurationIsVisible = 0;
+                       defaultConfigurationName = Release;
                };
                72220EB21333047D00FCA411 /* Build configuration list for PBXNativeTarget "libcups" */ = {
                        isa = XCConfigurationList;