]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
Clean out old code (Issue #4980)
authorMichael R Sweet <michael.r.sweet@gmail.com>
Tue, 14 Mar 2017 17:03:24 +0000 (13:03 -0400)
committerMichael R Sweet <michael.r.sweet@gmail.com>
Tue, 14 Mar 2017 17:03:24 +0000 (13:03 -0400)
cups/ppd-cache.c
cups/ppd-private.h

index 6bd80b8f29379572e6ff1545cb73717cd8729a47..e712341056788fbc3af8528cfec632932c480566 100644 (file)
@@ -36,7 +36,6 @@ static void   pwg_add_finishing(cups_array_t *finishings, ipp_finishings_t templat
 static int     pwg_compare_finishings(_pwg_finishings_t *a,
                                       _pwg_finishings_t *b);
 static void    pwg_free_finishings(_pwg_finishings_t *f);
-static void    pwg_free_material(_pwg_material_t *m);
 static void    pwg_ppdize_name(const char *ipp, char *name, size_t namesize);
 static void    pwg_ppdize_resolution(ipp_attribute_t *attr, int element, int *xres, int *yres, char *name, size_t namesize);
 static void    pwg_unppdize_name(const char *ppd, char *name, size_t namesize,
@@ -504,53 +503,6 @@ _ppdCacheCreateWithFile(
       _cupsSetError(IPP_STATUS_ERROR_INTERNAL, _("Bad PPD cache file."), 1);
       goto create_error;
     }
-    else if (!_cups_strcasecmp(line, "3D"))
-    {
-      pc->cups_3d = _cupsStrAlloc(value);
-    }
-    else if (!_cups_strcasecmp(line, "LayerOrder"))
-    {
-      pc->cups_layer_order = _cupsStrAlloc(value);
-    }
-    else if (!_cups_strcasecmp(line, "Accuracy"))
-    {
-      sscanf(value, "%d%d%d", pc->cups_accuracy + 0, pc->cups_accuracy + 1, pc->cups_accuracy + 2);
-    }
-    else if (!_cups_strcasecmp(line, "Volume"))
-    {
-      sscanf(value, "%d%d%d", pc->cups_volume + 0, pc->cups_volume + 1, pc->cups_volume + 2);
-    }
-    else if (!_cups_strcasecmp(line, "Material"))
-    {
-     /*
-      * Material key "name" name=value ... name=value
-      */
-
-      if ((valueptr = strchr(value, ' ')) != NULL)
-      {
-       _pwg_material_t *material = (_pwg_material_t *)calloc(1, sizeof(_pwg_material_t));
-
-        *valueptr++ = '\0';
-
-        material->key = _cupsStrAlloc(value);
-
-        if (*valueptr == '\"')
-       {
-         value = valueptr + 1;
-         if ((valueptr = strchr(value, '\"')) != NULL)
-         {
-           *valueptr++ = '\0';
-           material->name = _cupsStrAlloc(value);
-           material->num_props = cupsParseOptions(valueptr, 0, &material->props);
-         }
-       }
-
-       if (!pc->materials)
-         pc->materials = cupsArrayNew3(NULL, NULL, NULL, 0, NULL, (cups_afree_func_t)pwg_free_material);
-
-        cupsArrayAdd(pc->materials, material);
-      }
-    }
     else if (!_cups_strcasecmp(line, "Filter"))
     {
       if (!pc->filters)
@@ -1894,42 +1846,6 @@ _ppdCacheCreateWithPPD(ppd_file_t *ppd)  /* I - PPD file */
   if ((ppd_attr = ppdFindAttr(ppd, "APPrinterIconPath", NULL)) != NULL)
     cupsArrayAdd(pc->support_files, ppd_attr->value);
 
- /*
-  * 3D stuff...
-  */
-
-  if ((ppd_attr = ppdFindAttr(ppd, "cups3D", NULL)) != NULL)
-    pc->cups_3d = _cupsStrAlloc(ppd_attr->value);
-
-  if ((ppd_attr = ppdFindAttr(ppd, "cupsLayerOrder", NULL)) != NULL)
-    pc->cups_layer_order = _cupsStrAlloc(ppd_attr->value);
-
-  if ((ppd_attr = ppdFindAttr(ppd, "cupsAccuracy", NULL)) != NULL)
-    sscanf(ppd_attr->value, "%d%d%d", pc->cups_accuracy + 0, pc->cups_accuracy + 1, pc->cups_accuracy + 2);
-
-  if ((ppd_attr = ppdFindAttr(ppd, "cupsVolume", NULL)) != NULL)
-    sscanf(ppd_attr->value, "%d%d%d", pc->cups_volume + 0, pc->cups_volume + 1, pc->cups_volume + 2);
-
-  for (ppd_attr = ppdFindAttr(ppd, "cupsMaterial", NULL);
-       ppd_attr;
-       ppd_attr = ppdFindNextAttr(ppd, "cupsMaterial", NULL))
-  {
-   /*
-    * *cupsMaterial key/name: "name=value ... name=value"
-    */
-
-    _pwg_material_t    *material = (_pwg_material_t *)calloc(1, sizeof(_pwg_material_t));
-
-    material->key = _cupsStrAlloc(ppd_attr->name);
-    material->name = _cupsStrAlloc(ppd_attr->text);
-    material->num_props = cupsParseOptions(ppd_attr->value, 0, &material->props);
-
-    if (!pc->materials)
-      pc->materials = cupsArrayNew3(NULL, NULL, NULL, 0, NULL, (cups_afree_func_t)pwg_free_material);
-
-    cupsArrayAdd(pc->materials, material);
-  }
-
  /*
   * Return the cache data...
   */
@@ -2037,11 +1953,6 @@ _ppdCacheDestroy(_ppd_cache_t *pc)       /* I - PPD cache and mapping data */
 
   cupsArrayDelete(pc->support_files);
 
-  _cupsStrFree(pc->cups_3d);
-  _cupsStrFree(pc->cups_layer_order);
-
-  cupsArrayDelete(pc->materials);
-
   free(pc);
 }
 
@@ -2799,7 +2710,6 @@ _ppdCacheWriteFile(
   cups_option_t                *option;        /* Current option */
   const char           *value;         /* Filter/pre-filter value */
   char                 newfile[1024];  /* New filename */
-  _pwg_material_t      *m;             /* Material */
 
 
  /*
@@ -2980,32 +2890,6 @@ _ppdCacheWriteFile(
        value = (char *)cupsArrayNext(pc->support_files))
     cupsFilePutConf(fp, "SupportFile", value);
 
- /*
-  * 3D stuff...
-  */
-
-  if (pc->cups_3d)
-    cupsFilePutConf(fp, "3D", pc->cups_3d);
-
-  if (pc->cups_layer_order)
-    cupsFilePutConf(fp, "LayerOrder", pc->cups_layer_order);
-
-  if (pc->cups_accuracy[0] || pc->cups_accuracy[0] || pc->cups_accuracy[2])
-    cupsFilePrintf(fp, "Accuracy %d %d %d\n", pc->cups_accuracy[0], pc->cups_accuracy[1], pc->cups_accuracy[2]);
-
-  if (pc->cups_volume[0] || pc->cups_volume[0] || pc->cups_volume[2])
-    cupsFilePrintf(fp, "Volume %d %d %d\n", pc->cups_volume[0], pc->cups_volume[1], pc->cups_volume[2]);
-
-  for (m = (_pwg_material_t *)cupsArrayFirst(pc->materials);
-       m;
-       m = (_pwg_material_t *)cupsArrayNext(pc->materials))
-  {
-    cupsFilePrintf(fp, "Material %s \"%s\"", m->key, m->name);
-    for (i = 0; i < m->num_props; i ++)
-      cupsFilePrintf(fp, " %s=%s", m->props[i].name, m->props[i].value);
-    cupsFilePuts(fp, "\n");
-  }
-
  /*
   * IPP attributes, if any...
   */
@@ -4411,22 +4295,6 @@ pwg_free_finishings(
 }
 
 
-/*
- * 'pwg_free_material()' - Free a material value.
- */
-
-static void
-pwg_free_material(_pwg_material_t *m)  /* I - Material value */
-{
-  _cupsStrFree(m->key);
-  _cupsStrFree(m->name);
-
-  cupsFreeOptions(m->num_props, m->props);
-
-  free(m);
-}
-
-
 /*
  * 'pwg_ppdize_name()' - Convert an IPP keyword to a PPD keyword.
  */
index 6020190915badccbd54e0adee6390e282beebc24..b199bbd2e93464c96b69debe310d9b4e1968c672 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * Private PPD definitions for CUPS.
  *
- * Copyright 2007-2015 by Apple Inc.
+ * Copyright 2007-2017 by Apple Inc.
  * Copyright 1997-2007 by Easy Software Products, all rights reserved.
  *
  * These coded instructions, statements, and computer programs are the
@@ -47,7 +47,7 @@ extern "C" {
  * Constants...
  */
 
-#  define _PPD_CACHE_VERSION   7       /* Version number in cache file */
+#  define _PPD_CACHE_VERSION   8       /* Version number in cache file */
 
 
 /*
@@ -100,7 +100,7 @@ typedef enum _pwg_print_color_mode_e        /**** PWG print-color-mode indices ****/
 {
   _PWG_PRINT_COLOR_MODE_MONOCHROME = 0,        /* print-color-mode=monochrome */
   _PWG_PRINT_COLOR_MODE_COLOR,         /* print-color-mode=color */
-  /* Other proposed values are not supported by CUPS yet. */
+  /* Other values are not supported by CUPS yet. */
   _PWG_PRINT_COLOR_MODE_MAX
 } _pwg_print_color_mode_t;
 
@@ -119,14 +119,6 @@ typedef struct _pwg_finishings_s   /**** PWG finishings mapping data ****/
   cups_option_t                *options;       /* Options to apply */
 } _pwg_finishings_t;
 
-typedef struct _pwg_material_s         /**** PWG material mapping data ****/
-{
-  char         *key,                   /* material-key value */
-               *name;                  /* material-name value */
-  int          num_props;              /* Number of properties */
-  cups_option_t        *props;                 /* Material properties */
-} _pwg_material_t;
-
 struct _ppd_cache_s                    /**** PPD cache and PWG conversion data ****/
 {
   int          num_bins;               /* Number of output bins */
@@ -166,11 +158,6 @@ struct _ppd_cache_s                        /**** PPD cache and PWG conversion data ****/
   cups_array_t *mandatory;             /* cupsMandatory value */
   char         *charge_info_uri;       /* cupsChargeInfoURI value */
   cups_array_t *support_files;         /* Support files - ICC profiles, etc. */
-  char         *cups_3d,               /* cups3D value */
-               *cups_layer_order;      /* cupsLayerOrder value */
-  int          cups_accuracy[3];       /* cupsAccuracy value - x, y, and z in nanometers */
-  int          cups_volume[3];         /* cupsVolume value - x, y, and z in millimeters */
-  cups_array_t *materials;             /* cupsMaterial values */
 };