]> git.ipfire.org Git - thirdparty/cups-filters.git/commitdiff
libppd: Code clean-up for code of libppd
authorTill Kamppeter <till.kamppeter@gmail.com>
Sat, 15 Oct 2022 13:23:10 +0000 (15:23 +0200)
committerTill Kamppeter <till.kamppeter@gmail.com>
Sat, 15 Oct 2022 13:23:10 +0000 (15:23 +0200)
Cleaned up the code following the coding style rules in the
DEVELOPING.md file of the CUPS source code.

This improves the readability of the code a lot, especially as missing
spaces got inserted in comma-separated lists ("xxx,yyy,zzz" -> "xxx,
yyy, zzz") and around operators ("x=a*(b+c)%4" -> "x = a * (b + c) %
4"), what got nearly completely missed out by several contributors.

Comments are re-formatted to use "// ..." instead of "/* ... */", like
in PAPPL, so C and C++ files get the same comment style.

Also we get rid of the mix of many different coding styles which came
together from the many code contributions received during more than a
decade, even before the start of the cups-filters project.

In addition, all the file's header comments reflect the new license,
Apache 2.0, the same license as used for CUPS.

70 files changed:
ppd/array-private.h
ppd/array.c
ppd/debug-internal.h
ppd/debug-private.h
ppd/debug.c
ppd/encode.c
ppd/epson.h
ppd/file-private.h
ppd/file.c
ppd/genstrings.cxx
ppd/hp.h
ppd/imagetops-pstops.c
ppd/ipp-private.h
ppd/label.h
ppd/language-private.h
ppd/language.c
ppd/pdftops.c
ppd/ppd-attr.c
ppd/ppd-cache.c
ppd/ppd-collection.cxx
ppd/ppd-conflicts.c
ppd/ppd-custom.c
ppd/ppd-emit.c
ppd/ppd-filter.c
ppd/ppd-filter.h
ppd/ppd-generator.c
ppd/ppd-ipp.c
ppd/ppd-load-profile.c
ppd/ppd-localize.c
ppd/ppd-mark.c
ppd/ppd-page.c
ppd/ppd.c
ppd/ppd.h
ppd/ppdc-array.cxx
ppd/ppdc-attr.cxx
ppd/ppdc-catalog.cxx
ppd/ppdc-choice.cxx
ppd/ppdc-constraint.cxx
ppd/ppdc-driver.cxx
ppd/ppdc-file.cxx
ppd/ppdc-filter.cxx
ppd/ppdc-font.cxx
ppd/ppdc-group.cxx
ppd/ppdc-import.cxx
ppd/ppdc-mediasize.cxx
ppd/ppdc-message.cxx
ppd/ppdc-option.cxx
ppd/ppdc-private.h
ppd/ppdc-profile.cxx
ppd/ppdc-shared.cxx
ppd/ppdc-source.cxx
ppd/ppdc-string.cxx
ppd/ppdc-variable.cxx
ppd/ppdc.cxx
ppd/ppdc.h
ppd/ppdhtml.cxx
ppd/ppdi.cxx
ppd/ppdmerge.cxx
ppd/ppdpo.cxx
ppd/raster-error.c
ppd/raster-interpret.c
ppd/raster-private.h
ppd/rastertops.c
ppd/snprintf.c
ppd/string-private.h
ppd/string.c
ppd/testdriver.c
ppd/testppd.c
ppd/thread-private.h
ppd/thread.c

index f2b3c7cd16b4ac23d0ce037cbe5065a6733b9d06..d2a6418b202e14aa8e69fad3de79b52fc88b6794 100644 (file)
@@ -1,33 +1,34 @@
-/*
- * Private array definitions for libppd.
- *
- * Copyright 2011-2012 by Apple Inc.
- *
- * Licensed under Apache License v2.0.  See the file "LICENSE" for more information.
- */
+//
+// Private array definitions for libppd.
+//
+// Copyright 2011-2012 by Apple Inc.
+//
+// Licensed under Apache License v2.0.  See the file "LICENSE" for more
+// information.
+//
 
 #ifndef _PPD_ARRAY_PRIVATE_H_
 #  define _PPD_ARRAY_PRIVATE_H_
 
-/*
- * Include necessary headers...
- */
+//
+// Include necessary headers...
+//
 
 #  include <cups/array.h>
 
 
-/*
- * C++ magic...
- */
+//
+// C++ magic...
+//
 
 #  ifdef __cplusplus
 extern "C" {
-#  endif /* __cplusplus */
+#  endif // __cplusplus
 
 
-/*
- * Functions...
- */
+//
+// Functions...
+//
 
 extern int             _ppdArrayAddStrings(cups_array_t *a, const char *s,
                                             char delim);
@@ -35,5 +36,5 @@ extern cups_array_t   *_ppdArrayNewStrings(const char *s, char delim);
 
 #  ifdef __cplusplus
 }
-#  endif /* __cplusplus */
-#endif /* !_PPD_ARRAY_PRIVATE_H_ */
+#  endif // __cplusplus
+#endif // !_PPD_ARRAY_PRIVATE_H_
index ce0345e12f606c7bc84227c8c92ee9bce5264d2e..3c7a48eff71118bb4c34ca3c32fb6da5bc1cf9ec 100644 (file)
@@ -1,41 +1,43 @@
-/*
- * Sorted array routines for libppd.
- *
- * Copyright 2007-2014 by Apple Inc.
- * Copyright 1997-2007 by Easy Software Products.
- *
- * Licensed under Apache License v2.0.  See the file "LICENSE" for more information.
- */
-
-/*
- * Include necessary headers...
- */
+//
+// Sorted array routines for libppd.
+//
+// Copyright 2007-2014 by Apple Inc.
+// Copyright 1997-2007 by Easy Software Products.
+//
+// Licensed under Apache License v2.0.  See the file "LICENSE" for more
+// information.
+//
+
+//
+// Include necessary headers...
+//
 
 #include "string-private.h"
 #include "debug-internal.h"
 #include "array-private.h"
 
 
-/*
- * '_ppdArrayAddStrings()' - Add zero or more delimited strings to an array.
- *
- * Note: The array MUST be created using the @link _ppdArrayNewStrings@
- * function. Duplicate strings are NOT added. If the string pointer "s" is NULL
- * or the empty string, no strings are added to the array.
- */
+//
+// '_ppdArrayAddStrings()' - Add zero or more delimited strings to an array.
+//
+// Note: The array MUST be created using the @link _ppdArrayNewStrings@
+// function. Duplicate strings are NOT added. If the string pointer "s" is NULL
+// or the empty string, no strings are added to the array.
+//
 
-int                                    /* O - 1 on success, 0 on failure */
-_ppdArrayAddStrings(cups_array_t *a,   /* I - Array */
-                     const char   *s,  /* I - Delimited strings or NULL */
-                     char         delim)/* I - Delimiter character */
+int                                    // O - 1 on success, 0 on failure
+_ppdArrayAddStrings(cups_array_t *a,   // I - Array
+                   const char   *s,    // I - Delimited strings or NULL
+                   char         delim) // I - Delimiter character
 {
-  char         *buffer,                /* Copy of string */
-               *start,                 /* Start of string */
-               *end;                   /* End of string */
-  int          status = 1;             /* Status of add */
+  char         *buffer,                // Copy of string
+               *start,                 // Start of string
+               *end;                   // End of string
+  int          status = 1;             // Status of add
 
 
-  DEBUG_printf(("_ppdArrayAddStrings(a=%p, s=\"%s\", delim='%c')", (void *)a, s, delim));
+  DEBUG_printf(("_ppdArrayAddStrings(a=%p, s=\"%s\", delim='%c')",
+               (void *)a, s, delim));
 
   if (!a || !s || !*s)
   {
@@ -45,9 +47,9 @@ _ppdArrayAddStrings(cups_array_t *a,  /* I - Array */
 
   if (delim == ' ')
   {
-   /*
-    * Skip leading whitespace...
-    */
+    //
+    // Skip leading whitespace...
+    //
 
     DEBUG_puts("1_ppdArrayAddStrings: Skipping leading whitespace.");
 
@@ -60,9 +62,9 @@ _ppdArrayAddStrings(cups_array_t *a,  /* I - Array */
   if (!strchr(s, delim) &&
       (delim != ' ' || (!strchr(s, '\t') && !strchr(s, '\n'))))
   {
-   /*
-    * String doesn't contain a delimiter, so add it as a single value...
-    */
+    //
+    // String doesn't contain a delimiter, so add it as a single value...
+    //
 
     DEBUG_puts("1_ppdArrayAddStrings: No delimiter seen, adding a single "
                "value.");
@@ -79,10 +81,10 @@ _ppdArrayAddStrings(cups_array_t *a,        /* I - Array */
   {
     for (start = end = buffer; *end; start = end)
     {
-     /*
-      * Find the end of the current delimited string and see if we need to add
-      * it...
-      */
+      //
+      // Find the end of the current delimited string and see if we need to add
+      // it...
+      //
 
       if (delim == ' ')
       {
@@ -112,19 +114,19 @@ _ppdArrayAddStrings(cups_array_t *a,      /* I - Array */
 }
 
 
-/*
- * '_ppdArrayNewStrings()' - Create a new array of comma-delimited strings.
- *
- * Note: The array automatically manages copies of the strings passed. If the
- * string pointer "s" is NULL or the empty string, no strings are added to the
- * newly created array.
- */
+//
+// '_ppdArrayNewStrings()' - Create a new array of comma-delimited strings.
+//
+// Note: The array automatically manages copies of the strings passed. If the
+// string pointer "s" is NULL or the empty string, no strings are added to the
+// newly created array.
+//
 
-cups_array_t *                         /* O - Array */
-_ppdArrayNewStrings(const char *s,     /* I - Delimited strings or NULL */
-                     char       delim) /* I - Delimiter character */
+cups_array_t *                         // O - Array
+_ppdArrayNewStrings(const char *s,     // I - Delimited strings or NULL
+                   char       delim)   // I - Delimiter character
 {
-  cups_array_t *a;                     /* Array */
+  cups_array_t *a;                     // Array
 
 
   if ((a = cupsArrayNew3((cups_array_func_t)strcmp, NULL, NULL, 0,
index afb6a7144a166cb608ad1f6df56a4add8fda59a5..8a6f38ef5018eec3ff1d54bbd329fea424917aae 100644 (file)
@@ -1,61 +1,61 @@
-/*
- * Internal debugging macros for libppd.
- *
- * Copyright © 2007-2018 by Apple Inc.
- * Copyright © 1997-2005 by Easy Software Products.
- *
- * Licensed under Apache License v2.0.  See the file "LICENSE" for more
- * information.
- */
+//
+// Internal debugging macros for libppd.
+//
+// Copyright © 2007-2018 by Apple Inc.
+// Copyright © 1997-2005 by Easy Software Products.
+//
+// Licensed under Apache License v2.0.  See the file "LICENSE" for more
+// information.
+//
 
 #ifndef _PPD_DEBUG_INTERNAL_H_
 #  define _PPD_DEBUG_INTERNAL_H_
 
 
-/*
- * Include necessary headers...
- */
+//
+// Include necessary headers...
+//
 
 #  include "debug-private.h"
 
 
-/*
- * C++ magic...
- */
+//
+// C++ magic...
+//
 
 #  ifdef __cplusplus
 extern "C" {
-#  endif /* __cplusplus */
+#  endif // __cplusplus
 
 
-/*
- * The debug macros are used if you compile with DEBUG defined.
- *
- * Usage:
- *
- *   DEBUG_puts("string")
- *   DEBUG_printf(("format string", arg, arg, ...));
- *
- * Note the extra parenthesis around the DEBUG_printf macro...
- *
- * Newlines are not required on the end of messages, as both add one when
- * writing the output.
- *
- * If the first character is a digit, then it represents the "log level" of the
- * message from 0 to 9.  The default level is 1.  The following defines the
- * current levels we use:
- *
- * 0 = public APIs, other than value accessor functions
- * 1 = return values for public APIs
- * 2 = public value accessor APIs, progress for public APIs
- * 3 = return values for value accessor APIs
- * 4 = private APIs, progress for value accessor APIs
- * 5 = return values for private APIs
- * 6 = progress for private APIs
- * 7 = static functions
- * 8 = return values for static functions
- * 9 = progress for static functions
- */
+//
+// The debug macros are used if you compile with DEBUG defined.
+//
+// Usage:
+//
+//   DEBUG_puts("string")
+//   DEBUG_printf(("format string", arg, arg, ...));
+//
+// Note the extra parenthesis around the DEBUG_printf macro...
+//
+// Newlines are not required on the end of messages, as both add one when
+// writing the output.
+//
+// If the first character is a digit, then it represents the "log level" of the
+// message from 0 to 9.  The default level is 1.  The following defines the
+// current levels we use:
+//
+// 0 = public APIs, other than value accessor functions
+// 1 = return values for public APIs
+// 2 = public value accessor APIs, progress for public APIs
+// 3 = return values for value accessor APIs
+// 4 = private APIs, progress for value accessor APIs
+// 5 = return values for private APIs
+// 6 = progress for private APIs
+// 7 = static functions
+// 8 = return values for static functions
+// 9 = progress for static functions
+//
 
 #  ifdef DEBUG
 #    include <assert.h>
@@ -66,22 +66,22 @@ extern "C" {
 #    define DEBUG_puts(x)
 #    define DEBUG_printf(x)
 #    define DEBUG_assert(x)
-#  endif /* DEBUG */
+#  endif // DEBUG
 
 
-/*
- * Prototypes...
- */
+//
+// Prototypes...
+//
 
 #  ifdef DEBUG
 extern int     _ppd_debug_fd;
 extern int     _ppd_debug_level;
 extern void    _ppd_debug_printf(const char *format, ...);
 extern void    _ppd_debug_puts(const char *s);
-#  endif /* DEBUG */
+#  endif // DEBUG
 
 #  ifdef __cplusplus
 }
-#  endif /* __cplusplus */
+#  endif // __cplusplus
 
-#endif /* !_PPD_DEBUG_INTERNAL_H_ */
+#endif // !_PPD_DEBUG_INTERNAL_H_
index 739612ab8da62f4b16b5116e9adc6a62d8d01054..4be572269fb2480dfe00c9050613361894038080 100644 (file)
@@ -1,57 +1,57 @@
-/*
- * Private debugging APIs for libppd.
- *
- * Copyright © 2007-2018 by Apple Inc.
- * Copyright © 1997-2005 by Easy Software Products.
- *
- * Licensed under Apache License v2.0.  See the file "LICENSE" for more
- * information.
- */
+//
+// Private debugging APIs for libppd.
+//
+// Copyright © 2007-2018 by Apple Inc.
+// Copyright © 1997-2005 by Easy Software Products.
+//
+// Licensed under Apache License v2.0.  See the file "LICENSE" for more
+// information.
+//
 
 #ifndef _PPD_DEBUG_PRIVATE_H_
 #  define _PPD_DEBUG_PRIVATE_H_
 
-/*
- * C++ magic...
- */
+//
+// C++ magic...
+//
 
 #  ifdef __cplusplus
 extern "C" {
-#  endif /* __cplusplus */
-
-
-/*
- * The debug macros are used if you compile with DEBUG defined.
- *
- * Usage:
- *
- *   DEBUG_set("logfile", "level", "filter", 1)
- *
- * The DEBUG_set macro allows an application to programmatically enable (or
- * disable) debug logging.  The arguments correspond to the PPD_DEBUG_LOG,
- * PPD_DEBUG_LEVEL, and PPD_DEBUG_FILTER environment variables.  The 1 on the
- * end forces the values to override the environment.
- */
+#  endif // __cplusplus
+
+
+//
+// The debug macros are used if you compile with DEBUG defined.
+//
+// Usage:
+//
+//   DEBUG_set("logfile", "level", "filter", 1)
+//
+// The DEBUG_set macro allows an application to programmatically enable (or
+// disable) debug logging.  The arguments correspond to the PPD_DEBUG_LOG,
+// PPD_DEBUG_LEVEL, and PPD_DEBUG_FILTER environment variables.  The 1 on the
+// end forces the values to override the environment.
+//
 
 #  ifdef DEBUG
 #    define DEBUG_set(logfile,level,filter) _ppd_debug_set(logfile,level,filter,1)
 #  else
 #    define DEBUG_set(logfile,level,filter)
-#  endif /* DEBUG */
+#  endif // DEBUG
 
 
-/*
- * Prototypes...
- */
+//
+// Prototypes...
+//
 
 extern void    _ppd_debug_set(const char *logfile, const char *level, const char *filter, int force);
 #  ifdef _WIN32
 extern int     _ppd_gettimeofday(struct timeval *tv, void *tz);
 #    define gettimeofday(a,b) _ppd_gettimeofday(a, b)
-#  endif /* _WIN32 */
+#  endif // _WIN32
 
 #  ifdef __cplusplus
 }
-#  endif /* __cplusplus */
+#  endif // __cplusplus
 
-#endif /* !_PPD_DEBUG_PRIVATE_H_ */
+#endif // !_PPD_DEBUG_PRIVATE_H_
index 9e150facfd0b07912414501bf55ca4aa0d22bc04..4120f59058711d5227007c9bb4d8d6715d64c92c 100644 (file)
@@ -1,15 +1,15 @@
-/*
- * Debugging functions for libppd.
- *
- * Copyright © 2008-2018 by Apple Inc.
- *
- * Licensed under Apache License v2.0.  See the file "LICENSE" for more
- * information.
- */
-
-/*
- * Include necessary headers...
- */
+//
+// Debugging functions for libppd.
+//
+// Copyright © 2008-2018 by Apple Inc.
+//
+// Licensed under Apache License v2.0.  See the file "LICENSE" for more
+// information.
+//
+
+//
+// Include necessary headers...
+//
 
 #include "string-private.h"
 #include "debug-internal.h"
 #  include <time.h>
 #  include <io.h>
 #  define getpid (int)GetCurrentProcessId
-int                                    /* O  - 0 on success, -1 on failure */
-_ppd_gettimeofday(struct timeval *tv,  /* I  - Timeval struct */
-                   void                  *tz)  /* I  - Timezone */
+int                                    // O  - 0 on success, -1 on failure
+_ppd_gettimeofday(struct timeval *tv,  // I  - Timeval struct
+                 void            *tz)  // I  - Timezone
 {
-  struct _timeb timebuffer;            /* Time buffer struct */
+  struct _timeb timebuffer;            // Time buffer struct
   _ftime(&timebuffer);
   tv->tv_sec  = (long)timebuffer.time;
   tv->tv_usec = timebuffer.millitm * 1000;
@@ -31,49 +31,49 @@ _ppd_gettimeofday(struct timeval *tv,       /* I  - Timeval struct */
 #else
 #  include <sys/time.h>
 #  include <unistd.h>
-#endif /* _WIN32 */
+#endif // _WIN32
 #include <regex.h>
 #include <fcntl.h>
 
 
 #ifdef DEBUG
-/*
- * Globals...
- */
+//
+// Globals...
+//
 
 int                    _ppd_debug_fd = -1;
-                                       /* Debug log file descriptor */
+                                       // Debug log file descriptor
 int                    _ppd_debug_level = 1;
-                                       /* Log level (0 to 9) */
+                                       // Log level (0 to 9)
 
 
-/*
- * Local globals...
- */
+//
+// Local globals...
+//
 
 static regex_t         *debug_filter = NULL;
-                                       /* Filter expression for messages */
-static int             debug_init = 0; /* Did we initialize debugging? */
+                                       // Filter expression for messages
+static int             debug_init = 0; // Did we initialize debugging?
 
 
-/*
- * '_ppd_debug_printf()' - Write a formatted line to the log.
- */
+//
+// '_ppd_debug_printf()' - Write a formatted line to the log.
+//
 
 void
-_ppd_debug_printf(const char *format,  /* I - Printf-style format string */
-                   ...)                        /* I - Additional arguments as needed */
+_ppd_debug_printf(const char *format,  // I - Printf-style format string
+                 ...)                  // I - Additional arguments as needed
 {
-  va_list              ap;             /* Pointer to arguments */
-  struct timeval       curtime;        /* Current time */
-  char                 buffer[2048];   /* Output buffer */
-  ssize_t              bytes;          /* Number of bytes in buffer */
-  int                  level;          /* Log level in message */
+  va_list              ap;             // Pointer to arguments
+  struct timeval       curtime;        // Current time
+  char                 buffer[2048];   // Output buffer
+  ssize_t              bytes;          // Number of bytes in buffer
+  int                  level;          // Log level in message
 
 
- /*
-  * See if we need to do any logging...
-  */
+  //
+  // See if we need to do any logging...
+  //
 
   if (!debug_init)
     _ppd_debug_set(getenv("PPD_DEBUG_LOG"), getenv("PPD_DEBUG_LEVEL"),
@@ -82,9 +82,9 @@ _ppd_debug_printf(const char *format, /* I - Printf-style format string */
   if (_ppd_debug_fd < 0)
     return;
 
- /*
-  * Filter as needed...
-  */
+  //
+  // Filter as needed...
+  //
 
   if (isdigit(format[0]))
     level = *format++ - '0';
@@ -96,7 +96,7 @@ _ppd_debug_printf(const char *format, /* I - Printf-style format string */
 
   if (debug_filter)
   {
-    int        result;                         /* Filter result */
+    int        result;                         // Filter result
 
     result = regexec(debug_filter, format, 0, NULL, 0);
 
@@ -104,9 +104,9 @@ _ppd_debug_printf(const char *format,       /* I - Printf-style format string */
       return;
   }
 
- /*
-  * Format the message...
-  */
+  //
+  // Format the message...
+  //
 
   gettimeofday(&curtime, NULL);
   snprintf(buffer, sizeof(buffer), "%02d:%02d:%02d.%03d  ",
@@ -115,7 +115,8 @@ _ppd_debug_printf(const char *format,       /* I - Printf-style format string */
           (int)(curtime.tv_sec % 60), (int)(curtime.tv_usec / 1000));
 
   va_start(ap, format);
-  bytes = _ppd_safe_vsnprintf(buffer + 19, sizeof(buffer) - 20, format, ap) + 19;
+  bytes = _ppd_safe_vsnprintf(buffer + 19, sizeof(buffer) - 20, format, ap) +
+    19;
   va_end(ap);
 
   if ((size_t)bytes >= (sizeof(buffer) - 1))
@@ -129,30 +130,30 @@ _ppd_debug_printf(const char *format,     /* I - Printf-style format string */
     buffer[bytes]   = '\0';
   }
 
- /*
-  * Write it out...
-  */
+  //
+  // Write it out...
+  //
 
   write(_ppd_debug_fd, buffer, (size_t)bytes);
 }
 
 
-/*
- * '_ppd_debug_puts()' - Write a single line to the log.
- */
+//
+// '_ppd_debug_puts()' - Write a single line to the log.
+//
 
 void
-_ppd_debug_puts(const char *s)         /* I - String to output */
+_ppd_debug_puts(const char *s)         // I - String to output
 {
-  struct timeval       curtime;        /* Current time */
-  char                 buffer[2048];   /* Output buffer */
-  ssize_t              bytes;          /* Number of bytes in buffer */
-  int                  level;          /* Log level in message */
+  struct timeval       curtime;        // Current time
+  char                 buffer[2048];   // Output buffer
+  ssize_t              bytes;          // Number of bytes in buffer
+  int                  level;          // Log level in message
 
 
- /*
-  * See if we need to do any logging...
-  */
+  //
+  // See if we need to do any logging...
+  //
 
   if (!debug_init)
     _ppd_debug_set(getenv("PPD_DEBUG_LOG"), getenv("PPD_DEBUG_LEVEL"),
@@ -161,9 +162,9 @@ _ppd_debug_puts(const char *s)              /* I - String to output */
   if (_ppd_debug_fd < 0)
     return;
 
- /*
-  * Filter as needed...
-  */
+  //
+  // Filter as needed...
+  //
 
   if (isdigit(s[0]))
     level = *s++ - '0';
@@ -175,7 +176,7 @@ _ppd_debug_puts(const char *s)              /* I - String to output */
 
   if (debug_filter)
   {
-    int        result;                         /* Filter result */
+    int        result;                         // Filter result
 
     result = regexec(debug_filter, s, 0, NULL, 0);
 
@@ -183,9 +184,9 @@ _ppd_debug_puts(const char *s)              /* I - String to output */
       return;
   }
 
- /*
-  * Format the message...
-  */
+  //
+  // Format the message...
+  //
 
   gettimeofday(&curtime, NULL);
   bytes = snprintf(buffer, sizeof(buffer), "%02d:%02d:%02d.%03d  %s",
@@ -205,30 +206,30 @@ _ppd_debug_puts(const char *s)            /* I - String to output */
     buffer[bytes]   = '\0';
   }
 
- /*
-  * Write it out...
-  */
+  //
+  // Write it out...
+  //
 
   write(_ppd_debug_fd, buffer, (size_t)bytes);
 }
 
 
-/*
- * '_ppd_debug_set()' - Enable or disable debug logging.
- */
+//
+// '_ppd_debug_set()' - Enable or disable debug logging.
+//
 
 void
-_ppd_debug_set(const char *logfile,    /* I - Log file or NULL */
-                const char *level,     /* I - Log level or NULL */
-               const char *filter,     /* I - Filter string or NULL */
-               int        force)       /* I - Force initialization */
+_ppd_debug_set(const char *logfile,    // I - Log file or NULL
+              const char *level,       // I - Log level or NULL
+              const char *filter,      // I - Filter string or NULL
+              int        force)        // I - Force initialization
 {
 
   if (!debug_init || force)
   {
-   /*
-    * Restore debug settings to defaults...
-    */
+    //
+    // Restore debug settings to defaults...
+    //
 
     if (_ppd_debug_fd != -1)
     {
@@ -244,9 +245,9 @@ _ppd_debug_set(const char *logfile, /* I - Log file or NULL */
 
     _ppd_debug_level = 1;
 
-   /*
-    * Open logs, set log levels, etc.
-    */
+    //
+    // Open logs, set log levels, etc.
+    //
 
     if (!logfile)
       _ppd_debug_fd = -1;
@@ -254,7 +255,7 @@ _ppd_debug_set(const char *logfile, /* I - Log file or NULL */
       _ppd_debug_fd = 2;
     else
     {
-      char     buffer[1024];           /* Filename buffer */
+      char     buffer[1024];           // Filename buffer
 
       snprintf(buffer, sizeof(buffer), logfile, getpid());
 
@@ -283,60 +284,59 @@ _ppd_debug_set(const char *logfile,       /* I - Log file or NULL */
 
     debug_init = 1;
   }
-
 }
 
 
 #else
-/*
- * '_ppd_debug_set()' - Enable or disable debug logging.
- */
+//
+// '_ppd_debug_set()' - Enable or disable debug logging.
+//
 
 void
-_ppd_debug_set(const char *logfile,    /* I - Log file or NULL */
-               const char *level,      /* I - Log level or NULL */
-               const char *filter,     /* I - Filter string or NULL */
-               int        force)       /* I - Force initialization */
+_ppd_debug_set(const char *logfile,    // I - Log file or NULL
+              const char *level,       // I - Log level or NULL
+              const char *filter,      // I - Filter string or NULL
+              int        force)        // I - Force initialization
 {
   (void)logfile;
   (void)level;
   (void)filter;
   (void)force;
 }
-#endif /* DEBUG */
+#endif // DEBUG
 
 
-/*
- * '_ppd_safe_vsnprintf()' - Format a string into a fixed size buffer,
- *                            quoting special characters.
- */
+//
+// '_ppd_safe_vsnprintf()' - Format a string into a fixed size buffer,
+//                           quoting special characters.
+//
 
-ssize_t                                        /* O - Number of bytes formatted */
+ssize_t                                        // O - Number of bytes formatted
 _ppd_safe_vsnprintf(
-    char       *buffer,                        /* O - Output buffer */
-    size_t     bufsize,                        /* O - Size of output buffer */
-    const char *format,                        /* I - printf-style format string */
-    va_list    ap)                     /* I - Pointer to additional arguments */
+    char       *buffer,                        // O - Output buffer
+    size_t     bufsize,                        // O - Size of output buffer
+    const char *format,                        // I - printf-style format string
+    va_list    ap)                     // I - Pointer to additional arguments
 {
-  char         *bufptr,                /* Pointer to position in buffer */
-               *bufend,                /* Pointer to end of buffer */
-               size,                   /* Size character (h, l, L) */
-               type;                   /* Format type character */
-  int          width,                  /* Width of field */
-               prec;                   /* Number of characters of precision */
-  char         tformat[100],           /* Temporary format string for snprintf() */
-               *tptr,                  /* Pointer into temporary format */
-               temp[1024];             /* Buffer for formatted numbers */
-  char         *s;                     /* Pointer to string */
-  ssize_t      bytes;                  /* Total number of bytes needed */
+  char         *bufptr,                // Pointer to position in buffer
+               *bufend,                // Pointer to end of buffer
+               size,                   // Size character (h, l, L)
+               type;                   // Format type character
+  int          width,                  // Width of field
+               prec;                   // Number of characters of precision
+  char         tformat[100],           // Temporary format string for snprintf()
+               *tptr,                  // Pointer into temporary format
+               temp[1024];             // Buffer for formatted numbers
+  char         *s;                     // Pointer to string
+  ssize_t      bytes;                  // Total number of bytes needed
 
 
   if (!buffer || bufsize < 2 || !format)
     return (-1);
 
- /*
-  * Loop through the format string, formatting as needed...
-  */
+  //
+  // Loop through the format string, formatting as needed...
+  //
 
   bufptr = buffer;
   bufend = buffer + bufsize - 1;
@@ -362,9 +362,9 @@ _ppd_safe_vsnprintf(
 
       if (*format == '*')
       {
-       /*
-        * Get width from argument...
-       */
+       //
+        // Get width from argument...
+       //
 
        format ++;
        width = va_arg(ap, int);
@@ -394,9 +394,9 @@ _ppd_safe_vsnprintf(
 
         if (*format == '*')
        {
-         /*
-         * Get precision from argument...
-         */
+         //
+         // Get precision from argument...
+         // 
 
          format ++;
          prec = va_arg(ap, int);
@@ -451,7 +451,7 @@ _ppd_safe_vsnprintf(
 
       switch (type)
       {
-       case 'E' : /* Floating point formats */
+       case 'E' : // Floating point formats
        case 'G' :
        case 'e' :
        case 'f' :
@@ -470,7 +470,7 @@ _ppd_safe_vsnprintf(
            }
            break;
 
-        case 'B' : /* Integer formats */
+        case 'B' : // Integer formats
        case 'X' :
        case 'b' :
         case 'd' :
@@ -485,7 +485,7 @@ _ppd_safe_vsnprintf(
             if (size == 'L')
              snprintf(temp, sizeof(temp), tformat, va_arg(ap, long long));
            else
-#  endif /* HAVE_LONG_LONG */
+#  endif // HAVE_LONG_LONG
             if (size == 'l')
              snprintf(temp, sizeof(temp), tformat, va_arg(ap, long));
            else
@@ -500,7 +500,7 @@ _ppd_safe_vsnprintf(
            }
            break;
 
-       case 'p' : /* Pointer value */
+       case 'p' : // Pointer value
            if ((size_t)(width + 2) > sizeof(temp))
              break;
 
@@ -515,7 +515,7 @@ _ppd_safe_vsnprintf(
            }
            break;
 
-        case 'c' : /* Character or character array */
+        case 'c' : // Character or character array
            bytes += width;
 
            if (bufptr)
@@ -533,14 +533,14 @@ _ppd_safe_vsnprintf(
            }
            break;
 
-       case 's' : /* String */
+       case 's' : // String
            if ((s = va_arg(ap, char *)) == NULL)
              s = "(null)";
 
-           /*
-           * Copy the C string, replacing control chars and \ with
-           * C character escapes...
-           */
+           //
+           // Copy the C string, replacing control chars and \ with
+           // C character escapes...
+           //
 
             for (bufend --; *s && bufptr < bufend; s ++)
            {
@@ -601,7 +601,7 @@ _ppd_safe_vsnprintf(
             bufend ++;
            break;
 
-       case 'n' : /* Output number of chars so far */
+       case 'n' : // Output number of chars so far
            *(va_arg(ap, int *)) = (int)bytes;
            break;
       }
@@ -617,9 +617,9 @@ _ppd_safe_vsnprintf(
     }
   }
 
- /*
-  * Nul-terminate the string and return the number of characters needed.
-  */
+  //
+  // Nul-terminate the string and return the number of characters needed.
+  //
 
   *bufptr = '\0';
 
index 1fe013db46ddc5d3866a85c27a350f02982ec3be..8433771abd609a32084b81fb81a876ec20b32448 100644 (file)
@@ -1,27 +1,27 @@
-/*
- * Option encoding routines for libppd.
- *
- * Copyright © 2007-2019 by Apple Inc.
- * Copyright © 1997-2007 by Easy Software Products.
- *
- * Licensed under Apache License v2.0.  See the file "LICENSE" for more
- * information.
- */
+//
+// Option encoding routines for libppd.
+//
+// Copyright © 2007-2019 by Apple Inc.
+// Copyright © 1997-2007 by Easy Software Products.
+//
+// Licensed under Apache License v2.0.  See the file "LICENSE" for more
+// information.
+//
 
-/*
- * Include necessary headers...
- */
+//
+// Include necessary headers...
+//
 
 #include "ipp-private.h"
 #include "debug-internal.h"
 
 
-/*
- * Local list of option names, the value tags they should use, and the list of
- * supported operations...
- *
- * **** THIS LIST MUST BE SORTED BY ATTRIBUTE NAME ****
- */
+//
+// Local list of option names, the value tags they should use, and the list of
+// supported operations...
+//
+// **** THIS LIST MUST BE SORTED BY ATTRIBUTE NAME ****
+//
 
 static const ipp_op_t ipp_job_creation[] =
 {
@@ -93,9 +93,12 @@ static const _ppd_ipp_option_t ipp_options[] =
   { 0, "copies",               IPP_TAG_INTEGER,        IPP_TAG_JOB,
                                                        IPP_TAG_DOCUMENT },
   { 0, "copies-default",       IPP_TAG_INTEGER,        IPP_TAG_PRINTER },
-  { 0, "date-time-at-completed",IPP_TAG_DATE,          IPP_TAG_ZERO }, /* never send as option */
-  { 0, "date-time-at-creation",        IPP_TAG_DATE,           IPP_TAG_ZERO }, /* never send as option */
-  { 0, "date-time-at-processing",IPP_TAG_DATE,         IPP_TAG_ZERO }, /* never send as option */
+  { 0, "date-time-at-completed",IPP_TAG_DATE,          IPP_TAG_ZERO },
+                                                         // never send as option
+  { 0, "date-time-at-creation",        IPP_TAG_DATE,           IPP_TAG_ZERO },
+                                                         // never send as option
+  { 0, "date-time-at-processing",IPP_TAG_DATE,         IPP_TAG_ZERO },
+                                                         // never send as option
   { 0, "device-uri",           IPP_TAG_URI,            IPP_TAG_PRINTER },
   { 1, "document-copies",      IPP_TAG_RANGE,          IPP_TAG_JOB,
                                                        IPP_TAG_DOCUMENT,
@@ -138,19 +141,24 @@ static const _ppd_ipp_option_t ipp_options[] =
   { 0, "job-cancel-after-default", IPP_TAG_INTEGER,    IPP_TAG_PRINTER },
   { 0, "job-hold-until",       IPP_TAG_KEYWORD,        IPP_TAG_JOB },
   { 0, "job-hold-until-default", IPP_TAG_KEYWORD,      IPP_TAG_PRINTER },
-  { 0, "job-id",               IPP_TAG_INTEGER,        IPP_TAG_ZERO }, /* never send as option */
+  { 0, "job-id",               IPP_TAG_INTEGER,        IPP_TAG_ZERO },
+                                                         // never send as option
   { 0, "job-impressions",      IPP_TAG_INTEGER,        IPP_TAG_OPERATION },
-  { 0, "job-impressions-completed", IPP_TAG_INTEGER,   IPP_TAG_ZERO }, /* never send as option */
+  { 0, "job-impressions-completed", IPP_TAG_INTEGER,   IPP_TAG_ZERO },
+                                                         // never send as option
   { 0, "job-k-limit",          IPP_TAG_INTEGER,        IPP_TAG_PRINTER },
   { 0, "job-k-octets",         IPP_TAG_INTEGER,        IPP_TAG_OPERATION },
-  { 0, "job-k-octets-completed",IPP_TAG_INTEGER,       IPP_TAG_ZERO }, /* never send as option */
+  { 0, "job-k-octets-completed",IPP_TAG_INTEGER,       IPP_TAG_ZERO },
+                                                         // never send as option
   { 0, "job-media-sheets",     IPP_TAG_INTEGER,        IPP_TAG_OPERATION },
-  { 0, "job-media-sheets-completed", IPP_TAG_INTEGER,  IPP_TAG_ZERO }, /* never send as option */
+  { 0, "job-media-sheets-completed", IPP_TAG_INTEGER,  IPP_TAG_ZERO },
+                                                         // never send as option
   { 0, "job-name",             IPP_TAG_NAME,           IPP_TAG_OPERATION,
                                                        IPP_TAG_JOB },
   { 0, "job-page-limit",       IPP_TAG_INTEGER,        IPP_TAG_PRINTER },
   { 0, "job-pages",            IPP_TAG_INTEGER,        IPP_TAG_OPERATION },
-  { 0, "job-pages-completed",  IPP_TAG_INTEGER,        IPP_TAG_ZERO }, /* never send as option */
+  { 0, "job-pages-completed",  IPP_TAG_INTEGER,        IPP_TAG_ZERO },
+                                                         // never send as option
   { 0, "job-password",          IPP_TAG_STRING,         IPP_TAG_OPERATION,
                                                        IPP_TAG_ZERO,
                                                        ipp_job_creation },
@@ -162,9 +170,12 @@ static const _ppd_ipp_option_t ipp_options[] =
   { 0, "job-quota-period",     IPP_TAG_INTEGER,        IPP_TAG_PRINTER },
   { 1, "job-sheets",           IPP_TAG_NAME,           IPP_TAG_JOB },
   { 1, "job-sheets-default",   IPP_TAG_NAME,           IPP_TAG_PRINTER },
-  { 0, "job-state",            IPP_TAG_ENUM,           IPP_TAG_ZERO }, /* never send as option */
-  { 0, "job-state-message",    IPP_TAG_TEXT,           IPP_TAG_ZERO }, /* never send as option */
-  { 0, "job-state-reasons",    IPP_TAG_KEYWORD,        IPP_TAG_ZERO }, /* never send as option */
+  { 0, "job-state",            IPP_TAG_ENUM,           IPP_TAG_ZERO },
+                                                         // never send as option
+  { 0, "job-state-message",    IPP_TAG_TEXT,           IPP_TAG_ZERO },
+                                                         // never send as option
+  { 0, "job-state-reasons",    IPP_TAG_KEYWORD,        IPP_TAG_ZERO },
+                                                         // never send as option
   { 0, "job-uuid",             IPP_TAG_URI,            IPP_TAG_JOB },
   { 0, "landscape",            IPP_TAG_BOOLEAN,        IPP_TAG_JOB },
   { 1, "marker-change-time",   IPP_TAG_INTEGER,        IPP_TAG_PRINTER },
@@ -340,9 +351,12 @@ static const _ppd_ipp_option_t ipp_options[] =
   { 0, "sides",                        IPP_TAG_KEYWORD,        IPP_TAG_JOB,
                                                        IPP_TAG_DOCUMENT },
   { 0, "sides-default",                IPP_TAG_KEYWORD,        IPP_TAG_PRINTER },
-  { 0, "time-at-completed",    IPP_TAG_INTEGER,        IPP_TAG_ZERO }, /* never send as option */
-  { 0, "time-at-creation",     IPP_TAG_INTEGER,        IPP_TAG_ZERO }, /* never send as option */
-  { 0, "time-at-processing",   IPP_TAG_INTEGER,        IPP_TAG_ZERO }, /* never send as option */
+  { 0, "time-at-completed",    IPP_TAG_INTEGER,        IPP_TAG_ZERO },
+                                                         // never send as option
+  { 0, "time-at-creation",     IPP_TAG_INTEGER,        IPP_TAG_ZERO },
+                                                         // never send as option
+  { 0, "time-at-processing",   IPP_TAG_INTEGER,        IPP_TAG_ZERO },
+                                                         // never send as option
   { 0, "wrap",                 IPP_TAG_BOOLEAN,        IPP_TAG_JOB },
   { 0, "wrap-default",         IPP_TAG_BOOLEAN,        IPP_TAG_PRINTER },
   { 0, "x-dimension",          IPP_TAG_INTEGER,        IPP_TAG_JOB,
@@ -352,45 +366,46 @@ static const _ppd_ipp_option_t ipp_options[] =
 };
 
 
-/*
- * Local functions...
- */
+//
+// Local functions...
+//
 
 static int     ppd_compare_ipp_options(_ppd_ipp_option_t *a,
                                        _ppd_ipp_option_t *b);
 
 
-/*
- * '_ppdIppFindOption()' - Find the attribute information for an option.
- */
+//
+// '_ppdIppFindOption()' - Find the attribute information for an option.
+//
 
-_ppd_ipp_option_t *                            /* O - Attribute information */
-_ppdIppFindOption(const char *name)    /* I - Option/attribute name */
+_ppd_ipp_option_t *                            // O - Attribute information
+_ppdIppFindOption(const char *name)            // I - Option/attribute name
 {
-  _ppd_ipp_option_t    key;                    /* Search key */
+  _ppd_ipp_option_t    key;                    // Search key
 
 
- /*
-  * Lookup the proper value and group tags for this option...
-  */
+  //
+  // Lookup the proper value and group tags for this option...
+  //
 
   key.name = name;
 
   return ((_ppd_ipp_option_t *)bsearch(&key, ipp_options,
-                                   sizeof(ipp_options) / sizeof(ipp_options[0]),
-                                  sizeof(ipp_options[0]),
-                                  (int (*)(const void *, const void *))
+                                      sizeof(ipp_options) /
+                                      sizeof(ipp_options[0]),
+                                      sizeof(ipp_options[0]),
+                                      (int (*)(const void *, const void *))
                                       ppd_compare_ipp_options));
 }
 
 
-/*
- * 'ppd_compare_ipp_options()' - Compare two IPP options.
- */
+//
+// 'ppd_compare_ipp_options()' - Compare two IPP options.
+//
 
-static int                                     /* O - Result of comparison */
-ppd_compare_ipp_options(_ppd_ipp_option_t *a,  /* I - First option */
-                       _ppd_ipp_option_t *b)   /* I - Second option */
+static int                                     // O - Result of comparison
+ppd_compare_ipp_options(_ppd_ipp_option_t *a,  // I - First option
+                       _ppd_ipp_option_t *b)   // I - Second option
 {
   return (strcmp(a->name, b->name));
 }
index 8a3641e63cf743ac5f6c7d4d7e3d336846a553e3..ebbe5013424e88656660a06adb8ce0e2e953d387 100644 (file)
@@ -1,16 +1,17 @@
-/*
- * This file contains model number definitions for the CUPS sample
- * ESC/P driver.
- *
- * Copyright 2007 by Apple Inc.
- * Copyright 1997-2005 by Easy Software Products.
- *
- * Licensed under Apache License v2.0.  See the file "LICENSE" for more information.
- */
+//
+// This file contains model number definitions for the cups-filters sample
+// ESC/P driver.
+//
+// Copyright 2007 by Apple Inc.
+// Copyright 1997-2005 by Easy Software Products.
+//
+// Licensed under Apache License v2.0.  See the file "LICENSE" for more
+// information.
+//
 
-#define EPSON_9PIN     0               /* 9-pin dot matrix */
-#define EPSON_24PIN    1               /* 24-pin dot matrix */
-#define EPSON_COLOR    2               /* Epson Stylus Color with ESC . */
-#define EPSON_PHOTO    3               /* Epson Stylus Photo with ESC . */
-#define EPSON_ICOLOR   4               /* Epson Stylus Color with ESC i */
-#define EPSON_IPHOTO   5               /* Epson Stylus Photo with ESC i */
+#define EPSON_9PIN     0               // 9-pin dot matrix
+#define EPSON_24PIN    1               // 24-pin dot matrix
+#define EPSON_COLOR    2               // Epson Stylus Color with ESC .
+#define EPSON_PHOTO    3               // Epson Stylus Photo with ESC .
+#define EPSON_ICOLOR   4               // Epson Stylus Color with ESC i
+#define EPSON_IPHOTO   5               // Epson Stylus Photo with ESC i
index 4c672d923c40b57dfb6f79f08af826774ccbcfb1..613d46c17b6c293a718754bde0cc0fbf3eb6ce7e 100644 (file)
@@ -1,19 +1,19 @@
-/*
- * Private file check definitions for libppd.
- *
- * Copyright © 2007-2018 by Apple Inc.
- * Copyright © 1997-2007 by Easy Software Products, all rights reserved.
- *
- * Licensed under Apache License v2.0.  See the file "LICENSE" for more
- * information.
- */
+//
+// Private file check definitions for libppd.
+//
+// Copyright © 2007-2018 by Apple Inc.
+// Copyright © 1997-2007 by Easy Software Products, all rights reserved.
+//
+// Licensed under Apache License v2.0.  See the file "LICENSE" for more
+// information.
+//
 
 #ifndef _PPD_FILE_PRIVATE_H_
 #  define _PPD_FILE_PRIVATE_H_
 
-/*
- * Include necessary headers...
- */
+//
+// Include necessary headers...
+//
 
 #  include "string-private.h"
 #  include <cupsfilters/log.h>
 #  ifdef _WIN32
 #    include <io.h>
 #    include <sys/locking.h>
-#  endif /* _WIN32 */
+#  endif // _WIN32
 
 
 #  ifdef __cplusplus
 extern "C" {
-#  endif /* __cplusplus */
+#  endif // __cplusplus
 
 
-/*
- * Types and structures...
- */
+//
+// Types and structures...
+//
 
-typedef enum                           /**** _ppdFileCheck return values ****/
+typedef enum                           // **** _ppdFileCheck return values ****
 {
-  _PPD_FILE_CHECK_OK = 0,              /* Everything OK */
-  _PPD_FILE_CHECK_MISSING = 1,         /* File is missing */
-  _PPD_FILE_CHECK_PERMISSIONS = 2,     /* File (or parent dir) has bad perms */
-  _PPD_FILE_CHECK_WRONG_TYPE = 3,      /* File has wrong type */
-  _PPD_FILE_CHECK_RELATIVE_PATH = 4    /* File contains a relative path */
+  _PPD_FILE_CHECK_OK = 0,              // Everything OK
+  _PPD_FILE_CHECK_MISSING = 1,         // File is missing
+  _PPD_FILE_CHECK_PERMISSIONS = 2,     // File (or parent dir) has bad perms
+  _PPD_FILE_CHECK_WRONG_TYPE = 3,      // File has wrong type
+  _PPD_FILE_CHECK_RELATIVE_PATH = 4    // File contains a relative path
 } _ppd_fc_result_t;
 
-typedef enum                           /**** _ppdFileCheck file type
-                                             values ****/
+typedef enum                           /**** _ppdFileCheck file type
+                                        //      values ****
 {
-  _PPD_FILE_CHECK_FILE = 0,            /* Check the file and parent
-                                          directory */
-  _PPD_FILE_CHECK_PROGRAM = 1,         /* Check the program and parent
-                                          directory */
-  _PPD_FILE_CHECK_FILE_ONLY = 2,       /* Check the file only */
-  _PPD_FILE_CHECK_DIRECTORY = 3                /* Check the directory */
+  _PPD_FILE_CHECK_FILE = 0,            // Check the file and parent
+                                       // directory
+  _PPD_FILE_CHECK_PROGRAM = 1,         // Check the program and parent
+                                       // directory
+  _PPD_FILE_CHECK_FILE_ONLY = 2,       // Check the file only
+  _PPD_FILE_CHECK_DIRECTORY = 3                // Check the directory
 } _ppd_fc_filetype_t;
 
 typedef void (*_ppd_fc_func_t)(void *context, _ppd_fc_result_t result,
-                               const char *message);
+                              const char *message);
 
-/*
- * Prototypes...
- */
+//
+// Prototypes...
+//
 
 extern _ppd_fc_result_t        _ppdFileCheck(const char *filename,
                                      _ppd_fc_filetype_t filetype,
@@ -72,6 +72,6 @@ extern _ppd_fc_result_t       _ppdFileCheck(const char *filename,
 
 #  ifdef __cplusplus
 }
-#  endif /* __cplusplus */
+#  endif // __cplusplus
 
-#endif /* !_PPD_FILE_PRIVATE_H_ */
+#endif // !_PPD_FILE_PRIVATE_H_
index b050e3590430d8a5d6833828b35b40cb37d36150..ee591b1a2ec1d177682c12bdb5067b78d5fa66c3 100644 (file)
@@ -1,16 +1,16 @@
-/*
- * File functions for libppd
- *
- * Copyright © 2007-2019 by Apple Inc.
- * Copyright © 1997-2007 by Easy Software Products, all rights reserved.
- *
- * Licensed under Apache License v2.0.  See the file "LICENSE" for more
- * information.
- */
-
-/*
- * Include necessary headers...
- */
+//
+// File functions for libppd
+//
+// Copyright © 2007-2019 by Apple Inc.
+// Copyright © 1997-2007 by Easy Software Products, all rights reserved.
+//
+// Licensed under Apache License v2.0.  See the file "LICENSE" for more
+// information.
+
+
+//
+// Include necessary headers...
+//
 
 #include "file-private.h"
 #include "language-private.h"
 
 #  ifdef HAVE_LIBZ
 #    include <zlib.h>
-#  endif /* HAVE_LIBZ */
+#  endif // HAVE_LIBZ
 
 
 #ifndef _WIN32
-/*
- * '_ppdFileCheck()' - Check the permissions of the given filename.
- */
+//
+// '_ppdFileCheck()' - Check the permissions of the given filename.
+//
 
-_ppd_fc_result_t                       /* O - Check result */
+_ppd_fc_result_t                       // O - Check result
 _ppdFileCheck(
-    const char          *filename,     /* I - Filename to check */
-    _ppd_fc_filetype_t  filetype,      /* I - Type of file checks? */
-    int                 dorootchecks,  /* I - Check for root permissions? */
-    cf_logfunc_t    log,               /* I - Log function */
-    void                *ld)           /* I - Data pointer for log function */
+    const char          *filename,     // I - Filename to check
+    _ppd_fc_filetype_t  filetype,      // I - Type of file checks?
+    int                 dorootchecks,  // I - Check for root permissions?
+    cf_logfunc_t    log,               // I - Log function
+    void                *ld)           // I - Data pointer for log function
 {
-  struct stat          fileinfo;       /* File information */
-  char                 message[1024],  /* Message string */
-                       temp[1024],     /* Parent directory filename */
-                       *ptr;           /* Pointer into parent directory */
-  _ppd_fc_result_t     result;         /* Check result */
+  struct stat          fileinfo;       // File information
+  char                 message[1024],  // Message string
+                       temp[1024],     // Parent directory filename
+                       *ptr;           // Pointer into parent directory
+  _ppd_fc_result_t     result;         // Check result
 
 
- /*
-  * Does the filename contain a relative path ("../")?
-  */
+  //
+  // Does the filename contain a relative path ("../")?
+  //
 
   if (strstr(filename, "../"))
   {
-   /*
-    * Yes, fail it!
-    */
+    //
+    // Yes, fail it!
+    //
 
     result = _PPD_FILE_CHECK_RELATIVE_PATH;
     goto finishup;
   }
 
- /*
-  * Does the program even exist and is it accessible?
-  */
+  //
+  // Does the program even exist and is it accessible?
+  //
 
   if (stat(filename, &fileinfo))
   {
-   /*
-    * Nope...
-    */
+    //
+    // Nope...
+    //
 
     result = _PPD_FILE_CHECK_MISSING;
     goto finishup;
   }
 
- /*
-  * Check the execute bit...
-  */
+  //
+  // Check the execute bit...
+  //
 
   result = _PPD_FILE_CHECK_OK;
 
@@ -94,32 +94,32 @@ _ppdFileCheck(
   if (result)
     goto finishup;
 
- /*
-  * Are we doing root checks?
-  */
+  //
+  // Are we doing root checks?
+  //
 
   if (!dorootchecks)
   {
-   /*
-    * Nope, so anything (else) goes...
-    */
+    //
+    // Nope, so anything (else) goes...
+    //
 
     goto finishup;
   }
 
- /*
-  * Verify permission of the file itself:
-  *
-  * 1. Must be owned by root
-  * 2. Must not be writable by group
-  * 3. Must not be setuid
-  * 4. Must not be writable by others
-  */
-
-  if (fileinfo.st_uid ||               /* 1. Must be owned by root */
-      (fileinfo.st_mode & S_IWGRP)  || /* 2. Must not be writable by group */
-      (fileinfo.st_mode & S_ISUID) ||  /* 3. Must not be setuid */
-      (fileinfo.st_mode & S_IWOTH))    /* 4. Must not be writable by others */
+  //
+  // Verify permission of the file itself:
+  //
+  // 1. Must be owned by root
+  // 2. Must not be writable by group
+  // 3. Must not be setuid
+  // 4. Must not be writable by others
+  //
+
+  if (fileinfo.st_uid ||               // 1. Must be owned by root
+      (fileinfo.st_mode & S_IWGRP) ||  // 2. Must not be writable by group
+      (fileinfo.st_mode & S_ISUID) ||  // 3. Must not be setuid
+      (fileinfo.st_mode & S_IWOTH))    // 4. Must not be writable by others
   {
     result = _PPD_FILE_CHECK_PERMISSIONS;
     goto finishup;
@@ -129,9 +129,9 @@ _ppdFileCheck(
       filetype == _PPD_FILE_CHECK_FILE_ONLY)
     goto finishup;
 
- /*
-  * Now check the containing directory...
-  */
+  //
+  // Now check the containing directory...
+  //
 
   strlcpy(temp, filename, sizeof(temp));
   if ((ptr = strrchr(temp, '/')) != NULL)
@@ -144,9 +144,9 @@ _ppdFileCheck(
 
   if (stat(temp, &fileinfo))
   {
-   /*
-    * Doesn't exist?!?
-    */
+    //
+    // Doesn't exist?!?
+    //
 
     result   = _PPD_FILE_CHECK_MISSING;
     filetype = _PPD_FILE_CHECK_DIRECTORY;
@@ -155,26 +155,26 @@ _ppdFileCheck(
     goto finishup;
   }
 
-  if (fileinfo.st_uid ||               /* 1. Must be owned by root */
-      (fileinfo.st_mode & S_IWGRP) ||  /* 2. Must not be writable by group */
-      (fileinfo.st_mode & S_ISUID) ||  /* 3. Must not be setuid */
-      (fileinfo.st_mode & S_IWOTH))    /* 4. Must not be writable by others */
+  if (fileinfo.st_uid ||               // 1. Must be owned by root
+      (fileinfo.st_mode & S_IWGRP) ||  // 2. Must not be writable by group
+      (fileinfo.st_mode & S_ISUID) ||  // 3. Must not be setuid
+      (fileinfo.st_mode & S_IWOTH))    // 4. Must not be writable by others
   {
     result   = _PPD_FILE_CHECK_PERMISSIONS;
     filetype = _PPD_FILE_CHECK_DIRECTORY;
     filename = temp;
   }
 
- /*
-  * Common return point...
-  */
+  //
+  // Common return point...
+  //
 
   finishup:
 
   if (log)
   {
     cups_lang_t *lang = cupsLangDefault();
-                                       /* Localization information */
+                                       // Localization information
     cf_loglevel_t loglevel;
 
     switch (result)
@@ -184,13 +184,13 @@ _ppdFileCheck(
          if (filetype == _PPD_FILE_CHECK_DIRECTORY)
            snprintf(message, sizeof(message),
                     _ppdLangString(lang, _("Directory \"%s\" permissions OK "
-                                            "(0%o/uid=%d/gid=%d).")),
+                                           "(0%o/uid=%d/gid=%d).")),
                     filename, fileinfo.st_mode, (int)fileinfo.st_uid,
                     (int)fileinfo.st_gid);
          else
            snprintf(message, sizeof(message),
                     _ppdLangString(lang, _("File \"%s\" permissions OK "
-                                            "(0%o/uid=%d/gid=%d).")),
+                                           "(0%o/uid=%d/gid=%d).")),
                     filename, fileinfo.st_mode, (int)fileinfo.st_uid,
                     (int)fileinfo.st_gid);
           break;
@@ -200,7 +200,7 @@ _ppdFileCheck(
          if (filetype == _PPD_FILE_CHECK_DIRECTORY)
            snprintf(message, sizeof(message),
                     _ppdLangString(lang, _("Directory \"%s\" not available: "
-                                            "%s")),
+                                           "%s")),
                     filename, strerror(errno));
          else
            snprintf(message, sizeof(message),
@@ -213,15 +213,15 @@ _ppdFileCheck(
          if (filetype == _PPD_FILE_CHECK_DIRECTORY)
            snprintf(message, sizeof(message),
                     _ppdLangString(lang, _("Directory \"%s\" has insecure "
-                                            "permissions "
-                                            "(0%o/uid=%d/gid=%d).")),
+                                           "permissions "
+                                           "(0%o/uid=%d/gid=%d).")),
                     filename, fileinfo.st_mode, (int)fileinfo.st_uid,
                     (int)fileinfo.st_gid);
          else
            snprintf(message, sizeof(message),
                     _ppdLangString(lang, _("File \"%s\" has insecure "
-                                            "permissions "
-                                            "(0%o/uid=%d/gid=%d).")),
+                                           "permissions "
+                                           "(0%o/uid=%d/gid=%d).")),
                     filename, fileinfo.st_mode, (int)fileinfo.st_uid,
                     (int)fileinfo.st_gid);
           break;
@@ -243,11 +243,11 @@ _ppdFileCheck(
          if (filetype == _PPD_FILE_CHECK_DIRECTORY)
            snprintf(message, sizeof(message),
                     _ppdLangString(lang, _("Directory \"%s\" contains a "
-                                            "relative path.")), filename);
+                                           "relative path.")), filename);
          else
            snprintf(message, sizeof(message),
                     _ppdLangString(lang, _("File \"%s\" contains a relative "
-                                            "path.")), filename);
+                                           "path.")), filename);
           break;
     }
 
@@ -256,4 +256,4 @@ _ppdFileCheck(
 
   return (result);
 }
-#endif /* !_WIN32 */
+#endif // !_WIN32
index ef8be72cee38b963a49b0753c3cdad2cc3f84f8b..a43208e79900973520a013e994d4d8416bf48a07 100644 (file)
@@ -1,5 +1,5 @@
 //
-// GNU gettext message generator for the CUPS PPD Compiler.
+// GNU gettext message generator for the libppd PPD Compiler.
 //
 // This program is used to generate a dummy source file containing all of
 // the standard media and sample driver strings.  The results are picked up
@@ -172,7 +172,7 @@ add_ui_strings(ppdcDriver  *d,              // I - Driver data
 //
 
 static void
-write_cstring(const char *s)           /* I - String to write */
+write_cstring(const char *s)           // I - String to write
 {
   fputs("_(\"", stdout);
   if (s)
index f544fad056a42b70c90d0639be572c85653d9253..cddf3e305c593d69aaeb456fd67ed6b3fd18fb51 100644 (file)
--- a/ppd/hp.h
+++ b/ppd/hp.h
@@ -1,13 +1,14 @@
-/*
- * This file contains model number definitions for the CUPS sample
- * HP driver.
- *
- * Copyright 2007 by Apple Inc.
- * Copyright 1997-2005 by Easy Software Products.
- *
- * Licensed under Apache License v2.0.  See the file "LICENSE" for more information.
- */
+//
+// This file contains model number definitions for the CUPS sample
+// HP driver.
+//
+// Copyright 2007 by Apple Inc.
+// Copyright 1997-2005 by Easy Software Products.
+//
+// Licensed under Apache License v2.0.  See the file "LICENSE" for more
+// information.
+//
 
-#define HP_LASERJET    0               /* HP LaserJet */
-#define HP_DESKJET     1               /* HP DeskJet with simple color */
-#define HP_DESKJET2    2               /* HP DeskJet with CRet color */
+#define HP_LASERJET    0               // HP LaserJet
+#define HP_DESKJET     1               // HP DeskJet with simple color
+#define HP_DESKJET2    2               // HP DeskJet with CRet color
index 1a9aa296322c406f6c592bd7ed2966114d6f6149..a86bf8a6e93148e98db782fea1540d8bbc09762b 100644 (file)
@@ -1,18 +1,18 @@
-/*
- * PostScript filter function and image file to PostScript filter function
- * for libppd.
- *
- * Copyright © 2020 by Till Kamppeter
- * Copyright © 2007-2018 by Apple Inc.
- * Copyright © 1993-2007 by Easy Software Products.
- *
- * Licensed under Apache License v2.0.  See the file "LICENSE" for more
- * information.
- */
-
-/*
- * Include necessary headers...
- */
+//
+// PostScript filter function and image file to PostScript filter function
+// for libppd.
+//
+// Copyright © 2020 by Till Kamppeter
+// Copyright © 2007-2018 by Apple Inc.
+// Copyright © 1993-2007 by Easy Software Products.
+//
+// Licensed under Apache License v2.0.  See the file "LICENSE" for more
+// information.
+//
+
+//
+// Include necessary headers...
+//
 
 #include <cupsfilters/filter.h>
 #include <cupsfilters/image.h>
 #include <sys/wait.h>
 
 
-/*
- * Constants...
- */
-
-#define PSTOPS_BORDERNONE      0       /* No border or hairline border */
-#define PSTOPS_BORDERTHICK     1       /* Think border */
-#define PSTOPS_BORDERSINGLE    2       /* Single-line hairline border */
-#define PSTOPS_BORDERSINGLE2   3       /* Single-line thick border */
-#define PSTOPS_BORDERDOUBLE    4       /* Double-line hairline border */
-#define PSTOPS_BORDERDOUBLE2   5       /* Double-line thick border */
-
-#define PSTOPS_LAYOUT_LRBT     0       /* Left to right, bottom to top */
-#define PSTOPS_LAYOUT_LRTB     1       /* Left to right, top to bottom */
-#define PSTOPS_LAYOUT_RLBT     2       /* Right to left, bottom to top */
-#define PSTOPS_LAYOUT_RLTB     3       /* Right to left, top to bottom */
-#define PSTOPS_LAYOUT_BTLR     4       /* Bottom to top, left to right */
-#define PSTOPS_LAYOUT_TBLR     5       /* Top to bottom, left to right */
-#define PSTOPS_LAYOUT_BTRL     6       /* Bottom to top, right to left */
-#define PSTOPS_LAYOUT_TBRL     7       /* Top to bottom, right to left */
-
-#define PSTOPS_LAYOUT_NEGATEY  1       /* The bits for the layout */
-#define PSTOPS_LAYOUT_NEGATEX  2       /* definitions above... */
+//
+// Constants...
+//
+
+#define PSTOPS_BORDERNONE      0       // No border or hairline border
+#define PSTOPS_BORDERTHICK     1       // Think border
+#define PSTOPS_BORDERSINGLE    2       // Single-line hairline border
+#define PSTOPS_BORDERSINGLE2   3       // Single-line thick border
+#define PSTOPS_BORDERDOUBLE    4       // Double-line hairline border
+#define PSTOPS_BORDERDOUBLE2   5       // Double-line thick border
+
+#define PSTOPS_LAYOUT_LRBT     0       // Left to right, bottom to top
+#define PSTOPS_LAYOUT_LRTB     1       // Left to right, top to bottom
+#define PSTOPS_LAYOUT_RLBT     2       // Right to left, bottom to top
+#define PSTOPS_LAYOUT_RLTB     3       // Right to left, top to bottom
+#define PSTOPS_LAYOUT_BTLR     4       // Bottom to top, left to right
+#define PSTOPS_LAYOUT_TBLR     5       // Top to bottom, left to right
+#define PSTOPS_LAYOUT_BTRL     6       // Bottom to top, right to left
+#define PSTOPS_LAYOUT_TBRL     7       // Top to bottom, right to left
+
+#define PSTOPS_LAYOUT_NEGATEY  1       // The bits for the layout
+#define PSTOPS_LAYOUT_NEGATEX  2       // definitions above...
 #define PSTOPS_LAYOUT_VERTICAL 4
 
 
-/*
- * Types...
- */
+//
+// Types...
+//
 
-typedef struct                         /**** Page information ****/
+typedef struct                         // **** Page information ****
 {
-  char         *label;                 /* Page label */
-  int          bounding_box[4];        /* PageBoundingBox */
-  off_t                offset;                 /* Offset to start of page */
-  ssize_t      length;                 /* Number of bytes for page */
-  int          num_options;            /* Number of options for this page */
-  cups_option_t        *options;               /* Options for this page */
+  char         *label;                 // Page label
+  int          bounding_box[4];        // PageBoundingBox
+  off_t                offset;                 // Offset to start of page
+  ssize_t      length;                 // Number of bytes for page
+  int          num_options;            // Number of options for this page
+  cups_option_t        *options;               // Options for this page
 } pstops_page_t;
 
-typedef struct                         /**** Document information ****/
+typedef struct                         // **** Document information ****
 {
-  int          page;                   /* Current page */
-  int          bounding_box[4];        /* BoundingBox from header */
-  int          new_bounding_box[4];    /* New composite bounding box */
-  int          num_options;            /* Number of document-wide options */
-  cups_option_t        *options;               /* Document-wide options */
-  int          normal_landscape,       /* Normal rotation for landscape? */
-               saw_eof,                /* Saw the %%EOF comment? */
-               slow_collate,           /* Collate copies by hand? */
-               slow_duplex,            /* Duplex pages slowly? */
-               slow_order,             /* Reverse pages slowly? */
-               use_ESPshowpage;        /* Use ESPshowpage? */
-  cups_array_t *pages;                 /* Pages in document */
-  cups_file_t  *temp;                  /* Temporary file, if any */
-  char         tempfile[1024];         /* Temporary filename */
-  int          job_id;                 /* Job ID */
-  const char   *user,                  /* User name */
-               *title;                 /* Job name */
-  int          copies;                 /* Number of copies */
-  const char   *ap_input_slot,         /* AP_FIRSTPAGE_InputSlot value */
-               *ap_manual_feed,        /* AP_FIRSTPAGE_ManualFeed value */
-               *ap_media_color,        /* AP_FIRSTPAGE_MediaColor value */
-               *ap_media_type,         /* AP_FIRSTPAGE_MediaType value */
-               *ap_page_region,        /* AP_FIRSTPAGE_PageRegion value */
-               *ap_page_size;          /* AP_FIRSTPAGE_PageSize value */
-  int          collate,                /* Collate copies? */
-               emit_jcl,               /* Emit JCL commands? */
-               fit_to_page;            /* Fit pages to media */
-  const char   *input_slot,            /* InputSlot value */
-               *manual_feed,           /* ManualFeed value */
-               *media_color,           /* MediaColor value */
-               *media_type,            /* MediaType value */
-               *page_region,           /* PageRegion value */
-               *page_size;             /* PageSize value */
-  int          mirror,                 /* doc->mirror/mirror pages */
-               number_up,              /* Number of pages on each sheet */
-               number_up_layout,       /* doc->number_up_layout of N-up
-                                          pages */
-               output_order,           /* Requested reverse output order? */
-               page_border;            /* doc->page_border around pages */
-  const char   *page_label,            /* page-label option, if any */
-               *page_ranges,           /* page-ranges option, if any */
-    *inputPageRange, /* input-page-ranges option, if any */
-               *page_set;              /* page-set option, if any */
-  /* Basic settings from PPD defaults/options, global vars of original pstops */
-  int           Orientation,            /* 0 = portrait, 1 = landscape, etc. */
-                Duplex,                 /* Duplexed? */
-                LanguageLevel,          /* PS Language level of printer */
-                Color;                  /* Color printer? */
-  float         PageLeft,               /* Left margin */
-                PageRight,              /* Right margin */
-                PageBottom,             /* Bottom margin */
-                PageTop,                /* Top margin */
-                PageWidth,              /* Total page width */
-                PageLength;             /* Total page length */
-  cups_file_t  *inputfp;               /* Temporary file, if any */
-  FILE         *outputfp;              /* Temporary file, if any */
-  cf_logfunc_t logfunc;             /* Logging function, NULL for no
-                                          logging */
-  void          *logdata;               /* User data for logging function, can
-                                          be NULL */
-  cf_filter_iscanceledfunc_t iscanceledfunc; /* Function returning 1 when
-                                           job is canceled, NULL for not
-                                           supporting stop on cancel */
-  void *iscanceleddata;                 /* User data for is-canceled function,
-                                          can be NULL */
+  int          page;                   // Current page
+  int          bounding_box[4];        // BoundingBox from header
+  int          new_bounding_box[4];    // New composite bounding box
+  int          num_options;            // Number of document-wide options
+  cups_option_t        *options;               // Document-wide options
+  int          normal_landscape,       // Normal rotation for landscape?
+               saw_eof,                // Saw the %%EOF comment?
+               slow_collate,           // Collate copies by hand?
+               slow_duplex,            // Duplex pages slowly?
+               slow_order,             // Reverse pages slowly?
+               use_ESPshowpage;        // Use ESPshowpage?
+  cups_array_t *pages;                 // Pages in document
+  cups_file_t  *temp;                  // Temporary file, if any
+  char         tempfile[1024];         // Temporary filename
+  int          job_id;                 // Job ID
+  const char   *user,                  // User name
+               *title;                 // Job name
+  int          copies;                 // Number of copies
+  const char   *ap_input_slot,         // AP_FIRSTPAGE_InputSlot value
+               *ap_manual_feed,        // AP_FIRSTPAGE_ManualFeed value
+               *ap_media_color,        // AP_FIRSTPAGE_MediaColor value
+               *ap_media_type,         // AP_FIRSTPAGE_MediaType value
+               *ap_page_region,        // AP_FIRSTPAGE_PageRegion value
+               *ap_page_size;          // AP_FIRSTPAGE_PageSize value
+  int          collate,                // Collate copies?
+               emit_jcl,               // Emit JCL commands?
+               fit_to_page;            // Fit pages to media
+  const char   *input_slot,            // InputSlot value
+               *manual_feed,           // ManualFeed value
+               *media_color,           // MediaColor value
+               *media_type,            // MediaType value
+               *page_region,           // PageRegion value
+               *page_size;             // PageSize value
+  int          mirror,                 // doc->mirror/mirror pages
+               number_up,              // Number of pages on each sheet
+               number_up_layout,       // doc->number_up_layout of N-up
+                                       // pages
+               output_order,           // Requested reverse output order?
+               page_border;            // doc->page_border around pages
+  const char   *page_label,            // page-label option, if any
+               *page_ranges,           // page-ranges option, if any
+               *inputPageRange,        // input-page-ranges option, if any
+               *page_set;              // page-set option, if any
+  // Basic settings from PPD defaults/options, global vars of original pstops
+  int           Orientation,            // 0 = portrait, 1 = landscape, etc.
+                Duplex,                 // Duplexed?
+                LanguageLevel,          // PS Language level of printer
+                Color;                  // Color printer?
+  float         PageLeft,               // Left margin
+                PageRight,              // Right margin
+                PageBottom,             // Bottom margin
+                PageTop,                // Top margin
+                PageWidth,              // Total page width
+                PageLength;             // Total page length
+  cups_file_t  *inputfp;               // Temporary file, if any
+  FILE         *outputfp;              // Temporary file, if any
+  cf_logfunc_t logfunc;                // Logging function, NULL for no
+                                       // logging
+  void          *logdata;               // User data for logging function, can
+                                       // be NULL
+  cf_filter_iscanceledfunc_t iscanceledfunc; // Function returning 1 when
+                                        // job is canceled, NULL for not
+                                        // supporting stop on cancel
+  void *iscanceleddata;                 // User data for is-canceled function,
+                                       // can be NULL
 } pstops_doc_t;
 
 
-/*
- * Convenience macros...
- */
+//
+// Convenience macros...
+//
 
 #define        is_first_page(p)        (doc->number_up == 1 || \
                                 ((p) % doc->number_up) == 1)
@@ -153,12 +153,13 @@ typedef struct                            /**** Document information ****/
                                 ((p) % doc->number_up) != 0)
 
 
-/*
- * Local functions...
- */
+//
+// Local functions...
+//
 
 static pstops_page_t   *add_page(pstops_doc_t *doc, const char *label);
-static int             check_range(int page ,const char *Ranges,const char *pageset);
+static int             check_range(int page, const char *Ranges,
+                                   const char *pageset);
 static void            copy_bytes(pstops_doc_t *doc,
                                   off_t offset, size_t length);
 static ssize_t         copy_comments(pstops_doc_t *doc,
@@ -217,56 +218,60 @@ static void               write_label_prolog(pstops_doc_t *doc, const char *label,
                                           float bottom, float top,
                                           float width);
 static void            write_labels(pstops_doc_t *doc, int orient);
-static void            write_labels_outputfile_only(pstops_doc_t *doc, int orient);
-static void            write_options(pstops_doc_t  *doc, ppd_file_t *ppd,
+static void            write_labels_outputfile_only(pstops_doc_t *doc,
+                                                    int orient);
+static void            write_options(pstops_doc_t *doc, ppd_file_t *ppd,
                                      int num_options, cups_option_t *options);
 static void            write_text_comment(pstops_doc_t *doc,
                                           const char *name, const char *value);
 
-/*
- * 'ppdFilterPSToPS()' - Filter function to insert PostScript code from
- *              PPD file (PostScript printer driver) into a 
- *              PostScript data stream
- */
-
-int                         /* O - Error status */
-ppdFilterPSToPS(int inputfd,         /* I - File descriptor input stream */
-       int outputfd,        /* I - File descriptor output stream */
-       int inputseekable,   /* I - Is input stream seekable? (unused) */
-       cf_filter_data_t *data, /* I - Job and printer data */
-       void *parameters)    /* I - Filter-specific parameters (unused) */
+
+//
+// 'ppdFilterPSToPS()' - Filter function to insert PostScript code from
+//                       PPD file (PostScript printer driver) into a
+//                       PostScript data stream
+//
+
+int                                    // O - Error status
+ppdFilterPSToPS(int inputfd,           // I - File descriptor input stream
+               int outputfd,           // I - File descriptor output stream
+               int inputseekable,      // I - Is input stream seekable?
+                                       //     (unused)
+               cf_filter_data_t *data, // I - Job and printer data
+               void *parameters)       // I - Filter-specific parameters
+                                       //     (unused)
 {
   ppd_filter_data_ext_t *filter_data_ext =
     (ppd_filter_data_ext_t *)cfFilterDataGetExt(data,
                                                PPD_FILTER_DATA_EXT);
-  pstops_doc_t doc;                    /* Document information */
-  cups_file_t  *inputfp,*fp;           /* Print file */
-  FILE          *outputfp;              /* Output data stream */
+  pstops_doc_t doc;                    // Document information
+  cups_file_t  *inputfp,*fp;           // Print file
+  FILE          *outputfp;              // Output data stream
   char         line[8192],
-          buffer[8192];                /* Line buffers */
-  ssize_t      len,bytes;                      /* Length of line buffers */
-  pstops_page_t *pageinfo;
-  cf_logfunc_t log = data->logfunc;
-  void          *ld = data->logdata;
+               buffer[8192];           // Line buffers
+  ssize_t      len, bytes;             // Length of line buffers
+  pstops_page_t        *pageinfo;
+  cf_logfunc_t log = data->logfunc;
+  void         *ld = data->logdata;
   cf_filter_iscanceledfunc_t iscanceled = data->iscanceledfunc;
-  void          *icd = data->iscanceleddata;
-   int proc_pipe[2];
-   int pstops_pid = 0; 
-   int childStatus;
-   int status = 0;
+  void         *icd = data->iscanceleddata;
+  int          proc_pipe[2];
+  int          pstops_pid = 0;
+  int          childStatus;
+  int          status = 0;
 
   (void)inputseekable;
   (void)parameters;
 
- /*
-  * Ignore broken pipe signals...
-  */
+  //
+  // Ignore broken pipe signals...
+  //
 
   signal(SIGPIPE, SIG_IGN);
 
- /*
-  * Process job options...
-  */
+  //
+  // Process job options...
+  //
 
   if (set_pstops_options(&doc, (filter_data_ext ? filter_data_ext->ppd : NULL),
                         data->job_id, data->job_user,
@@ -279,83 +284,85 @@ ppdFilterPSToPS(int inputfd,         /* I - File descriptor input stream */
 
     return (1);
   }
-  
-   if(doc.inputPageRange)
- {   
-     if(pipe(proc_pipe))
-     {
-        if (log) log(ld, CF_LOGLEVEL_ERROR,
+
+  if (doc.inputPageRange)
+  {
+    if (pipe(proc_pipe))
+    {
+      if (log) log(ld, CF_LOGLEVEL_ERROR,
                   "ppdFilterPSToPS: Unable to create pipe for input-page-ranges");
-                  return (1);
-     }
+      return (1);
+    }
     if ((pstops_pid = fork()) == 0)
-    {  
-     close(proc_pipe[0]);
+    {
+      close(proc_pipe[0]);
 
       if ((fp = cupsFileOpenFd(inputfd, "r")) == NULL)
-     {
+      {
         if (!iscanceled || !iscanceled(icd))
         {
-        if (log) log(ld, CF_LOGLEVEL_DEBUG,
-                    "ppdFilterPSToPS: Unable to open input data stream.");
+         if (log) log(ld, CF_LOGLEVEL_DEBUG,
+                      "ppdFilterPSToPS: Unable to open input data stream.");
         }
 
-     exit (1);
-    }
+       exit (1);
+      }
 
-    bytes = cupsFileGetLine(fp,buffer,sizeof(buffer));
+      bytes = cupsFileGetLine(fp,buffer,sizeof(buffer));
 
       while (strncmp(buffer, "%%Page:", 7) && strncmp(buffer, "%%Trailer", 9))
-    {
-      bytes = write(proc_pipe[1], buffer, bytes);
-      if ((bytes = cupsFileGetLine(fp, buffer, sizeof(buffer))) == 0)
-        break;
-    }
-
-    int input_page_number=0;
+      {
+       bytes = write(proc_pipe[1], buffer, bytes);
+       if ((bytes = cupsFileGetLine(fp, buffer, sizeof(buffer))) == 0)
+         break;
+      }
 
-    while (!strncmp(buffer, "%%Page:", 7))
-    {
-      input_page_number ++;
+      int input_page_number = 0;
 
-      if(check_range(input_page_number,doc.inputPageRange,NULL))
+      while (!strncmp(buffer, "%%Page:", 7))
       {
+       input_page_number ++;
+
+       if(check_range(input_page_number,doc.inputPageRange,NULL))
+       {
           bytes = write(proc_pipe[1], buffer, bytes);
-          bytes = cupsFileGetLine(fp,buffer,sizeof(buffer));
-        while(strncmp(buffer, "%%Page:", 7) && strncmp(buffer, "%%Trailer", 9))
-        { bytes = write(proc_pipe[1], buffer, bytes);
-          bytes = cupsFileGetLine(fp,buffer,sizeof(buffer));
-        }
+          bytes = cupsFileGetLine(fp, buffer, sizeof(buffer));
+         while(strncmp(buffer, "%%Page:", 7) &&
+               strncmp(buffer, "%%Trailer", 9))
+         {
+           bytes = write(proc_pipe[1], buffer, bytes);
+           bytes = cupsFileGetLine(fp, buffer, sizeof(buffer));
+         }
+       }
+       else
+       {
+         bytes = cupsFileGetLine(fp, buffer, sizeof(buffer));
+         while(strncmp(buffer, "%%Page:", 7) &&
+               strncmp(buffer, "%%Trailer", 9))
+           bytes = cupsFileGetLine(fp, buffer, sizeof(buffer));
+       }
       }
-      else
+      while (bytes)
       {
-        bytes = cupsFileGetLine(fp,buffer,sizeof(buffer)); 
-        while(strncmp(buffer, "%%Page:", 7) && strncmp(buffer, "%%Trailer", 9))
-        {
-          bytes = cupsFileGetLine(fp,buffer,sizeof(buffer)); 
-        }
+        bytes = write(proc_pipe[1], buffer, bytes);
+        bytes= cupsFileGetLine(fp,buffer,sizeof(buffer));
       }
+      close(proc_pipe[1]);
+      cupsFileClose(fp);
+      exit(0);
     }
-    while (bytes)
+    else
     {
-        bytes = write(proc_pipe[1], buffer, bytes);
-        bytes= cupsFileGetLine(fp,buffer,sizeof(buffer));
+      close(proc_pipe[1]);
+      close(inputfd);
+      inputfd=proc_pipe[0];
     }
-    close(proc_pipe[1]);
-    cupsFileClose(fp);
-    exit(0);
-   }
-   else
-   {
-     close(proc_pipe[1]);
-     close(inputfd);
-     inputfd=proc_pipe[0];
-   }
   }
 
- /*
-  * Open the input data stream specified by the inputfd...
-  */
+  //
+  // Open the input data stream specified by the inputfd...
+  //
+
   if ((inputfp = cupsFileOpenFd(inputfd, "r")) == NULL)
   {
     if (!iscanceled || !iscanceled(icd))
@@ -367,9 +374,9 @@ ppdFilterPSToPS(int inputfd,         /* I - File descriptor input stream */
     return (1);
   }
 
- /*
-  * Open the output data stream specified by the outputfd...
-  */
+  //
+  // Open the output data stream specified by the outputfd...
+  //
 
   if ((outputfp = fdopen(outputfd, "w")) == NULL)
   {
@@ -384,52 +391,52 @@ ppdFilterPSToPS(int inputfd,         /* I - File descriptor input stream */
     return (1);
   }
 
- /*
-  * Read the first line to see if we have DSC comments...
-  */
+  //
+  // Read the first line to see if we have DSC comments...
+  //
 
   if ((len = (ssize_t)cupsFileGetLine(inputfp, line, sizeof(line))) == 0)
   {
     if (log) log(ld, CF_LOGLEVEL_DEBUG,
                 "ppdFilterPSToPS: The print file is empty.");
-    /* Do not treat this an error, if a previous filter eliminated all
-       pages the job should get dequeued without anything printed. */
+    // Do not treat this an error, if a previous filter eliminated all
+    // pages the job should get dequeued without anything printed.
     return (0);
   }
 
   doc.inputfp = inputfp;
   doc.outputfp = outputfp;
-  
- /*
-  * Write any "exit server" options that have been selected...
-  */
+
+  //
+  // Write any "exit server" options that have been selected...
+  //
 
   if (filter_data_ext)
     ppdEmit(filter_data_ext->ppd, outputfp, PPD_ORDER_EXIT);
 
- /*
-  * Write any JCL commands that are needed to print PostScript code...
-  */
+  //
+  // Write any JCL commands that are needed to print PostScript code...
+  //
 
   if (filter_data_ext && doc.emit_jcl)
     ppdEmitJCL(filter_data_ext->ppd, outputfp, doc.job_id, doc.user, doc.title);
 
- /*
-  * Start with a DSC header...
-  */
+  //
+  // Start with a DSC header...
+  //
 
   doc_puts(&doc, "%!PS-Adobe-3.0\n");
 
- /*
-  * Skip leading PJL in the document...
-  */
+  //
+  // Skip leading PJL in the document...
+  //
 
   while (!strncmp(line, "\033%-12345X", 9) || !strncmp(line, "@PJL ", 5))
   {
-   /*
-    * Yup, we have leading PJL fun, so skip it until we hit the line
-    * with "ENTER LANGUAGE"...
-    */
+    //
+    // Yup, we have leading PJL fun, so skip it until we hit the line
+    // with "ENTER LANGUAGE"...
+    //
 
     if (log) log(ld, CF_LOGLEVEL_DEBUG,
                 "ppdFilterPSToPS: Skipping PJL header...");
@@ -445,41 +452,41 @@ ppdFilterPSToPS(int inputfd,         /* I - File descriptor input stream */
       break;
   }
 
- /*
-  * Now see if the document conforms to the Adobe Document Structuring
-  * Conventions...
-  */
+  //
+  // Now see if the document conforms to the Adobe Document Structuring
+  // Conventions...
+  //
 
   if (!strncmp(line, "%!PS-Adobe-", 11))
   {
-   /*
-    * Yes, filter the document...
-    */
+    //
+    // Yes, filter the document...
+    //
 
     if (filter_data_ext)
       copy_dsc(&doc, filter_data_ext->ppd, line, len, sizeof(line));
   }
   else
   {
-   /*
-    * No, display an error message and treat the file as if it contains
-    * a single page...
-    */
+    //
+    // No, display an error message and treat the file as if it contains
+    // a single page...
+    //
 
     if (filter_data_ext)
       copy_non_dsc(&doc, filter_data_ext->ppd, line, len, sizeof(line));
   }
 
- /*
-  * Send %%EOF as needed...
-  */
+  //
+  // Send %%EOF as needed...
+  //
 
   if (!doc.saw_eof)
     doc_puts(&doc, "%%EOF\n");
 
- /*
-  * End the job with the appropriate JCL command or CTRL-D...
-  */
+  //
+  // End the job with the appropriate JCL command or CTRL-D...
+  //
 
   if (doc.emit_jcl)
   {
@@ -490,9 +497,9 @@ ppdFilterPSToPS(int inputfd,         /* I - File descriptor input stream */
       doc_putc(&doc, 0x04);
   }
 
- /*
-  * Close files and remove the temporary file if needed...
-  */
+  //
+  // Close files and remove the temporary file if needed...
+  //
 
   if (doc.temp)
   {
@@ -515,31 +522,38 @@ ppdFilterPSToPS(int inputfd,         /* I - File descriptor input stream */
     doc.pages = NULL;
   }
 
-  if(doc.inputPageRange)
-    { 
-      retry_wait:
-        if (waitpid (pstops_pid, &childStatus, 0) == -1) {
-          if (errno == EINTR)
-            goto retry_wait;
-          if (log) log(ld, CF_LOGLEVEL_ERROR,
-          "ppdFilterPSToPS: Error while waiting for input_page_ranges to finish - %s.",
-          strerror(errno));
-        }
-        /* How did the sub-process terminate */
-    if (childStatus) {
-      if (WIFEXITED(childStatus)) {
-       /* Via exit() anywhere or return() in the main() function */
+  if (doc.inputPageRange)
+  {
+  retry_wait:
+    if (waitpid (pstops_pid, &childStatus, 0) == -1)
+    {
+      if (errno == EINTR)
+       goto retry_wait;
+      if (log) log(ld, CF_LOGLEVEL_ERROR,
+                  "ppdFilterPSToPS: Error while waiting for input_page_ranges to finish - %s.",
+                  strerror(errno));
+    }
+    // How did the sub-process terminate
+    if (childStatus)
+    {
+      if (WIFEXITED(childStatus))
+      {
+       // Via exit() anywhere or return() in the main() function
        if (log) log(ld, CF_LOGLEVEL_ERROR,
                     "ppdFilterPSToPS: input-page-ranges filter (PID %d) stopped with status %d",
                     pstops_pid, WEXITSTATUS(childStatus));
-      } else {
-       /* Via signal */
+      }
+      else
+      {
+       // Via signal
        if (log) log(ld, CF_LOGLEVEL_ERROR,
                     "ppdFilterPSToPS: imput-page-ranges filter (PID %d) crashed on signal %d",
                     pstops_pid, WTERMSIG(childStatus));
       }
-      status=1;
-    } else {
+      status = 1;
+    }
+    else
+    {
       if (log) log(ld, CF_LOGLEVEL_DEBUG,
                   "ppdFilterPSToPS: input-page-ranges-filter (PID %d) exited with no errors.",
                   pstops_pid);
@@ -556,100 +570,102 @@ ppdFilterPSToPS(int inputfd,         /* I - File descriptor input stream */
 }
 
 
-/*
- * 'ppdFilterImageToPS()' - Filter function to convert many common image file
- *                 formats into PostScript
- */
-
-int                                       /* O - Error status */
-ppdFilterImageToPS(int inputfd,            /* I - File descriptor input stream */
-                 int outputfd,           /* I - File descriptor output stream*/
-                 int inputseekable,      /* I - Is input stream seekable?
-                                            (unused) */
-                 cf_filter_data_t *data, /* I - Job and printer data */
-                 void *parameters)       /* I - Filter-specific parameters
-                                            (unused) */
+//
+// 'ppdFilterImageToPS()' - Filter function to convert many common image file
+//                          formats into PostScript
+//
+
+int                                            // O - Error status
+ppdFilterImageToPS(int inputfd,                        // I - File descriptor input
+                                               //     stream
+                  int outputfd,                // I - File descriptor output
+                                               //     stream
+                  int inputseekable,           // I - Is input stream seekable?
+                                               //     (unused)
+                  cf_filter_data_t *data,      // I - Job and printer data
+                  void *parameters)            // I - Filter-specific
+                                               //     parameters (unused)
 {
   ppd_filter_data_ext_t *filter_data_ext =
     (ppd_filter_data_ext_t *)cfFilterDataGetExt(data,
                                                PPD_FILTER_DATA_EXT);
-  pstops_doc_t doc;                    /* Document information */
-  cf_image_t   *img;                   /* Image to print */
-  float                xprint,                 /* Printable area */
+  pstops_doc_t doc;                    // Document information
+  cf_image_t   *img;                   // Image to print
+  float                xprint,                 // Printable area
                yprint,
-               xinches,                /* Total size in inches */
+               xinches,                // Total size in inches
                yinches;
-  float                xsize,                  /* Total size in points */
+  float                xsize,                  // Total size in points
                ysize,
                xsize2,
                ysize2;
-  float                aspect;                 /* Aspect ratio */
-  int          xpages,                 /* # x pages */
-               ypages,                 /* # y pages */
-               xpage,                  /* Current x page */
-               ypage,                  /* Current y page */
-               page;                   /* Current page number */
-  int          xc0, yc0,               /* Corners of the page in image coords*/
+  float                aspect;                 // Aspect ratio
+  int          xpages,                 // # x pages
+               ypages,                 // # y pages
+               xpage,                  // Current x page
+               ypage,                  // Current y page
+               page;                   // Current page number
+  int          xc0, yc0,               // Corners of the page in image coords
                xc1, yc1;
-  cf_ib_t      *row;                   /* Current row */
-  int          y;                      /* Current Y coordinate in image */
-  int          colorspace;             /* Output colorspace */
-  int          out_offset,             /* Offset into output buffer */
-               out_length;             /* Length of output buffer */
-  ppd_file_t   *ppd = NULL;            /* PPD file */
-  ppd_choice_t *choice;                /* PPD option choice */
-  int          num_options;            /* Number of print options */
-  cups_option_t        *options;               /* Print options */
-  const char   *val;                   /* Option value */
-  int          slowcollate;            /* Collate copies the slow way */
-  float                g;                      /* Gamma correction value */
-  float                b;                      /* Brightness factor */
-  float                zoom;                   /* Zoom facter */
-  int          xppi, yppi;             /* Pixels-per-inch */
-  int          hue, sat;               /* Hue and saturation adjustment */
-  int          realcopies,             /* Real copies being printed */
-               emit_jcl;               /* Emit JCL? */
-  float                left, top;              /* Left and top of image */
-  time_t       curtime;                /* Current time */
-  struct tm    *curtm;                 /* Current date */
-  char         curdate[255];           /* Current date string */
-  int          fillprint = 0;          /* print-scaling = fill */
-  int          cropfit = 0;            /* -o crop-to-fit = true */
-  cups_page_header2_t h;                /* CUPS Raster page header, to */
-                                        /* accommodate results of command */
-                                        /* line parsing for PPD-less queue */
-  int          Flip,                   /* Flip/mirror pages */
-               XPosition,              /* Horizontal position on page */
-               YPosition,              /* Vertical position on page */
-               Collate,                /* Collate copies? */
-               Copies;                 /* Number of copies */
-  char         tempfile[1024];         /* Name of file to print */
-  FILE          *inputfp;              /* Input file */
-  int           fd;                    /* File descriptor for temp file */
+  cf_ib_t      *row;                   // Current row
+  int          y;                      // Current Y coordinate in image
+  int          colorspace;             // Output colorspace
+  int          out_offset,             // Offset into output buffer
+               out_length;             // Length of output buffer
+  ppd_file_t   *ppd = NULL;            // PPD file
+  ppd_choice_t *choice;                // PPD option choice
+  int          num_options;            // Number of print options
+  cups_option_t        *options;               // Print options
+  const char   *val;                   // Option value
+  int          slowcollate;            // Collate copies the slow way
+  float                g;                      // Gamma correction value
+  float                b;                      // Brightness factor
+  float                zoom;                   // Zoom facter
+  int          xppi, yppi;             // Pixels-per-inch
+  int          hue, sat;               // Hue and saturation adjustment
+  int          realcopies,             // Real copies being printed
+               emit_jcl;               // Emit JCL?
+  float                left, top;              // Left and top of image
+  time_t       curtime;                // Current time
+  struct tm    *curtm;                 // Current date
+  char         curdate[255];           // Current date string
+  int          fillprint = 0;          // print-scaling = fill
+  int          cropfit = 0;            // -o crop-to-fit = true
+  cups_page_header2_t h;                // CUPS Raster page header, to
+                                        // accommodate results of command
+                                        // line parsing for PPD-less queue
+  int          Flip,                   // Flip/mirror pages
+               XPosition,              // Horizontal position on page
+               YPosition,              // Vertical position on page
+               Collate,                // Collate copies?
+               Copies;                 // Number of copies
+  char         tempfile[1024];         // Name of file to print
+  FILE          *inputfp;              // Input file
+  int           fd;                    // File descriptor for temp file
   char          buf[BUFSIZ];
   int           bytes;
-  cups_cspace_t cspace = (cups_cspace_t)(-1);
-  cf_logfunc_t log = data->logfunc;
-  void          *ld = data->logdata;
+  cups_cspace_t        cspace = (cups_cspace_t)(-1);
+  cf_logfunc_t log = data->logfunc;
+  void         *ld = data->logdata;
   cf_filter_iscanceledfunc_t iscanceled = data->iscanceledfunc;
-  void          *icd = data->iscanceleddata;
+  void         *icd = data->iscanceleddata;
 
 
- /*
-  * Make sure status messages are not buffered...
-  */
+  //
+  // Make sure status messages are not buffered...
+  //
 
   setbuf(stderr, NULL);
 
- /*
-  * Ignore broken pipe signals...
-  */
+  //
+  // Ignore broken pipe signals...
+  //
 
   signal(SIGPIPE, SIG_IGN);
 
- /*
-  * Initialize data structure
-  */
+  //
+  // Initialize data structure
+  //
 
   Flip = 0;
   XPosition = 0;
@@ -657,15 +673,15 @@ ppdFilterImageToPS(int inputfd,            /* I - File descriptor input stream *
   Collate = 0;
   Copies = 1;
 
- /*
-  * Initialize document information structure...
-  */
+  //
+  // Initialize document information structure...
+  //
 
   memset(&doc, 0, sizeof(pstops_doc_t));
 
- /*
-  * Open the input data stream specified by the inputfd ...
-  */
+  //
+  // Open the input data stream specified by the inputfd ...
+  //
 
   if ((inputfp = fdopen(inputfd, "r")) == NULL)
   {
@@ -678,9 +694,9 @@ ppdFilterImageToPS(int inputfd,            /* I - File descriptor input stream *
     return (1);
   }
 
- /*
-  * Copy input into temporary file if needed ...
-  */
+  //
+  // Copy input into temporary file if needed ...
+  //
 
   if (!inputseekable) {
     if ((fd = cupsTempFd(tempfile, sizeof(tempfile))) < 0)
@@ -701,9 +717,9 @@ ppdFilterImageToPS(int inputfd,            /* I - File descriptor input stream *
     fclose(inputfp);
     close(fd);
 
-   /*
-    * Open the temporary file to read it instead of the original input ...
-    */
+    //
+    // Open the temporary file to read it instead of the original input ...
+    //
 
     if ((inputfp = fopen(tempfile, "r")) == NULL)
     {
@@ -718,9 +734,9 @@ ppdFilterImageToPS(int inputfd,            /* I - File descriptor input stream *
     }
   }
 
- /*
-  * Open the output data stream specified by the outputfd...
-  */
+  //
+  // Open the output data stream specified by the outputfd...
+  //
 
   if ((doc.outputfp = fdopen(outputfd, "w")) == NULL)
   {
@@ -737,9 +753,9 @@ ppdFilterImageToPS(int inputfd,            /* I - File descriptor input stream *
     return (1);
   }
 
- /*
-  * Process command-line options and write the prolog...
-  */
+  //
+  // Process command-line options and write the prolog...
+  //
 
   zoom = 1.0;
   xppi = 0;
@@ -751,36 +767,40 @@ ppdFilterImageToPS(int inputfd,            /* I - File descriptor input stream *
 
   Copies = data->copies;
 
- /*
-  * Option list...
-  */
+  //
+  // Option list...
+  //
 
   options     = data->options;
   num_options = data->num_options;
 
- /*
-  * Process job options...
-  */
+  //
+  // Process job options...
+  //
 
   if (filter_data_ext)
     ppd = filter_data_ext->ppd;
   ppdFilterSetCommonOptions(ppd, num_options, options, 0,
-                        &doc.Orientation, &doc.Duplex,
-                        &doc.LanguageLevel, &doc.Color,
-                        &doc.PageLeft, &doc.PageRight,
-                        &doc.PageTop, &doc.PageBottom,
-                        &doc.PageWidth, &doc.PageLength,
-                        log, ld);
-
-  /* The ppdFilterSetCommonOptions() does not set doc.Color
-     according to option settings (user's demand for color/gray),
-     so we parse the options and set the mode here */
+                           &doc.Orientation, &doc.Duplex,
+                           &doc.LanguageLevel, &doc.Color,
+                           &doc.PageLeft, &doc.PageRight,
+                           &doc.PageTop, &doc.PageBottom,
+                           &doc.PageWidth, &doc.PageLength,
+                           log, ld);
+
+  //
+  // The ppdFilterSetCommonOptions() does not set doc.Color
+  // according to option settings (user's demand for color/gray),
+  // so we parse the options and set the mode here
+  //
+
   cfRasterPrepareHeader(&h, data, CF_FILTER_OUT_FORMAT_CUPS_RASTER,
                        CF_FILTER_OUT_FORMAT_CUPS_RASTER, 0, &cspace);
   if (doc.Color)
     doc.Color = h.cupsNumColors <= 1 ? 0 : 1;
-  if (!ppd) {
-    /* Without PPD use also the other findings of cfRasterParseIPPOptions() */
+  if (!ppd)
+  {
+    // Without PPD use also the other findings of cfRasterParseIPPOptions()
     doc.Orientation = h.Orientation;
     doc.Duplex = h.Duplex;
     doc.LanguageLevel = 2;
@@ -801,16 +821,17 @@ ppdFilterImageToPS(int inputfd,            /* I - File descriptor input stream *
     Copies = h.NumCopies;
   }
 
-  if ((val = cupsGetOption("multiple-document-handling", num_options, options)) != NULL)
+  if ((val = cupsGetOption("multiple-document-handling",
+                          num_options, options)) != NULL)
   {
-   /*
-    * This IPP attribute is unnecessarily complicated...
-    *
-      single-document, separate-documents-collated-copies, and
-      single-document-new-sheet all require collated copies.
-    *
-      separate-documents-uncollated-copies allows for uncollated copies.
-    */
+    //
+    // This IPP attribute is unnecessarily complicated...
+    //
+    //  single-document, separate-documents-collated-copies, and
+    //  single-document-new-sheet all require collated copies.
+    //
+    //  separate-documents-uncollated-copies allows for uncollated copies.
+    //
 
     Collate = strcasecmp(val, "separate-documents-uncollated-copies") != 0;
   }
@@ -821,9 +842,9 @@ ppdFilterImageToPS(int inputfd,            /* I - File descriptor input stream *
 
   if ((val = cupsGetOption("gamma", num_options, options)) != NULL)
   {
-   /*
-    * Get gamma value from 1 to 10000...
-    */
+    //
+    // Get gamma value from 1 to 10000...
+    //
 
     g = atoi(val) * 0.001f;
 
@@ -835,9 +856,9 @@ ppdFilterImageToPS(int inputfd,            /* I - File descriptor input stream *
 
   if ((val = cupsGetOption("brightness", num_options, options)) != NULL)
   {
-   /*
-    * Get brightness value from 10 to 1000.
-    */
+    //
+    // Get brightness value from 10 to 1000.
+    //
 
     b = atoi(val) * 0.01f;
 
@@ -928,14 +949,15 @@ ppdFilterImageToPS(int inputfd,            /* I - File descriptor input stream *
   else
     emit_jcl = 1;
 
- /*
-  * Open the input image to print...
-  */
+  //
+  // Open the input image to print...
+  //
 
   colorspace = doc.Color ? CF_IMAGE_RGB_CMYK : CF_IMAGE_WHITE;
 
   img = cfImageOpenFP(inputfp, colorspace, CF_IMAGE_WHITE, sat, hue, NULL);
-  if (img != NULL) {
+  if (img != NULL)
+  {
 
     int margin_defined = 0;
     int fidelity = 0;
@@ -943,7 +965,7 @@ ppdFilterImageToPS(int inputfd,            /* I - File descriptor input stream *
 
     if (ppd && (ppd->custom_margins[0] || ppd->custom_margins[1] ||
                ppd->custom_margins[2] || ppd->custom_margins[3]))
-      /* In case of custom margins */
+      // In case of custom margins
       margin_defined = 1;
     if (doc.PageLength != doc.PageTop - doc.PageBottom ||
        doc.PageWidth != doc.PageRight - doc.PageLeft)
@@ -971,7 +993,8 @@ ppdFilterImageToPS(int inputfd,            /* I - File descriptor input stream *
       if(!strcasecmp(val, "true") || !strcasecmp(val, "yes"))
        tempOrientation = 4;
     }
-    if (tempOrientation == 0) {
+    if (tempOrientation == 0)
+    {
       if (((pw > ph) && (w < h)) || ((pw < ph) && (w > h)))
        tempOrientation = 4;
     }
@@ -988,7 +1011,8 @@ ppdFilterImageToPS(int inputfd,            /* I - File descriptor input stream *
     {
       if (!strcasecmp(val, "auto"))
       {
-       if (fidelity || document_large) {
+       if (fidelity || document_large)
+       {
          if (margin_defined)
            zoom = 1.0;       // fit method
          else
@@ -1043,8 +1067,8 @@ ppdFilterImageToPS(int inputfd,            /* I - File descriptor input stream *
     }
     if (fillprint || cropfit)
     {
-      /* For cropfit do the math without the unprintable margins to get correct
-         centering */
+      // For cropfit do the math without the unprintable margins to get correct
+      // centering
       if (cropfit)
       {
        pw = doc.PageWidth;
@@ -1075,7 +1099,7 @@ ppdFilterImageToPS(int inputfd,            /* I - File descriptor input stream *
        }
       }
       if (tempOrientation==0)
-      { 
+      {
        if (((pw > ph) && (w < h)) || ((pw < ph) && (w > h)))
        {
          int temp = pw;
@@ -1084,11 +1108,13 @@ ppdFilterImageToPS(int inputfd,            /* I - File descriptor input stream *
          flag = 4;
        }
       }
-      if (fillprint) {
+      if (fillprint)
+      {
        float final_w, final_h;
-       if (w * ph / pw <= h) {
+       if (w * ph / pw <= h)
+       {
          final_w = w;
-         final_h = w * ph / pw; 
+         final_h = w * ph / pw;
        }
        else
        {
@@ -1148,9 +1174,9 @@ ppdFilterImageToPS(int inputfd,            /* I - File descriptor input stream *
 
   colorspace = cfImageGetColorSpace(img);
 
- /*
-  * Scale as necessary...
-  */
+  //
+  // Scale as necessary...
+  //
 
   if (zoom == 0.0 && xppi == 0)
   {
@@ -1167,9 +1193,9 @@ ppdFilterImageToPS(int inputfd,            /* I - File descriptor input stream *
 
   if (xppi > 0)
   {
-   /*
-    * Scale the image as neccesary to match the desired pixels-per-inch.
-    */
+    //
+    // Scale the image as neccesary to match the desired pixels-per-inch.
+    //
 
     if (doc.Orientation & 1)
     {
@@ -1202,9 +1228,9 @@ ppdFilterImageToPS(int inputfd,            /* I - File descriptor input stream *
     if (cupsGetOption("orientation-requested", num_options, options) == NULL &&
         cupsGetOption("landscape", num_options, options) == NULL)
     {
-     /*
-      * Rotate the image if it will fit landscape but not portrait...
-      */
+      //
+      // Rotate the image if it will fit landscape but not portrait...
+      //
 
       if (log) log(ld, CF_LOGLEVEL_DEBUG,
                   "ppdFilterImageToPS: Auto orientation...");
@@ -1212,9 +1238,9 @@ ppdFilterImageToPS(int inputfd,            /* I - File descriptor input stream *
       if ((xinches > xprint || yinches > yprint) &&
           xinches <= yprint && yinches <= xprint)
       {
-       /*
-       * Rotate the image as needed...
-       */
+       //
+       // Rotate the image as needed...
+       //
 
        if (log) log(ld, CF_LOGLEVEL_DEBUG,
                     "ppdFilterImageToPS: Using landscape orientation...");
@@ -1228,9 +1254,9 @@ ppdFilterImageToPS(int inputfd,            /* I - File descriptor input stream *
   }
   else
   {
-   /*
-    * Scale percentage of page size...
-    */
+    //
+    // Scale percentage of page size...
+    //
 
     xprint = (doc.PageRight - doc.PageLeft) / 72.0;
     yprint = (doc.PageTop - doc.PageBottom) / 72.0;
@@ -1276,19 +1302,19 @@ ppdFilterImageToPS(int inputfd,            /* I - File descriptor input stream *
     if (cupsGetOption("orientation-requested", num_options, options) == NULL &&
         cupsGetOption("landscape", num_options, options) == NULL)
     {
-     /*
-      * Choose the rotation with the largest area, but prefer
-      * portrait if they are equal...
-      */
+      //
+      // Choose the rotation with the largest area, but prefer
+      // portrait if they are equal...
+      //
 
       if (log) log(ld, CF_LOGLEVEL_DEBUG,
                   "ppdFilterImageToPS: Auto orientation...");
 
       if ((xsize * ysize) < (xsize2 * xsize2))
       {
-       /*
-       * Do landscape orientation...
-       */
+       //
+       // Do landscape orientation...
+       //
 
        if (log) log(ld, CF_LOGLEVEL_DEBUG,
                     "ppdFilterImageToPS: Using landscape orientation...");
@@ -1301,9 +1327,9 @@ ppdFilterImageToPS(int inputfd,            /* I - File descriptor input stream *
       }
       else
       {
-       /*
-       * Do portrait orientation...
-       */
+       //
+       // Do portrait orientation...
+       //
 
        if (log) log(ld, CF_LOGLEVEL_DEBUG,
                     "ppdFilterImageToPS: Using portrait orientation...");
@@ -1335,10 +1361,10 @@ ppdFilterImageToPS(int inputfd,            /* I - File descriptor input stream *
     }
   }
 
- /*
-  * Compute the number of pages to print and the size of the image on each
-  * page...
-  */
+  //
+  // Compute the number of pages to print and the size of the image on each
+  // page...
+  //
 
   xpages = ceil(xinches / xprint);
   ypages = ceil(yinches / yprint);
@@ -1350,21 +1376,21 @@ ppdFilterImageToPS(int inputfd,            /* I - File descriptor input stream *
               "ppdFilterImageToPS: xpages = %dx%.2fin, ypages = %dx%.2fin",
               xpages, xprint, ypages, yprint);
 
- /*
-  * Update the page size for custom sizes...
-  */
+  //
+  // Update the page size for custom sizes...
+  //
 
   if ((choice = ppdFindMarkedChoice(ppd, "PageSize")) != NULL &&
       strcasecmp(choice->choice, "Custom") == 0)
   {
-    float      width,          /* New width in points */
-               length;         /* New length in points */
-    char       s[255];         /* New custom page size... */
+    float      width,          // New width in points
+               length;         // New length in points
+    char       s[255];         // New custom page size...
 
 
-   /*
-    * Use the correct width and length for the current orientation...
-    */
+    //
+    // Use the correct width and length for the current orientation...
+    //
 
     if (doc.Orientation & 1)
     {
@@ -1377,16 +1403,16 @@ ppdFilterImageToPS(int inputfd,            /* I - File descriptor input stream *
       length = yprint * 72.0;
     }
 
-   /*
-    * Add margins to page size...
-    */
+    //
+    // Add margins to page size...
+    //
 
     width  += ppd->custom_margins[0] + ppd->custom_margins[2];
     length += ppd->custom_margins[1] + ppd->custom_margins[3];
 
-   /*
-    * Enforce minimums...
-    */
+    //
+    // Enforce minimums...
+    //
 
     if (width < ppd->custom_min[0])
       width = ppd->custom_min[0];
@@ -1398,16 +1424,16 @@ ppdFilterImageToPS(int inputfd,            /* I - File descriptor input stream *
                 "ppdFilterImageToPS: Updated custom page size to %.2f x %.2f inches...",
                 width / 72.0, length / 72.0);
 
-   /*
-    * Set the new custom size...
-    */
+    //
+    // Set the new custom size...
+    //
 
     sprintf(s, "Custom.%.0fx%.0f", width, length);
     ppdMarkOption(ppd, "PageSize", s);
 
-   /*
-    * Update page variables...
-    */
+    //
+    // Update page variables...
+    //
 
     doc.PageWidth  = width;
     doc.PageLength = length;
@@ -1417,9 +1443,9 @@ ppdFilterImageToPS(int inputfd,            /* I - File descriptor input stream *
     doc.PageTop    = length - ppd->custom_margins[3];
   }
 
- /*
-  * See if we need to collate, and if so how we need to do it...
-  */
+  //
+  // See if we need to collate, and if so how we need to do it...
+  //
 
   if (xpages == 1 && ypages == 1)
     Collate = 0;
@@ -1434,30 +1460,30 @@ ppdFilterImageToPS(int inputfd,            /* I - File descriptor input stream *
   else
     realcopies = 1;
 
- /*
-  * Write any "exit server" options that have been selected...
-  */
+  //
+  // Write any "exit server" options that have been selected...
+  //
 
   ppdEmit(ppd, doc.outputfp, PPD_ORDER_EXIT);
 
- /*
-  * Write any JCL commands that are needed to print PostScript code...
-  */
+  //
+  // Write any JCL commands that are needed to print PostScript code...
+  //
 
   if (emit_jcl)
     ppdEmitJCL(ppd, doc.outputfp, data->job_id, data->job_user,
               data->job_title);
 
- /*
-  * Start sending the document with any commands needed...
-  */
+  //
+  // Start sending the document with any commands needed...
+  //
 
   curtime = time(NULL);
   curtm   = localtime(&curtime);
 
   doc_puts(&doc, "%!PS-Adobe-3.0\n");
   doc_printf(&doc, "%%%%BoundingBox: %.0f %.0f %.0f %.0f\n",
-         doc.PageLeft, doc.PageBottom, doc.PageRight, doc.PageTop);
+            doc.PageLeft, doc.PageBottom, doc.PageRight, doc.PageTop);
   doc_printf(&doc, "%%%%LanguageLevel: %d\n", doc.LanguageLevel);
   doc_printf(&doc, "%%%%Pages: %d\n", xpages * ypages * Copies);
   doc_puts(&doc, "%%DocumentData: Clean7Bit\n");
@@ -1486,38 +1512,38 @@ ppdFilterImageToPS(int inputfd,            /* I - File descriptor input stream *
 
   if (g != 1.0 || b != 1.0)
     doc_printf(&doc,
-           "{ neg 1 add dup 0 lt { pop 1 } { %.3f exp neg 1 add } "
-           "ifelse %.3f mul } bind settransfer\n", g, b);
+              "{ neg 1 add dup 0 lt { pop 1 } { %.3f exp neg 1 add } "
+              "ifelse %.3f mul } bind settransfer\n", g, b);
 
   write_common(&doc);
   switch (doc.Orientation)
   {
     case 0 :
         write_label_prolog(&doc, cupsGetOption("page-label", num_options,
-                                            options),
-                        doc.PageBottom, doc.PageTop, doc.PageWidth);
+                                              options),
+                          doc.PageBottom, doc.PageTop, doc.PageWidth);
         break;
 
     case 1 :
         write_label_prolog(&doc, cupsGetOption("page-label", num_options,
-                                            options),
-                        doc.PageLeft, doc.PageRight, doc.PageLength);
+                                              options),
+                          doc.PageLeft, doc.PageRight, doc.PageLength);
         break;
 
     case 2 :
         write_label_prolog(&doc, cupsGetOption("page-label", num_options,
-                                            options),
-                        doc.PageLength - doc.PageTop,
-                        doc.PageLength - doc.PageBottom,
-                        doc.PageWidth);
+                                              options),
+                          doc.PageLength - doc.PageTop,
+                          doc.PageLength - doc.PageBottom,
+                          doc.PageWidth);
         break;
 
     case 3 :
        write_label_prolog(&doc, cupsGetOption("page-label", num_options,
-                                            options),
-                        doc.PageWidth - doc.PageRight,
-                        doc.PageWidth - doc.PageLeft,
-                        doc.PageLength);
+                                              options),
+                          doc.PageWidth - doc.PageRight,
+                          doc.PageWidth - doc.PageLeft,
+                          doc.PageLength);
         break;
   }
 
@@ -1531,9 +1557,9 @@ ppdFilterImageToPS(int inputfd,            /* I - File descriptor input stream *
 
   doc_puts(&doc, "%%EndProlog\n");
 
- /*
-  * Output the pages...
-  */
+  //
+  // Output the pages...
+  //
 
   row = malloc(cfImageGetWidth(img) * abs(colorspace) + 3);
   if (row == NULL)
@@ -1706,17 +1732,17 @@ ppdFilterImageToPS(int inputfd,            /* I - File descriptor input stream *
 
        switch (doc.Orientation)
        {
-         case 1 : /* Landscape */
+         case 1 : // Landscape
              doc_printf(&doc, "%.0f 0 translate 90 rotate\n",
-                     doc.PageWidth);
+                        doc.PageWidth);
               break;
-         case 2 : /* Reverse Portrait */
+         case 2 : // Reverse Portrait
              doc_printf(&doc, "%.0f %.0f translate 180 rotate\n",
-                     doc.PageWidth, doc.PageLength);
+                        doc.PageWidth, doc.PageLength);
              break;
-         case 3 : /* Reverse Landscape */
+         case 3 : // Reverse Landscape
              doc_printf(&doc, "0 %.0f translate -90 rotate\n",
-                     doc.PageLength);
+                        doc.PageLength);
               break;
        }
 
@@ -1730,15 +1756,15 @@ ppdFilterImageToPS(int inputfd,            /* I - File descriptor input stream *
         doc_printf(&doc, "%.1f %.1f translate\n", left, top);
 
        doc_printf(&doc, "%.3f %.3f scale\n\n",
-               xprint * 72.0 / (xc1 - xc0 + 1),
-               yprint * 72.0 / (yc1 - yc0 + 1));
+                  xprint * 72.0 / (xc1 - xc0 + 1),
+                  yprint * 72.0 / (yc1 - yc0 + 1));
 
        if (doc.LanguageLevel == 1)
        {
          doc_printf(&doc, "/picture %d string def\n",
-                 (xc1 - xc0 + 1) * abs(colorspace));
+                    (xc1 - xc0 + 1) * abs(colorspace));
          doc_printf(&doc, "%d %d 8[1 0 0 -1 0 1]",
-                 (xc1 - xc0 + 1), (yc1 - yc0 + 1));
+                    (xc1 - xc0 + 1), (yc1 - yc0 + 1));
 
           if (colorspace == CF_IMAGE_WHITE)
             doc_puts(&doc, "{currentfile picture readhexstring pop} image\n");
@@ -1771,12 +1797,12 @@ ppdFilterImageToPS(int inputfd,            /* I - File descriptor input stream *
           }
 
           doc_printf(&doc,
-                 "<<"
-                 "/ImageType 1"
-                 "/Width %d"
-                 "/Height %d"
-                 "/BitsPerComponent 8",
-                 xc1 - xc0 + 1, yc1 - yc0 + 1);
+                    "<<"
+                    "/ImageType 1"
+                    "/Width %d"
+                    "/Height %d"
+                    "/BitsPerComponent 8",
+                    xc1 - xc0 + 1, yc1 - yc0 + 1);
 
           switch (colorspace)
          {
@@ -1822,10 +1848,10 @@ ppdFilterImageToPS(int inputfd,            /* I - File descriptor input stream *
   doc_puts(&doc, "%%EOF\n");
 
   free(row);
-  
- /*
-  * End the job with the appropriate JCL command or CTRL-D otherwise.
-  */
+
+  //
+  // End the job with the appropriate JCL command or CTRL-D otherwise.
+  //
 
   if (emit_jcl)
   {
@@ -1838,9 +1864,9 @@ ppdFilterImageToPS(int inputfd,            /* I - File descriptor input stream *
   if (log) log(ld, CF_LOGLEVEL_DEBUG,
               "ppdFilterImageToPS: Printing completed.", page);
 
- /*
-  * Close files...
-  */
+  //
+  // Close files...
+  //
 
   cfImageClose(img);
   fclose(doc.outputfp);
@@ -1850,16 +1876,16 @@ ppdFilterImageToPS(int inputfd,            /* I - File descriptor input stream *
 }
 
 
-/*
- * 'add_page()' - Add a page to the pages array.
- */
+//
+// 'add_page()' - Add a page to the pages array.
+//
 
-static pstops_page_t *                 /* O - New page info object */
-add_page(pstops_doc_t *doc,            /* I - Document information */
-         const char   *label)          /* I - Page label */
+static pstops_page_t *                 // O - New page info object
+add_page(pstops_doc_t *doc,            // I - Document information
+         const char   *label)          // I - Page label
 {
-  pstops_page_t        *pageinfo;              /* New page info object */
-  cf_logfunc_t log = doc->logfunc;
+  pstops_page_t        *pageinfo;              // New page info object
+  cf_logfunc_t  log = doc->logfunc;
   void          *ld = doc->logdata;
 
 
@@ -1891,25 +1917,26 @@ add_page(pstops_doc_t *doc,             /* I - Document information */
 }
 
 
-/*
- * 'check_range()' - Check to see if the current page is selected for
- *                   printing.
- */
+//
+// 'check_range()' - Check to see if the current page is selected for
+//                   printing.
+//
 
-static int                             /* O - 1 if selected, 0 otherwise */
-check_range(int          page,         /* I - Page number */
-            const char *Ranges,    /* I - page_ranges or inputPageRange */     
-            const char *pageset ) /* I - Only provided with page_ranges else NULL */  
+static int                             // O - 1 if selected, 0 otherwise
+check_range(int        page,           // I - Page number
+            const char *Ranges,                // I - page_ranges or inputPageRange
+            const char *pageset )      // I - Only provided with page_ranges
+                                       //     else NULL
 {
-  const char   *range;                 /* Pointer into range string */
-  int          lower, upper;           /* Lower and upper page numbers */
+  const char   *range;                 // Pointer into range string
+  int          lower, upper;           // Lower and upper page numbers
 
 
   if (pageset)
   {
-   /*
-    * See if we only print even or odd pages...
-    */
+    //
+    // See if we only print even or odd pages...
+    //
 
     if (!strcasecmp(pageset, "even") && (page & 1))
       return (0);
@@ -1919,7 +1946,7 @@ check_range(int          page,            /* I - Page number */
   }
 
   if (!Ranges)
-    return (1);                                /* No range, print all pages... */
+    return (1);                                // No range, print all pages...
 
   for (range = Ranges; *range != '\0';)
   {
@@ -1958,18 +1985,18 @@ check_range(int          page,          /* I - Page number */
 }
 
 
-/*
- * 'copy_bytes()' - Copy bytes from the temporary file to the output file.
- */
+//
+// 'copy_bytes()' - Copy bytes from the temporary file to the output file.
+//
 
 static void
-copy_bytes(pstops_doc_t *doc,          /* I - Document info */
-           off_t       offset,         /* I - Offset to page data */
-           size_t      length)         /* I - Length of page data */
+copy_bytes(pstops_doc_t *doc,          // I - Document info
+           off_t       offset,         // I - Offset to page data
+           size_t      length)         // I - Length of page data
 {
-  char         buffer[8192];           /* Data buffer */
-  ssize_t      nbytes;                 /* Number of bytes read */
-  size_t       nleft;                  /* Number of bytes left/remaining */
+  char         buffer[8192];           // Data buffer
+  ssize_t      nbytes;                 // Number of bytes read
+  size_t       nleft;                  // Number of bytes left/remaining
   cf_logfunc_t log = doc->logfunc;
   void          *ld = doc->logdata;
 
@@ -2000,31 +2027,31 @@ copy_bytes(pstops_doc_t *doc,           /* I - Document info */
 }
 
 
-/*
- * 'copy_comments()' - Copy all of the comments section.
- *
- * This function expects "line" to be filled with a comment line.
- * On return, "line" will contain the next line in the file, if any.
- */
+//
+// 'copy_comments()' - Copy all of the comments section.
+//
+// This function expects "line" to be filled with a comment line.
+// On return, "line" will contain the next line in the file, if any.
+//
 
-static ssize_t                         /* O - Length of next line */
-copy_comments(pstops_doc_t *doc,       /* I - Document info */
-             ppd_file_t   *ppd,        /* I - PPD file */
-              char         *line,      /* I - Line buffer */
-             ssize_t      linelen,     /* I - Length of initial line */
-             size_t       linesize)    /* I - Size of line buffer */
+static ssize_t                         // O - Length of next line
+copy_comments(pstops_doc_t *doc,       // I - Document info
+             ppd_file_t   *ppd,        // I - PPD file
+              char         *line,      // I - Line buffer
+             ssize_t      linelen,     // I - Length of initial line
+             size_t       linesize)    // I - Size of line buffer
 {
-  int  saw_bounding_box,               /* Saw %%BoundingBox: comment? */
-       saw_for,                        /* Saw %%For: comment? */
-       saw_pages,                      /* Saw %%Pages: comment? */
-       saw_title;                      /* Saw %%Title: comment? */
+  int  saw_bounding_box,               // Saw %%BoundingBox: comment?
+       saw_for,                        // Saw %%For: comment?
+       saw_pages,                      // Saw %%Pages: comment?
+       saw_title;                      // Saw %%Title: comment?
   cf_logfunc_t log = doc->logfunc;
-  void          *ld = doc->logdata;
+  void         *ld = doc->logdata;
 
 
- /*
-  * Loop until we see %%EndComments or a non-comment line...
-  */
+  //
+  // Loop until we see %%EndComments or a non-comment line...
+  //
 
   saw_bounding_box = 0;
   saw_for          = 0;
@@ -2033,9 +2060,9 @@ copy_comments(pstops_doc_t *doc,  /* I - Document info */
 
   while (line[0] == '%')
   {
-   /*
-    * Strip trailing whitespace...
-    */
+    //
+    // Strip trailing whitespace...
+    //
 
     while (linelen > 0)
     {
@@ -2047,20 +2074,20 @@ copy_comments(pstops_doc_t *doc,        /* I - Document info */
         line[linelen] = '\0';
     }
 
-   /*
-    * Log the header...
-    */
+    //
+    // Log the header...
+    //
 
     if (log) log(ld, CF_LOGLEVEL_DEBUG,
                 "ppdFilterPSToPS: %s", line);
 
-   /*
-    * Pull the headers out...
-    */
+    //
+    // Pull the headers out...
+    //
 
     if (!strncmp(line, "%%Pages:", 8))
     {
-      int      pages;                  /* Number of pages */
+      int      pages;                  // Number of pages
 
       if (saw_pages && log)
        log(ld, CF_LOGLEVEL_DEBUG,
@@ -2071,9 +2098,9 @@ copy_comments(pstops_doc_t *doc,  /* I - Document info */
       if (doc->Duplex &&
          (pages = atoi(line + 8)) > 0 && pages <= doc->number_up)
       {
-       /*
-        * Since we will only be printing on a single page, disable duplexing.
-       */
+       //
+        // Since we will only be printing on a single page, disable duplexing.
+       //
 
        doc->Duplex      = 0;
        doc->slow_duplex = 0;
@@ -2123,9 +2150,9 @@ copy_comments(pstops_doc_t *doc,  /* I - Document info */
       }
       else if (strstr(line + 14, "(atend)"))
       {
-       /*
-        * Do nothing for now but use the default imageable area...
-       */
+       //
+       // Do nothing for now but use the default imageable area...
+       //
       }
       else if (sscanf(line + 14, "%d%d%d%d", doc->bounding_box + 0,
                      doc->bounding_box + 1, doc->bounding_box + 2,
@@ -2154,23 +2181,23 @@ copy_comments(pstops_doc_t *doc,        /* I - Document info */
     }
     else if (!strncmp(line, "%cupsRotation:", 14))
     {
-     /*
-      * Reset orientation of document?
-      */
+      //
+      // Reset orientation of document?
+      //
 
       int orient = (atoi(line + 14) / 90) & 3;
 
       if (orient != doc->Orientation)
       {
-       /*
-        * Yes, update things so that the pages come out right...
-       */
+       //
+        // Yes, update things so that the pages come out right...
+       //
 
        doc->Orientation = (4 - doc->Orientation + orient) & 3;
        ppdFilterUpdatePageVars(doc->Orientation,
-                            &doc->PageLeft, &doc->PageRight,
-                            &doc->PageTop, &doc->PageBottom,
-                            &doc->PageWidth, &doc->PageLength);
+                               &doc->PageLeft, &doc->PageRight,
+                               &doc->PageTop, &doc->PageBottom,
+                               &doc->PageWidth, &doc->PageLength);
        doc->Orientation = orient;
       }
     }
@@ -2202,33 +2229,33 @@ copy_comments(pstops_doc_t *doc,        /* I - Document info */
 
   if (doc->copies != 1 && (!doc->collate || !doc->slow_collate))
   {
-   /*
-    * Tell the document processor the copy and duplex options
-    * that are required...
-    */
+    //
+    // Tell the document processor the copy and duplex options
+    // that are required...
+    //
 
     doc_printf(doc, "%%%%Requirements: numcopies(%d)%s%s\n", doc->copies,
                doc->collate ? " collate" : "",
               doc->Duplex ? " duplex" : "");
 
-   /*
-    * Apple uses RBI comments for various non-PPD options...
-    */
+    //
+    // Apple uses RBI comments for various non-PPD options...
+    //
 
     doc_printf(doc, "%%RBINumCopies: %d\n", doc->copies);
   }
   else
   {
-   /*
-    * Tell the document processor the duplex option that is required...
-    */
+    //
+    // Tell the document processor the duplex option that is required...
+    //
 
     if (doc->Duplex)
       doc_puts(doc, "%%Requirements: duplex\n");
 
-   /*
-    * Apple uses RBI comments for various non-PPD options...
-    */
+    //
+    // Apple uses RBI comments for various non-PPD options...
+    //
 
     doc_puts(doc, "%RBINumCopies: 1\n");
   }
@@ -2241,30 +2268,30 @@ copy_comments(pstops_doc_t *doc,        /* I - Document info */
 }
 
 
-/*
- * 'copy_dsc()' - Copy a DSC-conforming document.
- *
- * This function expects "line" to be filled with the %!PS-Adobe comment line.
- */
+//
+// 'copy_dsc()' - Copy a DSC-conforming document.
+//
+// This function expects "line" to be filled with the %!PS-Adobe comment line.
+//
 
 static void
-copy_dsc(pstops_doc_t *doc,            /* I - Document info */
-         ppd_file_t   *ppd,            /* I - PPD file */
-        char         *line,            /* I - Line buffer */
-        ssize_t      linelen,          /* I - Length of initial line */
-        size_t       linesize)         /* I - Size of line buffer */
+copy_dsc(pstops_doc_t *doc,            // I - Document info
+         ppd_file_t   *ppd,            // I - PPD file
+        char         *line,            // I - Line buffer
+        ssize_t      linelen,          // I - Length of initial line
+        size_t       linesize)         // I - Size of line buffer
 {
-  int          number;                 /* Page number */
-  pstops_page_t        *pageinfo;              /* Page information */
-  cf_logfunc_t log = doc->logfunc;
+  int          number;                 // Page number
+  pstops_page_t        *pageinfo;              // Page information
+  cf_logfunc_t  log = doc->logfunc;
   void          *ld = doc->logdata;
   cf_filter_iscanceledfunc_t iscanceled = doc->iscanceledfunc;
   void          *icd = doc->iscanceleddata;
 
 
- /*
-  * Make sure we use ESPshowpage for EPS files...
-  */
+  //
+  // Make sure we use ESPshowpage for EPS files...
+  //
 
   if (strstr(line, "EPSF"))
   {
@@ -2272,33 +2299,33 @@ copy_dsc(pstops_doc_t *doc,             /* I - Document info */
     doc->number_up       = 1;
   }
 
- /*
-  * Start sending the document with any commands needed...
-  */
+  //
+  // Start sending the document with any commands needed...
+  //
 
   if (log) log(ld, CF_LOGLEVEL_DEBUG,
               "ppdFilterPSToPS: Before copy_comments - %s", line);
   linelen = copy_comments(doc, ppd, line, linelen, linesize);
 
- /*
-  * Now find the prolog section, if any...
-  */
+  //
+  // Now find the prolog section, if any...
+  //
 
   if (log) log(ld, CF_LOGLEVEL_DEBUG,
               "ppdFilterPSToPS: Before copy_prolog - %s", line);
   linelen = copy_prolog(doc, ppd, line, linelen, linesize);
 
- /*
-  * Then the document setup section...
-  */
+  //
+  // Then the document setup section...
+  //
 
   if (log) log(ld, CF_LOGLEVEL_DEBUG,
               "ppdFilterPSToPS: Before copy_setup - %s", line);
   linelen = copy_setup(doc, ppd, line, linelen, linesize);
 
- /*
-  * Copy until we see %%Page:...
-  */
+  //
+  // Copy until we see %%Page:...
+  //
 
   while (strncmp(line, "%%Page:", 7) && strncmp(line, "%%Trailer", 9))
   {
@@ -2308,9 +2335,9 @@ copy_dsc(pstops_doc_t *doc,               /* I - Document info */
       break;
   }
 
- /*
-  * Then process pages until we have no more...
-  */
+  //
+  // Then process pages until we have no more...
+  //
 
   number = 0;
 
@@ -2327,7 +2354,8 @@ copy_dsc(pstops_doc_t *doc,               /* I - Document info */
 
     number ++;
 
-    if (check_range((number - 1) / doc->number_up + 1,doc->page_ranges,doc->page_set))
+    if (check_range((number - 1) / doc->number_up + 1,
+                   doc->page_ranges, doc->page_set))
     {
       if (log) log(ld, CF_LOGLEVEL_DEBUG,
                   "ppdFilterPSToPS: Copying page %d...", number);
@@ -2341,12 +2369,13 @@ copy_dsc(pstops_doc_t *doc,             /* I - Document info */
     }
   }
 
- /*
-  * Finish up the last page(s)...
-  */
+  //
+  // Finish up the last page(s)...
+  //
 
   if (number && is_not_last_page(number) && cupsArrayLast(doc->pages) &&
-      check_range((number - 1) / doc->number_up + 1,doc->page_ranges,doc->page_set))
+      check_range((number - 1) / doc->number_up + 1, doc->page_ranges,
+                 doc->page_set))
   {
     pageinfo = (pstops_page_t *)cupsArrayLast(doc->pages);
 
@@ -2359,9 +2388,9 @@ copy_dsc(pstops_doc_t *doc,               /* I - Document info */
 
   if (doc->slow_duplex && (doc->page & 1))
   {
-   /*
-    * Make sure we have an even number of pages...
-    */
+    //
+    // Make sure we have an even number of pages...
+    //
 
     pageinfo = add_page(doc, "(filler)");
     if (pageinfo == NULL)
@@ -2384,29 +2413,29 @@ copy_dsc(pstops_doc_t *doc,             /* I - Document info */
     pageinfo->length = (ssize_t)(cupsFileTell(doc->temp) - pageinfo->offset);
   }
 
- /*
-  * Make additional copies as necessary...
-  */
+  //
+  // Make additional copies as necessary...
+  //
 
   number = doc->slow_order ? 0 : doc->page;
 
   if (doc->temp && (!iscanceled || !iscanceled(icd)) &&
       cupsArrayCount(doc->pages) > 0)
   {
-    int        copy;                           /* Current copy */
+    int        copy;                           // Current copy
 
 
-   /*
-    * Reopen the temporary file for reading...
-    */
+    //
+    // Reopen the temporary file for reading...
+    //
 
     cupsFileClose(doc->temp);
 
     doc->temp = cupsFileOpen(doc->tempfile, "r");
 
-   /*
-    * Make the copies...
-    */
+    //
+    // Make the copies...
+    //
 
     if (doc->slow_collate)
       copy = !doc->slow_order;
@@ -2422,31 +2451,32 @@ copy_dsc(pstops_doc_t *doc,             /* I - Document info */
        break;
       }
 
-     /*
-      * Send end-of-job stuff followed by any start-of-job stuff required
-      * for the JCL options...
-      */
+      //
+      // Send end-of-job stuff followed by any start-of-job stuff required
+      // for the JCL options...
+      //
 
       if (number && doc->emit_jcl && ppd && ppd->jcl_end)
       {
-       /*
-        * Send the trailer...
-       */
+       //
+        // Send the trailer...
+       //
 
         doc_puts(doc, "%%Trailer\n");
        doc_printf(doc, "%%%%Pages: %d\n", cupsArrayCount(doc->pages));
        if (doc->number_up > 1 || doc->fit_to_page)
          doc_printf(doc, "%%%%BoundingBox: %.0f %.0f %.0f %.0f\n",
-                doc->PageLeft, doc->PageBottom, doc->PageRight, doc->PageTop);
+                    doc->PageLeft, doc->PageBottom,
+                    doc->PageRight, doc->PageTop);
        else
          doc_printf(doc, "%%%%BoundingBox: %d %d %d %d\n",
-                doc->new_bounding_box[0], doc->new_bounding_box[1],
-                doc->new_bounding_box[2], doc->new_bounding_box[3]);
+                    doc->new_bounding_box[0], doc->new_bounding_box[1],
+                    doc->new_bounding_box[2], doc->new_bounding_box[3]);
         doc_puts(doc, "%%EOF\n");
 
-       /*
-        * Start a new document...
-       */
+       //
+       // Start a new document...
+       //
 
         ppdEmitJCLEnd(ppd, doc->outputfp);
         ppdEmitJCL(ppd, doc->outputfp, doc->job_id, doc->user, doc->title);
@@ -2456,9 +2486,9 @@ copy_dsc(pstops_doc_t *doc,               /* I - Document info */
        number = 0;
       }
 
-     /*
-      * Copy the prolog as needed...
-      */
+      //
+      // Copy the prolog as needed...
+      //
 
       if (!number)
       {
@@ -2466,9 +2496,9 @@ copy_dsc(pstops_doc_t *doc,               /* I - Document info */
        copy_bytes(doc, 0, (size_t)pageinfo->offset);
       }
 
-     /*
-      * Then copy all of the pages...
-      */
+      //
+      // Then copy all of the pages...
+      //
 
       pageinfo = doc->slow_order ? (pstops_page_t *)cupsArrayLast(doc->pages) :
                                    (pstops_page_t *)cupsArrayFirst(doc->pages);
@@ -2494,14 +2524,15 @@ copy_dsc(pstops_doc_t *doc,             /* I - Document info */
        {
          doc_printf(doc, "%%%%Page: (%d) %d\n", number, number);
          doc_printf(doc, "%%%%PageBoundingBox: %.0f %.0f %.0f %.0f\n",
-                doc->PageLeft, doc->PageBottom, doc->PageRight, doc->PageTop);
+                    doc->PageLeft, doc->PageBottom,
+                    doc->PageRight, doc->PageTop);
        }
        else
        {
           doc_printf(doc, "%%%%Page: %s %d\n", pageinfo->label, number);
          doc_printf(doc, "%%%%PageBoundingBox: %d %d %d %d\n",
-                 pageinfo->bounding_box[0], pageinfo->bounding_box[1],
-                 pageinfo->bounding_box[2], pageinfo->bounding_box[3]);
+                    pageinfo->bounding_box[0], pageinfo->bounding_box[1],
+                    pageinfo->bounding_box[2], pageinfo->bounding_box[3]);
        }
 
        copy_bytes(doc, pageinfo->offset, (size_t)pageinfo->length);
@@ -2513,39 +2544,39 @@ copy_dsc(pstops_doc_t *doc,             /* I - Document info */
     }
   }
 
- /*
-  * Restore the old showpage operator as needed...
-  */
+  //
+  // Restore the old showpage operator as needed...
+  //
 
   if (doc->use_ESPshowpage)
     doc_puts(doc, "userdict/showpage/ESPshowpage load put\n");
 
- /*
-  * Write/copy the trailer...
-  */
+  //
+  // Write/copy the trailer...
+  //
 
   if (!iscanceled || !iscanceled(icd))
     copy_trailer(doc, ppd, number, line, linelen, linesize);
 }
 
 
-/*
- * 'copy_non_dsc()' - Copy a document that does not conform to the DSC.
- *
- * This function expects "line" to be filled with the %! comment line.
- */
+//
+// 'copy_non_dsc()' - Copy a document that does not conform to the DSC.
+//
+// This function expects "line" to be filled with the %! comment line.
+//
 
 static void
-copy_non_dsc(pstops_doc_t *doc,                /* I - Document info */
-             ppd_file_t   *ppd,                /* I - PPD file */
-            char         *line,        /* I - Line buffer */
-            ssize_t      linelen,      /* I - Length of initial line */
-            size_t       linesize)     /* I - Size of line buffer */
+copy_non_dsc(pstops_doc_t *doc,                // I - Document info
+             ppd_file_t   *ppd,                // I - PPD file
+            char         *line,        // I - Line buffer
+            ssize_t      linelen,      // I - Length of initial line
+            size_t       linesize)     // I - Size of line buffer
 {
-  int          copy;                   /* Current copy */
-  char         buffer[8192];           /* Copy buffer */
-  ssize_t      bytes;                  /* Number of bytes copied */
-  cf_logfunc_t log = doc->logfunc;
+  int          copy;                   // Current copy
+  char         buffer[8192];           // Copy buffer
+  ssize_t      bytes;                  // Number of bytes copied
+  cf_logfunc_t  log = doc->logfunc;
   void          *ld = doc->logdata;
   cf_filter_iscanceledfunc_t iscanceled = doc->iscanceledfunc;
   void          *icd = doc->iscanceleddata;
@@ -2553,21 +2584,21 @@ copy_non_dsc(pstops_doc_t *doc,         /* I - Document info */
 
   (void)linesize;
 
- /*
-  * First let the user know that they are attempting to print a file
-  * that may not print correctly...
-  */
+  //
+  // First let the user know that they are attempting to print a file
+  // that may not print correctly...
+  //
 
   if (log) log(ld, CF_LOGLEVEL_DEBUG,
               "ppdFilterPSToPS: This document does not conform to the Adobe Document "
               "Structuring Conventions and may not print correctly.");
 
- /*
-  * Then write a standard DSC comment section...
-  */
+  //
+  // Then write a standard DSC comment section...
+  //
 
   doc_printf(doc, "%%%%BoundingBox: %.0f %.0f %.0f %.0f\n",
-         doc->PageLeft, doc->PageBottom, doc->PageRight, doc->PageTop);
+            doc->PageLeft, doc->PageBottom, doc->PageRight, doc->PageTop);
 
   if (doc->slow_collate && doc->copies > 1)
     doc_printf(doc, "%%%%Pages: %d\n", doc->copies);
@@ -2579,42 +2610,42 @@ copy_non_dsc(pstops_doc_t *doc,         /* I - Document info */
 
   if (doc->copies != 1 && (!doc->collate || !doc->slow_collate))
   {
-   /*
-    * Tell the document processor the copy and duplex options
-    * that are required...
-    */
+    //
+    // Tell the document processor the copy and duplex options
+    // that are required...
+    //
 
     doc_printf(doc, "%%%%Requirements: numcopies(%d)%s%s\n", doc->copies,
-           doc->collate ? " collate" : "",
-           doc->Duplex ? " duplex" : "");
+              doc->collate ? " collate" : "",
+              doc->Duplex ? " duplex" : "");
 
-   /*
-    * Apple uses RBI comments for various non-PPD options...
-    */
+    //
+    // Apple uses RBI comments for various non-PPD options...
+    //
 
     doc_printf(doc, "%%RBINumCopies: %d\n", doc->copies);
   }
   else
   {
-   /*
-    * Tell the document processor the duplex option that is required...
-    */
+    //
+    // Tell the document processor the duplex option that is required...
+    //
 
     if (doc->Duplex)
       doc_puts(doc, "%%Requirements: duplex\n");
 
-   /*
-    * Apple uses RBI comments for various non-PPD options...
-    */
+    //
+    // Apple uses RBI comments for various non-PPD options...
+    //
 
     doc_puts(doc, "%RBINumCopies: 1\n");
   }
 
   doc_puts(doc, "%%EndComments\n");
 
- /*
-  * Then the prolog...
-  */
+  //
+  // Then the prolog...
+  //
 
   doc_puts(doc, "%%BeginProlog\n");
 
@@ -2622,9 +2653,9 @@ copy_non_dsc(pstops_doc_t *doc,           /* I - Document info */
 
   doc_puts(doc, "%%EndProlog\n");
 
- /*
-  * Then the setup section...
-  */
+  //
+  // Then the setup section...
+  //
 
   doc_puts(doc, "%%BeginSetup\n");
 
@@ -2632,9 +2663,9 @@ copy_non_dsc(pstops_doc_t *doc,           /* I - Document info */
 
   doc_puts(doc, "%%EndSetup\n");
 
- /*
-  * Finally, embed a copy of the file inside a %%Page...
-  */
+  //
+  // Finally, embed a copy of the file inside a %%Page...
+  //
 
   if ((!ppd || !ppd->num_filters) && log)
     log(ld, CF_LOGLEVEL_CONTROL,
@@ -2669,17 +2700,17 @@ copy_non_dsc(pstops_doc_t *doc,         /* I - Document info */
 
   if (doc->temp && (!iscanceled || !iscanceled(icd)))
   {
-   /*
-    * Reopen the temporary file for reading...
-    */
+    //
+    // Reopen the temporary file for reading...
+    //
 
     cupsFileClose(doc->temp);
 
     doc->temp = cupsFileOpen(doc->tempfile, "r");
 
-   /*
-    * Make the additional copies as needed...
-    */
+    //
+    // Make the additional copies as needed...
+    //
 
     for (copy = 1; copy < doc->copies; copy ++)
     {
@@ -2712,45 +2743,45 @@ copy_non_dsc(pstops_doc_t *doc,         /* I - Document info */
     }
   }
 
- /*
-  * Restore the old showpage operator as needed...
-  */
+  //
+  // Restore the old showpage operator as needed...
+  //
 
   if (doc->use_ESPshowpage)
     doc_puts(doc, "userdict/showpage/ESPshowpage load put\n");
 }
 
 
-/*
- * 'copy_page()' - Copy a page description.
- *
- * This function expects "line" to be filled with a %%Page comment line.
- * On return, "line" will contain the next line in the file, if any.
- */
-
-static ssize_t                         /* O - Length of next line */
-copy_page(pstops_doc_t *doc,           /* I - Document info */
-          ppd_file_t   *ppd,           /* I - PPD file */
-         int          number,          /* I - Current page number */
-         char         *line,           /* I - Line buffer */
-         ssize_t      linelen,         /* I - Length of initial line */
-         size_t       linesize)        /* I - Size of line buffer */
+//
+// 'copy_page()' - Copy a page description.
+//
+// This function expects "line" to be filled with a %%Page comment line.
+// On return, "line" will contain the next line in the file, if any.
+//
+
+static ssize_t                         // O - Length of next line
+copy_page(pstops_doc_t *doc,           // I - Document info
+          ppd_file_t   *ppd,           // I - PPD file
+         int          number,          // I - Current page number
+         char         *line,           // I - Line buffer
+         ssize_t      linelen,         // I - Length of initial line
+         size_t       linesize)        // I - Size of line buffer
 {
-  char         label[256],             /* Page label string */
-               *ptr;                   /* Pointer into line */
-  int          level;                  /* Embedded document level */
-  pstops_page_t        *pageinfo;              /* Page information */
-  int          first_page;             /* First page on N-up output? */
-  int          has_page_setup = 0;     /* Does the page have
-                                          %%Begin/EndPageSetup? */
-  int          bounding_box[4];        /* PageBoundingBox */
-  cf_logfunc_t log = doc->logfunc;
+  char         label[256],             // Page label string
+               *ptr;                   // Pointer into line
+  int          level;                  // Embedded document level
+  pstops_page_t        *pageinfo;              // Page information
+  int          first_page;             // First page on N-up output?
+  int          has_page_setup = 0;     // Does the page have
+                                       // %%Begin/EndPageSetup?
+  int          bounding_box[4];        // PageBoundingBox
+  cf_logfunc_t  log = doc->logfunc;
   void          *ld = doc->logdata;
 
 
- /*
-  * Get the page label for this page...
-  */
+  //
+  // Get the page label for this page...
+  //
 
   first_page = is_first_page(number);
 
@@ -2768,9 +2799,9 @@ copy_page(pstops_doc_t *doc,              /* I - Document info */
     number = doc->page;
   }
 
- /*
-  * Create or update the current output page...
-  */
+  //
+  // Create or update the current output page...
+  //
 
   if (first_page)
   {
@@ -2781,25 +2812,25 @@ copy_page(pstops_doc_t *doc,            /* I - Document info */
   else
     pageinfo = (pstops_page_t *)cupsArrayLast(doc->pages);
 
- /*
-  * Handle first page override...
-  */
+  //
+  // Handle first page override...
+  //
 
   if (doc->ap_input_slot || doc->ap_manual_feed)
   {
     if ((doc->page == 1 && (!doc->slow_order || !doc->Duplex)) ||
         (doc->page == 2 && doc->slow_order && doc->Duplex))
     {
-     /*
-      * First page/sheet gets AP_FIRSTPAGE_* options...
-      */
+      //
+      // First page/sheet gets AP_FIRSTPAGE_* options...
+      //
 
       pageinfo->num_options = cupsAddOption("InputSlot", doc->ap_input_slot,
                                             pageinfo->num_options,
                                            &(pageinfo->options));
       pageinfo->num_options = cupsAddOption("ManualFeed",
                                             doc->ap_input_slot ? "False" :
-                                               doc->ap_manual_feed,
+                                           doc->ap_manual_feed,
                                             pageinfo->num_options,
                                            &(pageinfo->options));
       pageinfo->num_options = cupsAddOption("MediaColor", doc->ap_media_color,
@@ -2817,16 +2848,16 @@ copy_page(pstops_doc_t *doc,            /* I - Document info */
     }
     else if (doc->page == (doc->Duplex + 2))
     {
-     /*
-      * Second page/sheet gets default options...
-      */
+      //
+      // Second page/sheet gets default options...
+      //
 
       pageinfo->num_options = cupsAddOption("InputSlot", doc->input_slot,
                                             pageinfo->num_options,
                                            &(pageinfo->options));
       pageinfo->num_options = cupsAddOption("ManualFeed",
                                             doc->input_slot ? "False" :
-                                               doc->manual_feed,
+                                           doc->manual_feed,
                                             pageinfo->num_options,
                                            &(pageinfo->options));
       pageinfo->num_options = cupsAddOption("MediaColor", doc->media_color,
@@ -2844,10 +2875,10 @@ copy_page(pstops_doc_t *doc,            /* I - Document info */
     }
   }
 
- /*
-  * Scan comments until we see something other than %%Page*: or
-  * %%Include*...
-  */
+  //
+  // Scan comments until we see something other than %%Page*: or
+  // %%Include*...
+  //
 
   memcpy(bounding_box, doc->bounding_box, sizeof(bounding_box));
 
@@ -2855,9 +2886,9 @@ copy_page(pstops_doc_t *doc,              /* I - Document info */
   {
     if (!strncmp(line, "%%PageBoundingBox:", 18))
     {
-     /*
-      * %%PageBoundingBox: llx lly urx ury
-      */
+      //
+      // %%PageBoundingBox: llx lly urx ury
+      //
 
       if (sscanf(line + 18, "%d%d%d%d", bounding_box + 0,
                  bounding_box + 1, bounding_box + 2,
@@ -2872,7 +2903,7 @@ copy_page(pstops_doc_t *doc,              /* I - Document info */
       }
       else if (doc->number_up == 1 && !doc->fit_to_page && doc->Orientation)
       {
-        int    temp_bbox[4];           /* Temporary bounding box */
+        int    temp_bbox[4];           // Temporary bounding box
 
 
         memcpy(temp_bbox, bounding_box, sizeof(temp_bbox));
@@ -2892,21 +2923,21 @@ copy_page(pstops_doc_t *doc,            /* I - Document info */
 
         switch (doc->Orientation)
        {
-         case 1 : /* Landscape */
+         case 1 : // Landscape
              bounding_box[0] = (int)(doc->PageLength - temp_bbox[3]);
              bounding_box[1] = temp_bbox[0];
              bounding_box[2] = (int)(doc->PageLength - temp_bbox[1]);
              bounding_box[3] = temp_bbox[2];
               break;
 
-         case 2 : /* Reverse Portrait */
+         case 2 : // Reverse Portrait
              bounding_box[0] = (int)(doc->PageWidth - temp_bbox[2]);
              bounding_box[1] = (int)(doc->PageLength - temp_bbox[3]);
              bounding_box[2] = (int)(doc->PageWidth - temp_bbox[0]);
              bounding_box[3] = (int)(doc->PageLength - temp_bbox[1]);
               break;
 
-         case 3 : /* Reverse Landscape */
+         case 3 : // Reverse Landscape
              bounding_box[0] = temp_bbox[1];
              bounding_box[1] = (int)(doc->PageWidth - temp_bbox[2]);
              bounding_box[2] = temp_bbox[3];
@@ -2928,52 +2959,52 @@ copy_page(pstops_doc_t *doc,            /* I - Document info */
             !strncmp(line, "%%PageRequirements:", 18) ||
             !strncmp(line, "%%PageResources:", 16))
     {
-     /*
-      * Copy literal...
-      */
+      //
+      // Copy literal...
+      //
     }
-#endif /* 0 */
+#endif // 0
     else if (!strncmp(line, "%%PageCustomColors:", 19))
     {
-     /*
-      * %%PageCustomColors: ...
-      */
+      //
+      // %%PageCustomColors: ...
+      //
     }
     else if (!strncmp(line, "%%PageMedia:", 12))
     {
-     /*
-      * %%PageMedia: ...
-      */
+      //
+      // %%PageMedia: ...
+      //
     }
     else if (!strncmp(line, "%%PageOrientation:", 18))
     {
-     /*
-      * %%PageOrientation: ...
-      */
+      //
+      // %%PageOrientation: ...
+      //
     }
     else if (!strncmp(line, "%%PageProcessColors:", 20))
     {
-     /*
-      * %%PageProcessColors: ...
-      */
+      //
+      // %%PageProcessColors: ...
+      //
     }
     else if (!strncmp(line, "%%PageRequirements:", 18))
     {
-     /*
-      * %%PageRequirements: ...
-      */
+      //
+      // %%PageRequirements: ...
+      //
     }
     else if (!strncmp(line, "%%PageResources:", 16))
     {
-     /*
-      * %%PageResources: ...
-      */
+      //
+      // %%PageResources: ...
+      //
     }
     else if (!strncmp(line, "%%IncludeFeature:", 17))
     {
-     /*
-      * %%IncludeFeature: *MainKeyword OptionKeyword
-      */
+      //
+      // %%IncludeFeature: *MainKeyword OptionKeyword
+      //
 
       if (doc->number_up == 1 &&!doc->fit_to_page)
        pageinfo->num_options = include_feature(doc, ppd, line,
@@ -2991,9 +3022,9 @@ copy_page(pstops_doc_t *doc,              /* I - Document info */
 
   if (doc->number_up == 1)
   {
-   /*
-    * Update the document's composite and page bounding box...
-    */
+    //
+    // Update the document's composite and page bounding box...
+    //
 
     memcpy(pageinfo->bounding_box, bounding_box,
            sizeof(pageinfo->bounding_box));
@@ -3008,9 +3039,9 @@ copy_page(pstops_doc_t *doc,              /* I - Document info */
       doc->new_bounding_box[3] = bounding_box[3];
   }
 
- /*
-  * Output the page header as needed...
-  */
+  //
+  // Output the page header as needed...
+  //
 
   if (!doc->slow_order && first_page)
   {
@@ -3023,27 +3054,27 @@ copy_page(pstops_doc_t *doc,            /* I - Document info */
     {
       doc_printf(doc, "%%%%Page: (%d) %d\n", doc->page, doc->page);
       doc_printf(doc, "%%%%PageBoundingBox: %.0f %.0f %.0f %.0f\n",
-             doc->PageLeft, doc->PageBottom, doc->PageRight, doc->PageTop);
+                doc->PageLeft, doc->PageBottom, doc->PageRight, doc->PageTop);
     }
     else
     {
       doc_printf(doc, "%%%%Page: %s %d\n", pageinfo->label, doc->page);
       doc_printf(doc, "%%%%PageBoundingBox: %d %d %d %d\n",
-             pageinfo->bounding_box[0], pageinfo->bounding_box[1],
-             pageinfo->bounding_box[2], pageinfo->bounding_box[3]);
+                pageinfo->bounding_box[0], pageinfo->bounding_box[1],
+                pageinfo->bounding_box[2], pageinfo->bounding_box[3]);
     }
   }
 
- /*
-  * Copy any page setup commands...
-  */
+  //
+  // Copy any page setup commands...
+  //
 
   if (first_page)
     doc_puts(doc, "%%BeginPageSetup\n");
 
   if (has_page_setup)
   {
-    int        feature = 0;                    /* In a Begin/EndFeature block? */
+    int        feature = 0;                    // In a Begin/EndFeature block?
 
     while ((linelen = (ssize_t)cupsFileGetLine(doc->inputfp, line, linesize)) >
           0)
@@ -3081,9 +3112,9 @@ copy_page(pstops_doc_t *doc,              /* I - Document info */
        doc_write(doc, line, (size_t)linelen);
     }
 
-   /*
-    * Skip %%EndPageSetup...
-    */
+    //
+    // Skip %%EndPageSetup...
+    //
 
     if (linelen > 0 && !strncmp(line, "%%EndPageSetup", 14))
       linelen = (ssize_t)cupsFileGetLine(doc->inputfp, line, linesize);
@@ -3091,15 +3122,15 @@ copy_page(pstops_doc_t *doc,            /* I - Document info */
 
   if (first_page)
   {
-    char       *page_setup;            /* PageSetup commands to send */
+    char       *page_setup;            // PageSetup commands to send
 
 
     if (pageinfo->num_options > 0)
       write_options(doc, ppd, pageinfo->num_options, pageinfo->options);
 
-   /*
-    * Output commands for the current page...
-    */
+    //
+    // Output commands for the current page...
+    //
 
     page_setup = ppdEmitString(ppd, PPD_ORDER_PAGE, 0);
 
@@ -3110,18 +3141,18 @@ copy_page(pstops_doc_t *doc,            /* I - Document info */
     }
   }
 
- /*
-  * Prep for the start of the page description...
-  */
+  //
+  // Prep for the start of the page description...
+  //
 
   start_nup(doc, number, 1, bounding_box);
 
   if (first_page)
     doc_puts(doc, "%%EndPageSetup\n");
 
- /*
-  * Read the rest of the page description...
-  */
+  //
+  // Read the rest of the page description...
+  //
 
   level = 0;
 
@@ -3150,11 +3181,11 @@ copy_page(pstops_doc_t *doc,            /* I - Document info */
              (!strncmp(line, "%%BeginData:", 12) &&
              !strstr(line, "ASCII") && !strstr(line, "Hex")))
     {
-     /*
-      * Copy binary data...
-      */
+      //
+      // Copy binary data...
+      //
 
-      int      bytes;                  /* Bytes of data */
+      int      bytes;                  // Bytes of data
 
 
       doc_write(doc, line, (size_t)linelen);
@@ -3189,9 +3220,9 @@ copy_page(pstops_doc_t *doc,              /* I - Document info */
   while ((linelen = (ssize_t)cupsFileGetLine(doc->inputfp, line, linesize)) >
         0);
 
- /*
-  * Finish up this page and return...
-  */
+  //
+  // Finish up this page and return...
+  //
 
   end_nup(doc, number);
 
@@ -3201,22 +3232,22 @@ copy_page(pstops_doc_t *doc,            /* I - Document info */
 }
 
 
-/*
- * 'copy_prolog()' - Copy the document prolog section.
- *
- * This function expects "line" to be filled with a %%BeginProlog comment line.
- * On return, "line" will contain the next line in the file, if any.
- */
+//
+// 'copy_prolog()' - Copy the document prolog section.
+//
+// This function expects "line" to be filled with a %%BeginProlog comment line.
+// On return, "line" will contain the next line in the file, if any.
+//
 
-static ssize_t                         /* O - Length of next line */
-copy_prolog(pstops_doc_t *doc,         /* I - Document info */
-            ppd_file_t   *ppd,         /* I - PPD file */
-           char         *line,         /* I - Line buffer */
-           ssize_t      linelen,       /* I - Length of initial line */
-           size_t       linesize)      /* I - Size of line buffer */
+static ssize_t                         // O - Length of next line
+copy_prolog(pstops_doc_t *doc,         // I - Document info
+            ppd_file_t   *ppd,         // I - PPD file
+           char         *line,         // I - Line buffer
+           ssize_t      linelen,       // I - Length of initial line
+           size_t       linesize)      // I - Size of line buffer
 {
   cf_logfunc_t log = doc->logfunc;
-  void          *ld = doc->logdata;
+  void         *ld = doc->logdata;
 
 
   while (strncmp(line, "%%BeginProlog", 13))
@@ -3260,23 +3291,23 @@ copy_prolog(pstops_doc_t *doc,          /* I - Document info */
 }
 
 
-/*
- * 'copy_setup()' - Copy the document setup section.
- *
- * This function expects "line" to be filled with a %%BeginSetup comment line.
- * On return, "line" will contain the next line in the file, if any.
- */
+//
+// 'copy_setup()' - Copy the document setup section.
+//
+// This function expects "line" to be filled with a %%BeginSetup comment line.
+// On return, "line" will contain the next line in the file, if any.
+//
 
-static ssize_t                         /* O - Length of next line */
-copy_setup(pstops_doc_t *doc,          /* I - Document info */
-           ppd_file_t   *ppd,          /* I - PPD file */
-          char         *line,          /* I - Line buffer */
-          ssize_t      linelen,        /* I - Length of initial line */
-          size_t       linesize)       /* I - Size of line buffer */
+static ssize_t                         // O - Length of next line
+copy_setup(pstops_doc_t *doc,          // I - Document info
+           ppd_file_t   *ppd,          // I - PPD file
+          char         *line,          // I - Line buffer
+          ssize_t      linelen,        // I - Length of initial line
+          size_t       linesize)       // I - Size of line buffer
 {
-  int          num_options;            /* Number of options */
-  cups_option_t        *options;               /* Options */
-  cf_logfunc_t log = doc->logfunc;
+  int          num_options;            // Number of options
+  cups_option_t        *options;               // Options
+  cf_logfunc_t  log = doc->logfunc;
   void          *ld = doc->logdata;
 
 
@@ -3306,9 +3337,9 @@ copy_setup(pstops_doc_t *doc,             /* I - Document info */
         break;
       else if (!strncmp(line, "%%IncludeFeature:", 17))
       {
-       /*
-       * %%IncludeFeature: *MainKeyword OptionKeyword
-       */
+       //
+       // %%IncludeFeature: *MainKeyword OptionKeyword
+       //
 
         if (doc->number_up == 1 && !doc->fit_to_page)
          num_options = include_feature(doc, ppd, line, num_options, &options);
@@ -3340,28 +3371,28 @@ copy_setup(pstops_doc_t *doc,           /* I - Document info */
 }
 
 
-/*
- * 'copy_trailer()' - Copy the document trailer.
- *
- * This function expects "line" to be filled with a %%Trailer comment line.
- * On return, "line" will contain the next line in the file, if any.
- */
-
-static ssize_t                         /* O - Length of next line */
-copy_trailer(pstops_doc_t *doc,                /* I - Document info */
-             ppd_file_t   *ppd,                /* I - PPD file */
-            int          number,       /* I - Number of pages */
-            char         *line,        /* I - Line buffer */
-            ssize_t      linelen,      /* I - Length of initial line */
-            size_t       linesize)     /* I - Size of line buffer */
+//
+// 'copy_trailer()' - Copy the document trailer.
+//
+// This function expects "line" to be filled with a %%Trailer comment line.
+// On return, "line" will contain the next line in the file, if any.
+//
+
+static ssize_t                         // O - Length of next line
+copy_trailer(pstops_doc_t *doc,                // I - Document info
+             ppd_file_t   *ppd,                // I - PPD file
+            int          number,       // I - Number of pages
+            char         *line,        // I - Line buffer
+            ssize_t      linelen,      // I - Length of initial line
+            size_t       linesize)     // I - Size of line buffer
 {
-  cf_logfunc_t log = doc->logfunc;
+  cf_logfunc_t  log = doc->logfunc;
   void          *ld = doc->logdata;
 
 
- /*
-  * Write the trailer comments...
-  */
+  //
+  // Write the trailer comments...
+  //
 
   (void)ppd;
 
@@ -3385,30 +3416,30 @@ copy_trailer(pstops_doc_t *doc,         /* I - Document info */
   doc_printf(doc, "%%%%Pages: %d\n", number);
   if (doc->number_up > 1 || doc->fit_to_page)
     doc_printf(doc, "%%%%BoundingBox: %.0f %.0f %.0f %.0f\n",
-           doc->PageLeft, doc->PageBottom, doc->PageRight, doc->PageTop);
+              doc->PageLeft, doc->PageBottom, doc->PageRight, doc->PageTop);
   else
     doc_printf(doc, "%%%%BoundingBox: %d %d %d %d\n",
-           doc->new_bounding_box[0], doc->new_bounding_box[1],
-           doc->new_bounding_box[2], doc->new_bounding_box[3]);
+              doc->new_bounding_box[0], doc->new_bounding_box[1],
+              doc->new_bounding_box[2], doc->new_bounding_box[3]);
 
   return (linelen);
 }
 
 
-/*
- * 'do_prolog()' - Send the necessary document prolog commands.
- */
+//
+// 'do_prolog()' - Send the necessary document prolog commands.
+//
 
 static void
-do_prolog(pstops_doc_t *doc,           /* I - Document information */
-          ppd_file_t   *ppd)           /* I - PPD file */
+do_prolog(pstops_doc_t *doc,           // I - Document information
+          ppd_file_t   *ppd)           // I - PPD file
 {
-  char *ps;                            /* PS commands */
+  char *ps;                            // PS commands
 
 
- /*
-  * Send the document prolog commands...
-  */
+  //
+  // Send the document prolog commands...
+  //
 
   if (ppd && ppd->patches)
   {
@@ -3423,10 +3454,10 @@ do_prolog(pstops_doc_t *doc,            /* I - Document information */
     free(ps);
   }
 
- /*
-  * Define ESPshowpage here so that applications that define their
-  * own procedure to do a showpage pick it up...
-  */
+  //
+  // Define ESPshowpage here so that applications that define their
+  // own procedure to do a showpage pick it up...
+  //
 
   if (doc->use_ESPshowpage)
     doc_puts(doc, "userdict/ESPshowpage/showpage load put\n"
@@ -3434,28 +3465,28 @@ do_prolog(pstops_doc_t *doc,            /* I - Document information */
 }
 
 
-/*
- * 'do_setup()' - Send the necessary document setup commands.
- */
+//
+// 'do_setup()' - Send the necessary document setup commands.
+//
 
 static void
-do_setup(pstops_doc_t *doc,            /* I - Document information */
-         ppd_file_t   *ppd)            /* I - PPD file */
+do_setup(pstops_doc_t *doc,            // I - Document information
+         ppd_file_t   *ppd)            // I - PPD file
 {
-  char *ps;                            /* PS commands */
+  char *ps;                            // PS commands
+
 
+  //
+  // Disable CTRL-D so that embedded files don't cause printing
+  // errors...
 
- /*
-  * Disable CTRL-D so that embedded files don't cause printing
-  * errors...
-  */
 
   doc_puts(doc, "% Disable CTRL-D as an end-of-file marker...\n");
   doc_puts(doc, "userdict dup(\\004)cvn{}put (\\004\\004)cvn{}put\n");
 
- /*
-  * Send all the printer-specific setup commands...
-  */
+  //
+  // Send all the printer-specific setup commands...
+  //
 
   if ((ps = ppdEmitString(ppd, PPD_ORDER_DOCUMENT, 0.0)) != NULL)
   {
@@ -3469,9 +3500,9 @@ do_setup(pstops_doc_t *doc,               /* I - Document information */
     free(ps);
   }
 
- /*
-  * Set the number of copies for the job...
-  */
+  //
+  // Set the number of copies for the job...
+  //
 
   if (doc->copies != 1 && (!doc->collate || !doc->slow_collate))
   {
@@ -3484,9 +3515,9 @@ do_setup(pstops_doc_t *doc,               /* I - Document information */
     doc_puts(doc, "%RBIEndNonPPDFeature\n");
   }
 
- /*
-  * If we are doing N-up printing, disable setpagedevice...
-  */
+  //
+  // If we are doing N-up printing, disable setpagedevice...
+  //
 
   if (doc->number_up > 1)
   {
@@ -3494,22 +3525,22 @@ do_setup(pstops_doc_t *doc,             /* I - Document information */
     doc_puts(doc, "userdict/setpagedevice{pop}bind put\n");
   }
 
- /*
-  * Make sure we have rectclip and rectstroke procedures of some sort...
-  */
+  //
+  // Make sure we have rectclip and rectstroke procedures of some sort...
+  //
 
   write_common(doc);
 
- /*
-  * Write the page and label prologs...
-  */
+  //
+  // Write the page and label prologs...
+  //
 
   if (doc->number_up == 2 || doc->number_up == 6)
   {
-   /*
-    * For 2- and 6-up output, rotate the labels to match the orientation
-    * of the pages...
-    */
+    //
+    // For 2- and 6-up output, rotate the labels to match the orientation
+    // of the pages...
+    //
 
     if (doc->Orientation & 1)
       write_label_prolog(doc, doc->page_label, doc->PageBottom,
@@ -3525,22 +3556,22 @@ do_setup(pstops_doc_t *doc,             /* I - Document information */
 }
 
 
-/*
- * 'doc_printf()' - Send a formatted string to the output file and/or the
- *                  temp file.
- *
- * This function should be used for all page-level output that is affected
- * by ordering, collation, etc.
- */
+//
+// 'doc_printf()' - Send a formatted string to the output file and/or the
+//                  temp file.
+//
+// This function should be used for all page-level output that is affected
+// by ordering, collation, etc.
+//
 
 static void
-doc_printf(pstops_doc_t *doc,          /* I - Document information */
-           const char   *format,       /* I - Printf-style format string */
-          ...)                         /* I - Additional arguments as needed */
+doc_printf(pstops_doc_t *doc,          // I - Document information
+           const char   *format,       // I - Printf-style format string
+          ...)                         // I - Additional arguments as needed
 {
-  va_list      ap;                     /* Pointer to arguments */
-  char         buffer[1024];           /* Output buffer */
-  ssize_t      bytes;                  /* Number of bytes to write */
+  va_list      ap;                     // Pointer to arguments
+  char         buffer[1024];           // Output buffer
+  ssize_t      bytes;                  // Number of bytes to write
   cf_logfunc_t log = doc->logfunc;
   void          *ld = doc->logdata;
 
@@ -3560,46 +3591,46 @@ doc_printf(pstops_doc_t *doc,           /* I - Document information */
 }
 
 
-/*
- * 'doc_putc()' - Send a single character to the output file and/or the
- *                temp file.
- *
- * This function should be used for all page-level output that is affected
- * by ordering, collation, etc.
- */
+//
+// 'doc_putc()' - Send a single character to the output file and/or the
+//                temp file.
+//
+// This function should be used for all page-level output that is affected
+// by ordering, collation, etc.
+//
 
 static void
-doc_putc(pstops_doc_t *doc,            /* I - Document information */
-         const char   c)               /* I - Character to send */
+doc_putc(pstops_doc_t *doc,            // I - Document information
+         const char   c)               // I - Character to send
 {
   doc_write(doc, &c, 1);
 }
 
 
-/*
- * 'doc_puts()' - Send a nul-terminated string to the output file and/or the
- *                temp file.
- *
- * This function should be used for all page-level output that is affected
- * by ordering, collation, etc.
- */
+//
+// 'doc_puts()' - Send a nul-terminated string to the output file and/or the
+//                temp file.
+//
+// This function should be used for all page-level output that is affected
+// by ordering, collation, etc.
+//
 
 static void
-doc_puts(pstops_doc_t *doc,            /* I - Document information */
-         const char   *s)              /* I - String to send */
+doc_puts(pstops_doc_t *doc,            // I - Document information
+         const char   *s)              // I - String to send
 {
   doc_write(doc, s, strlen(s));
 }
 
 
-/*
- * 'doc_write()' - Send data to the output file and/or the temp file.
- */
+//
+// 'doc_write()' - Send data to the output file and/or the temp file.
+//
 
 static void
-doc_write(pstops_doc_t *doc,           /* I - Document information */
-          const char   *s,             /* I - Data to send */
-         size_t       len)             /* I - Number of bytes to send */
+doc_write(pstops_doc_t *doc,           // I - Document information
+          const char   *s,             // I - Data to send
+         size_t       len)             // I - Number of bytes to send
 {
   if (!doc->slow_order)
     fwrite(s, 1, len, doc->outputfp);
@@ -3609,13 +3640,13 @@ doc_write(pstops_doc_t *doc,            /* I - Document information */
 }
 
 
-/*
- * 'end_nup()' - End processing for N-up printing.
- */
+//
+// 'end_nup()' - End processing for N-up printing.
+//
 
 static void
-end_nup(pstops_doc_t *doc,             /* I - Document information */
-        int          number)           /* I - Page number */
+end_nup(pstops_doc_t *doc,             // I - Document information
+        int          number)           // I - Page number
 {
   if (doc->number_up > 1)
     doc_puts(doc, "userdict/ESPsave get restore\n");
@@ -3636,25 +3667,25 @@ end_nup(pstops_doc_t *doc,              /* I - Document information */
        {
          if (doc->Orientation & 1)
          {
-          /*
-           * Rotate the labels back to portrait...
-           */
+           //
+           // Rotate the labels back to portrait...
+           //
 
            write_labels(doc, doc->Orientation - 1);
          }
          else if (doc->Orientation == 0)
          {
-          /*
-           * Rotate the labels to landscape...
-           */
+           //
+           // Rotate the labels to landscape...
+           //
 
            write_labels(doc, doc->normal_landscape ? 1 : 3);
          }
          else
          {
-          /*
-           * Rotate the labels to landscape...
-           */
+           //
+           // Rotate the labels to landscape...
+           //
 
            write_labels(doc, doc->normal_landscape ? 3 : 1);
          }
@@ -3676,28 +3707,28 @@ end_nup(pstops_doc_t *doc,              /* I - Document information */
 }
 
 
-/*
- * 'include_feature()' - Include a printer option/feature command.
- */
+//
+// 'include_feature()' - Include a printer option/feature command.
+//
 
-static int                             /* O  - New number of options */
+static int                             // O  - New number of options
 include_feature(
-    pstops_doc_t  *doc,                        /* I  - Document information */
-    ppd_file_t    *ppd,                        /* I  - PPD file */
-    const char    *line,               /* I  - DSC line */
-    int           num_options,         /* I  - Number of options */
-    cups_option_t **options)           /* IO - Options */
+    pstops_doc_t  *doc,                        // I  - Document information
+    ppd_file_t    *ppd,                        // I  - PPD file
+    const char    *line,               // I  - DSC line
+    int           num_options,         // I  - Number of options
+    cups_option_t **options)           // IO - Options
 {
-  char         name[255],              /* Option name */
-               value[255];             /* Option value */
-  ppd_option_t *option;                /* Option in file */
-  cf_logfunc_t log = doc->logfunc;
+  char         name[255],              // Option name
+               value[255];             // Option value
+  ppd_option_t *option;                // Option in file
+  cf_logfunc_t  log = doc->logfunc;
   void          *ld = doc->logdata;
 
 
- /*
-  * Get the "%%IncludeFeature: *Keyword OptionKeyword" values...
-  */
+  //
+  // Get the "%%IncludeFeature: *Keyword OptionKeyword" values...
+  //
 
   if (sscanf(line + 17, "%254s%254s", name, value) != 2)
   {
@@ -3706,9 +3737,9 @@ include_feature(
     return (num_options);
   }
 
- /*
-  * Find the option and choice...
-  */
+  //
+  // Find the option and choice...
+  //
 
   if ((option = ppdFindOption(ppd, name + 1)) == NULL)
   {
@@ -3734,46 +3765,46 @@ include_feature(
     return (num_options);
   }
 
- /*
-  * Add the option to the option array and return...
-  */
+  //
+  // Add the option to the option array and return...
+  //
 
   return (cupsAddOption(name + 1, value, num_options, options));
 }
 
 
-/*
- * 'parse_text()' - Parse a text value in a comment.
- *
- * This function parses a DSC text value as defined on page 36 of the
- * DSC specification.  Text values are either surrounded by parenthesis
- * or whitespace-delimited.
- *
- * The value returned is the literal characters for the entire text
- * string, including any parenthesis and escape characters.
- */
-
-static char *                          /* O - Value or NULL on error */
-parse_text(const char *start,          /* I - Start of text value */
-           char       **end,           /* O - End of text value */
-          char       *buffer,          /* I - Buffer */
-           size_t     bufsize)         /* I - Size of buffer */
+//
+// 'parse_text()' - Parse a text value in a comment.
+//
+// This function parses a DSC text value as defined on page 36 of the
+// DSC specification.  Text values are either surrounded by parenthesis
+// or whitespace-delimited.
+//
+// The value returned is the literal characters for the entire text
+// string, including any parenthesis and escape characters.
+//
+
+static char *                          // O - Value or NULL on error
+parse_text(const char *start,          // I - Start of text value
+           char       **end,           // O - End of text value
+          char       *buffer,          // I - Buffer
+           size_t     bufsize)         // I - Size of buffer
 {
-  char *bufptr,                        /* Pointer in buffer */
-       *bufend;                        /* End of buffer */
-  int  level;                          /* Parenthesis level */
+  char *bufptr,                        // Pointer in buffer
+       *bufend;                        // End of buffer
+  int  level;                          // Parenthesis level
 
 
- /*
-  * Skip leading whitespace...
-  */
+  //
+  // Skip leading whitespace...
+  //
 
   while (isspace(*start & 255))
     start ++;
 
- /*
-  * Then copy the value...
-  */
+  //
+  // Then copy the value...
+  //
 
   level  = 0;
   bufptr = buffer;
@@ -3800,11 +3831,11 @@ parse_text(const char *start,           /* I - Start of text value */
     }
     else if (*start == '\\')
     {
-     /*
-      * Copy escaped character...
-      */
+      //
+      // Copy escaped character...
+      //
 
-      int      i;                      /* Looping var */
+      int      i;                      // Looping var
 
 
       for (i = 1;
@@ -3817,9 +3848,9 @@ parse_text(const char *start,             /* I - Start of text value */
 
   *bufptr = '\0';
 
- /*
-  * Return the value and new pointer into the line...
-  */
+  //
+  // Return the value and new pointer into the line...
+  //
 
   if (end)
     *end = (char *)start;
@@ -3831,27 +3862,27 @@ parse_text(const char *start,           /* I - Start of text value */
 }
 
 
-/*
- * 'ps_hex()' - Print binary data as a series of hexadecimal numbers.
- */
+//
+// 'ps_hex()' - Print binary data as a series of hexadecimal numbers.
+//
 
 static void
 ps_hex(pstops_doc_t *doc,
-       cf_ib_t *data,                  /* I - Data to print */
-       int       length,               /* I - Number of bytes to print */
-       int       last_line)            /* I - Last line of raster data? */
+       cf_ib_t *data,                  // I - Data to print
+       int       length,               // I - Number of bytes to print
+       int       last_line)            // I - Last line of raster data?
 {
-  static int   col = 0;                /* Current column */
+  static int   col = 0;                // Current column
   static char  *hex = "0123456789ABCDEF";
-                                       /* Hex digits */
+                                       // Hex digits
 
 
   while (length > 0)
   {
-   /*
-    * Put the hex chars out to the file; note that we don't use fprintf()
-    * for speed reasons...
-    */
+    //
+    // Put the hex chars out to the file; note that we don't use fprintf()
+    // for speed reasons...
+    //
 
     doc_putc(doc, hex[*data >> 4]);
     doc_putc(doc, hex[*data & 15]);
@@ -3875,19 +3906,19 @@ ps_hex(pstops_doc_t *doc,
 }
 
 
-/*
- * 'ps_ascii85()' - Print binary data as a series of base-85 numbers.
- */
+//
+// 'ps_ascii85()' - Print binary data as a series of base-85 numbers.
+//
 
 static void
 ps_ascii85(pstops_doc_t *doc,
-          cf_ib_t *data,               /* I - Data to print */
-          int       length,            /* I - Number of bytes to print */
-          int       last_line)         /* I - Last line of raster data? */
+          cf_ib_t *data,               // I - Data to print
+          int       length,            // I - Number of bytes to print
+          int       last_line)         // I - Last line of raster data?
 {
-  unsigned     b;                      /* Binary data word */
-  unsigned char        c[5];                   /* ASCII85 encoded chars */
-  static int   col = 0;                /* Current column */
+  unsigned     b;                      // Binary data word
+  unsigned char        c[5];                   // ASCII85 encoded chars
+  static int   col = 0;                // Current column
 
 
   while (length > 3)
@@ -3951,73 +3982,73 @@ ps_ascii85(pstops_doc_t *doc,
 }
 
 
-/*
- * 'set_pstops_options()' - Set pstops options.
- */
+//
+// 'set_pstops_options()' - Set pstops options.
+//
 
 static int
 set_pstops_options(
-    pstops_doc_t  *doc,                        /* I - Document information */
-    ppd_file_t    *ppd,                        /* I - PPD file */
-    int           job_id,               /* I - Job ID */
-    char          *job_user,            /* I - Job User */
-    char          *job_title,           /* I - Job Title */
-    int           copies,               /* I - Number of copies */
-    int           num_options,         /* I - Number of options */
-    cups_option_t *options,            /* I - Options */
-    cf_logfunc_t logfunc,           /* I - Logging function,
-                                              NULL for no logging */
-    void *logdata,                      /* I - User data for logging function,
-                                              can be NULL */
-    cf_filter_iscanceledfunc_t iscanceledfunc, /* I - Function returning 1 when
-                                              job is canceled, NULL for not
-                                              supporting stop on cancel */
-    void *iscanceleddata)               /* I - User data for is-canceled
-                                              function, can be NULL */
+    pstops_doc_t  *doc,                        // I - Document information
+    ppd_file_t    *ppd,                        // I - PPD file
+    int           job_id,               // I - Job ID
+    char          *job_user,            // I - Job User
+    char          *job_title,           // I - Job Title
+    int           copies,               // I - Number of copies
+    int           num_options,         // I - Number of options
+    cups_option_t *options,            // I - Options
+    cf_logfunc_t  logfunc,              // I - Logging function,
+                                       //     NULL for no logging
+    void *logdata,                      // I - User data for logging function,
+                                       //     can be NULL
+    cf_filter_iscanceledfunc_t iscanceledfunc, // I - Function returning 1 when
+                                       //     job is canceled, NULL for not
+                                       //     supporting stop on cancel
+    void *iscanceleddata)               // I - User data for is-canceled
+                                       //     function, can be NULL
 {
-  const char   *val;                   /* Option value */
-  int          intval;                 /* Integer option value */
-  ppd_attr_t   *attr;                  /* PPD attribute */
-  ppd_option_t *option;                /* PPD option */
-  ppd_choice_t *choice;                /* PPD choice */
-  const char   *content_type;          /* Original content type */
-  int          max_copies;             /* Maximum number of copies supported */
-  cf_logfunc_t log = logfunc;
+  const char   *val;                   // Option value
+  int          intval;                 // Integer option value
+  ppd_attr_t   *attr;                  // PPD attribute
+  ppd_option_t *option;                // PPD option
+  ppd_choice_t *choice;                // PPD choice
+  const char   *content_type;          // Original content type
+  int          max_copies;             // Maximum number of copies supported
+  cf_logfunc_t  log = logfunc;
   void          *ld = logdata;
   cf_filter_iscanceledfunc_t iscanceled = iscanceledfunc;
   void          *icd = iscanceleddata;
 
 
- /*
-  * Initialize document information structure...
-  */
+  //
+  // Initialize document information structure...
+  //
 
   memset(doc, 0, sizeof(pstops_doc_t));
 
-  /* Job info, to appear on the printer's front panel while printing */
+  // Job info, to appear on the printer's front panel while printing
   doc->job_id = (job_id > 0 ? job_id : 0);
   doc->user = (job_user ? job_user : "Unknown");
   doc->title = (job_title ? job_title : "");
 
-  /* Number of copies, 1 if this filter should not handle copies */
+  // Number of copies, 1 if this filter should not handle copies
   doc->copies = (copies > 0 ? copies : 1);
 
-  /* Logging function */
+  // Logging function
   doc->logfunc = log;
   doc->logdata = ld;
 
-  /* Job-is-canceled function */
+  // Job-is-canceled function
   doc->iscanceledfunc = iscanceled;
   doc->iscanceleddata = icd;
 
-  /* Set some common values */
+  // Set some common values
   ppdFilterSetCommonOptions(ppd, num_options, options, 1,
-                        &doc->Orientation, &doc->Duplex,
-                        &doc->LanguageLevel, &doc->Color,
-                        &doc->PageLeft, &doc->PageRight,
-                        &doc->PageTop, &doc->PageBottom,
-                        &doc->PageWidth, &doc->PageLength,
-                        log, ld);
+                           &doc->Orientation, &doc->Duplex,
+                           &doc->LanguageLevel, &doc->Color,
+                           &doc->PageLeft, &doc->PageRight,
+                           &doc->PageTop, &doc->PageBottom,
+                           &doc->PageWidth, &doc->PageLength,
+                           log, ld);
 
   if (ppd && ppd->landscape > 0)
     doc->normal_landscape = 1;
@@ -4032,9 +4063,9 @@ set_pstops_options(
   doc->new_bounding_box[2] = INT_MIN;
   doc->new_bounding_box[3] = INT_MIN;
 
- /*
-  * AP_FIRSTPAGE_* and the corresponding non-first-page options.
-  */
+  //
+  // AP_FIRSTPAGE_* and the corresponding non-first-page options.
+  //
 
   doc->ap_input_slot  = cupsGetOption("AP_FIRSTPAGE_InputSlot", num_options,
                                       options);
@@ -4062,21 +4093,21 @@ set_pstops_options(
   if ((choice = ppdFindMarkedChoice(ppd, "PageSize")) != NULL)
     doc->page_size = choice->choice;
 
- /*
-  * collate, multiple-document-handling
-  */
+  //
+  // collate, multiple-document-handling
+  //
 
   if ((val = cupsGetOption("multiple-document-handling",
                           num_options, options)) != NULL)
   {
-   /*
-    * This IPP attribute is unnecessarily complicated...
-    *
-      single-document, separate-documents-collated-copies, and
-      single-document-new-sheet all require collated copies.
-    *
-      separate-documents-uncollated-copies allows for uncollated copies.
-    */
+    //
+    // This IPP attribute is unnecessarily complicated...
+    //
+    //  single-document, separate-documents-collated-copies, and
+    //  single-document-new-sheet all require collated copies.
+    //
+    //  separate-documents-uncollated-copies allows for uncollated copies.
+    //
 
     doc->collate = strcasecmp(val, "separate-documents-uncollated-copies") != 0;
   }
@@ -4086,9 +4117,9 @@ set_pstops_options(
        !strcasecmp(val, "yes")))
     doc->collate = 1;
 
- /*
-  * emit-jcl
-  */
+  //
+  // emit-jcl
+  //
 
   if ((val = cupsGetOption("emit-jcl", num_options, options)) != NULL &&
       (!strcasecmp(val, "false") || !strcasecmp(val, "off") ||
@@ -4097,11 +4128,11 @@ set_pstops_options(
   else
     doc->emit_jcl = 1;
 
- /*
-  * fit-to-page/ipp-attribute-fidelity
-  *
-  * (Only for original PostScript content)
-  */
+  //
+  // fit-to-page/ipp-attribute-fidelity
+  //
+  // (Only for original PostScript content)
+  //
 
   if ((content_type = getenv("CONTENT_TYPE")) == NULL)
     content_type = "application/postscript";
@@ -4117,9 +4148,9 @@ set_pstops_options(
       doc->fit_to_page = 1;
   }
 
- /*
-  * mirror/MirrorPrint
-  */
+  //
+  // mirror/MirrorPrint
+  //
 
   if ((choice = ppdFindMarkedChoice(ppd, "MirrorPrint")) != NULL)
   {
@@ -4133,9 +4164,9 @@ set_pstops_options(
               !strcasecmp(val, "yes")))
     doc->mirror = 1;
 
- /*
-  * number-up
-  */
+  //
+  // number-up
+  //
 
   if ((val = cupsGetOption("number-up", num_options, options)) != NULL)
   {
@@ -4160,9 +4191,9 @@ set_pstops_options(
   else
     doc->number_up = 1;
 
- /*
-  * number-up-layout
-  */
+  //
+  // number-up-layout
+  //
 
   if ((val = cupsGetOption("number-up-layout", num_options, options)) != NULL)
   {
@@ -4193,9 +4224,9 @@ set_pstops_options(
   else
     doc->number_up_layout = PSTOPS_LAYOUT_LRTB;
 
- /*
-  * OutputOrder
-  */
+  //
+  // OutputOrder
+  //
 
   if ((val = cupsGetOption("OutputOrder", num_options, options)) != NULL)
   {
@@ -4204,9 +4235,9 @@ set_pstops_options(
   }
   else if (ppd)
   {
-   /*
-    * Figure out the right default output order from the PPD file...
-    */
+    //
+    // Figure out the right default output order from the PPD file...
+    //
 
     if ((choice = ppdFindMarkedChoice(ppd, "OutputBin")) != NULL &&
         (attr = ppdFindAttr(ppd, "PageStackOrder", choice->choice)) != NULL &&
@@ -4217,9 +4248,9 @@ set_pstops_options(
       doc->output_order = !strcasecmp(attr->value, "Reverse");
   }
 
- /*
-  * page-border
-  */
+  //
+  // page-border
+  //
 
   if ((val = cupsGetOption("page-border", num_options, options)) != NULL)
   {
@@ -4244,33 +4275,33 @@ set_pstops_options(
   else
     doc->page_border = PSTOPS_BORDERNONE;
 
- /*
-  * page-label
-  */
+  //
+  // page-label
+  //
 
   doc->page_label = cupsGetOption("page-label", num_options, options);
- /*
- *  input-page-ranges
- */
 
-  doc->inputPageRange=cupsGetOption("input-page-ranges",num_options,options);
-  
- /*
-  * page-ranges
-  */
+  //
+  // input-page-ranges
+  //
+
+  doc->inputPageRange=cupsGetOption("input-page-ranges", num_options, options);
+
+  //
+  // page-ranges
+  //
 
   doc->page_ranges = cupsGetOption("page-ranges", num_options, options);
 
- /*
-  * page-set
-  */
+  //
+  // page-set
+  //
 
   doc->page_set = cupsGetOption("page-set", num_options, options);
 
- /*
-  * Now figure out if we have to force collated copies, etc.
-  */
+  //
+  // Now figure out if we have to force collated copies, etc.
+  //
 
   if ((attr = ppdFindAttr(ppd, "cupsMaxCopies", NULL)) != NULL)
     max_copies = atoi(attr->value);
@@ -4283,25 +4314,25 @@ set_pstops_options(
     doc->collate = 1;
   else if (ppd && ppd->manual_copies && doc->Duplex && doc->copies > 1)
   {
-   /*
-    * Force collated copies when printing a duplexed document to
-    * a non-PS printer that doesn't do hardware copy generation.
-    * Otherwise the copies will end up on the front/back side of
-    * each page.
-    */
+    //
+    // Force collated copies when printing a duplexed document to
+    // a non-PS printer that doesn't do hardware copy generation.
+    // Otherwise the copies will end up on the front/back side of
+    // each page.
+    //
 
     doc->collate = 1;
   }
 
- /*
-  * See if we have to filter the fast or slow way...
-  */
+  //
+  // See if we have to filter the fast or slow way...
+  //
 
   if (doc->collate && doc->copies > 1)
   {
-   /*
-    * See if we need to manually collate the pages...
-    */
+    //
+    // See if we need to manually collate the pages...
+    //
 
     doc->slow_collate = 1;
 
@@ -4309,11 +4340,11 @@ set_pstops_options(
         (choice = ppdFindMarkedChoice(ppd, "Collate")) != NULL &&
         !strcasecmp(choice->choice, "True"))
     {
-     /*
-      * Hardware collate option is selected, see if the option is
-      * conflicting - if not, collate in hardware.  Otherwise,
-      * turn the hardware collate option off...
-      */
+      //
+      // Hardware collate option is selected, see if the option is
+      // conflicting - if not, collate in hardware.  Otherwise,
+      // turn the hardware collate option off...
+      //
 
       if ((option = ppdFindOption(ppd, "Collate")) != NULL &&
           !option->conflicted)
@@ -4338,9 +4369,9 @@ set_pstops_options(
   else
     doc->slow_duplex = 0;
 
- /*
-  * Create a temporary file for page data if we need to filter slowly...
-  */
+  //
+  // Create a temporary file for page data if we need to filter slowly...
+  //
 
   if (doc->slow_order || doc->slow_collate)
   {
@@ -4354,16 +4385,16 @@ set_pstops_options(
     }
   }
 
- /*
-  * Figure out if we should use ESPshowpage or not...
-  */
+  //
+  // Figure out if we should use ESPshowpage or not...
+  //
 
   if (doc->page_label || getenv("CLASSIFICATION") || doc->number_up > 1 ||
       doc->page_border)
   {
-   /*
-    * Yes, use ESPshowpage...
-    */
+    //
+    // Yes, use ESPshowpage...
+    //
 
     doc->use_ESPshowpage = 1;
   }
@@ -4376,17 +4407,17 @@ set_pstops_options(
 }
 
 
-/*
- * 'skip_page()' - Skip past a page that won't be printed.
- */
+//
+// 'skip_page()' - Skip past a page that won't be printed.
+//
 
-static ssize_t                         /* O - Length of next line */
-skip_page(pstops_doc_t *doc,           /* I - Document information */
-          char        *line,           /* I - Line buffer */
-         ssize_t     linelen,          /* I - Length of initial line */
-          size_t      linesize)                /* I - Size of line buffer */
+static ssize_t                         // O - Length of next line
+skip_page(pstops_doc_t *doc,           // I - Document information
+          char        *line,           // I - Line buffer
+         ssize_t     linelen,          // I - Length of initial line
+          size_t      linesize)                // I - Size of line buffer
 {
-  int  level;                          /* Embedded document level */
+  int  level;                          // Embedded document level
   cf_logfunc_t log = doc->logfunc;
   void          *ld = doc->logdata;
 
@@ -4408,11 +4439,11 @@ skip_page(pstops_doc_t *doc,            /* I - Document information */
              (!strncmp(line, "%%BeginData:", 12) &&
              !strstr(line, "ASCII") && !strstr(line, "Hex")))
     {
-     /*
-      * Skip binary data...
-      */
+      //
+      // Skip binary data...
+      //
 
-      ssize_t  bytes;                  /* Bytes of data */
+      ssize_t  bytes;                  // Bytes of data
 
       bytes = atoi(strchr(line, ':') + 1);
 
@@ -4442,28 +4473,28 @@ skip_page(pstops_doc_t *doc,            /* I - Document information */
 }
 
 
-/*
- * 'start_nup()' - Start processing for N-up printing.
- */
+//
+// 'start_nup()' - Start processing for N-up printing.
+//
 
 static void
-start_nup(pstops_doc_t *doc,           /* I - Document information */
-          int          number,         /* I - Page number */
-         int          show_border,     /* I - Show the border? */
-         const int    *bounding_box)   /* I - BoundingBox value */
+start_nup(pstops_doc_t *doc,           // I - Document information
+          int          number,         // I - Page number
+         int          show_border,     // I - Show the border?
+         const int    *bounding_box)   // I - BoundingBox value
 {
-  int          pos;                    /* Position on page */
-  int          x, y;                   /* Relative position of subpage */
-  double       w, l,                   /* Width and length of subpage */
-               tx, ty;                 /* Translation values for subpage */
-  double       pagew,                  /* Printable width of page */
-               pagel;                  /* Printable height of page */
-  int          bboxx,                  /* BoundingBox X origin */
-               bboxy,                  /* BoundingBox Y origin */
-               bboxw,                  /* BoundingBox width */
-               bboxl;                  /* BoundingBox height */
-  double       margin = 0;             /* Current margin for border */
-  cf_logfunc_t log = doc->logfunc;
+  int          pos;                    // Position on page
+  int          x, y;                   // Relative position of subpage
+  double       w, l,                   // Width and length of subpage
+               tx, ty;                 // Translation values for subpage
+  double       pagew,                  // Printable width of page
+               pagel;                  // Printable height of page
+  int          bboxx,                  // BoundingBox X origin
+               bboxy,                  // BoundingBox Y origin
+               bboxw,                  // BoundingBox width
+               bboxl;                  // BoundingBox height
+  double       margin = 0;             // Current margin for border
+  cf_logfunc_t  log = doc->logfunc;
   void          *ld = doc->logdata;
 
 
@@ -4509,28 +4540,28 @@ start_nup(pstops_doc_t *doc,            /* I - Document information */
 
   switch (doc->Orientation)
   {
-    case 1 : /* Landscape */
+    case 1 : // Landscape
         doc_printf(doc, "%.1f 0.0 translate 90 rotate\n", doc->PageLength);
         break;
-    case 2 : /* Reverse Portrait */
+    case 2 : // Reverse Portrait
         doc_printf(doc, "%.1f %.1f translate 180 rotate\n", doc->PageWidth,
                   doc->PageLength);
         break;
-    case 3 : /* Reverse Landscape */
+    case 3 : // Reverse Landscape
         doc_printf(doc, "0.0 %.1f translate -90 rotate\n", doc->PageWidth);
         break;
   }
 
- /*
-  * Mirror the page as needed...
-  */
+  //
+  // Mirror the page as needed...
+  //
 
   if (doc->mirror)
     doc_printf(doc, "%.1f 0.0 translate -1 1 scale\n", doc->PageWidth);
 
- /*
-  * Offset and scale as necessary for fit_to_page/fit-to-page/number-up...
-  */
+  //
+  // Offset and scale as necessary for fit_to_page/fit-to-page/number-up...
+  //
 
   if (doc->Duplex && doc->number_up > 1 && ((number / doc->number_up) & 1))
     doc_printf(doc, "%.1f %.1f translate\n", doc->PageWidth - doc->PageRight,
@@ -4819,32 +4850,32 @@ start_nup(pstops_doc_t *doc,            /* I - Document information */
         break;
   }
 
- /*
-  * Draw borders as necessary...
-  */
+  //
+  // Draw borders as necessary...
+  //
 
   if (doc->page_border && show_border)
   {
-    int                rects;                  /* Number of border rectangles */
-    double     fscale;                 /* Scaling value for points */
+    int                rects;                  // Number of border rectangles
+    double     fscale;                 // Scaling value for points
 
 
     rects  = (doc->page_border & PSTOPS_BORDERDOUBLE) ? 2 : 1;
     fscale = doc->PageWidth / w;
     margin = 2.25 * fscale;
 
-   /*
-    * Set the line width and color...
-    */
+    //
+    // Set the line width and color...
+    //
 
     doc_puts(doc, "gsave\n");
     doc_printf(doc, "%.3f setlinewidth 0 setgray newpath\n",
                (doc->page_border & PSTOPS_BORDERTHICK) ? 0.5 * fscale :
                                                         0.24 * fscale);
 
-   /*
-    * Draw border boxes...
-    */
+    //
+    // Draw border boxes...
+    //
 
     for (; rects > 0; rects --, margin += 2 * fscale)
       if (doc->number_up > 1)
@@ -4860,18 +4891,18 @@ start_nup(pstops_doc_t *doc,            /* I - Document information */
                   doc->PageRight - doc->PageLeft - 2 * margin,
                   doc->PageTop - doc->PageBottom - 2 * margin);
 
-   /*
-    * Restore pen settings...
-    */
+    //
+    // Restore pen settings...
+    //
 
     doc_puts(doc, "grestore\n");
   }
 
   if (doc->fit_to_page)
   {
-   /*
-    * Offset the page by its bounding box...
-    */
+    //
+    // Offset the page by its bounding box...
+    //
 
     doc_printf(doc, "%d %d translate\n", -bounding_box[0],
                -bounding_box[1]);
@@ -4879,9 +4910,9 @@ start_nup(pstops_doc_t *doc,              /* I - Document information */
 
   if (doc->fit_to_page || doc->number_up > 1)
   {
-   /*
-    * Clip the page to the page's bounding box...
-    */
+    //
+    // Clip the page to the page's bounding box...
+    //
 
     doc_printf(doc, "%.1f %.1f %.1f %.1f ESPrc\n",
                bboxx + margin, bboxy + margin,
@@ -4890,9 +4921,9 @@ start_nup(pstops_doc_t *doc,              /* I - Document information */
 }
 
 
-/*
- * 'write_common()' - Write common procedures...
- */
+//
+// 'write_common()' - Write common procedures...
+//
 
 static void
 write_common(pstops_doc_t *doc)
@@ -4915,36 +4946,36 @@ write_common(pstops_doc_t *doc)
 }
 
 
-/*
- * 'write_label_prolog()' - Write the prolog with the classification
- *                          and page label.
- */
+//
+// 'write_label_prolog()' - Write the prolog with the classification
+//                          and page label.
+
 
 static void
-write_label_prolog(pstops_doc_t *doc,  /* I - Document info */
-                   const char   *label,        /* I - Page label */
-                  float        bottom, /* I - Bottom position in points */
-                  float        top,    /* I - Top position in points */
-                  float        width)  /* I - Width in points */
+write_label_prolog(pstops_doc_t *doc,  // I - Document info
+                   const char   *label,        // I - Page label
+                  float        bottom, // I - Bottom position in points
+                  float        top,    // I - Top position in points
+                  float        width)  // I - Width in points
 {
-  const char   *classification;        /* CLASSIFICATION environment
-                                          variable */
-  const char   *ptr;                   /* Temporary string pointer */
+  const char   *classification;        // CLASSIFICATION environment
+                                       // variable
+  const char   *ptr;                   // Temporary string pointer
 
 
- /*
-  * First get the current classification...
-  */
+  //
+  // First get the current classification...
+  //
 
   if ((classification = getenv("CLASSIFICATION")) == NULL)
     classification = "";
   if (strcmp(classification, "none") == 0)
     classification = "";
 
- /*
-  * If there is nothing to show, bind an empty 'write labels' procedure
-  * and return...
-  */
+  //
+  // If there is nothing to show, bind an empty 'write labels' procedure
+  // and return...
+  //
 
   if (!classification[0] && (label == NULL || !label[0]))
   {
@@ -4952,9 +4983,9 @@ write_label_prolog(pstops_doc_t *doc,     /* I - Document info */
     return;
   }
 
- /*
-  * Set the classification + page label string...
-  */
+  //
+  // Set the classification + page label string...
+  //
 
   doc_puts(doc, "userdict");
   if (!strcmp(classification, "confidential"))
@@ -4989,9 +5020,9 @@ write_label_prolog(pstops_doc_t *doc,     /* I - Document info */
     if (classification[0])
       doc_puts(doc, " - ");
 
-   /*
-    * Quote the label string as needed...
-    */
+    //
+    // Quote the label string as needed...
+    //
 
     for (ptr = label; *ptr; ptr ++)
     {
@@ -5006,15 +5037,15 @@ write_label_prolog(pstops_doc_t *doc,   /* I - Document info */
 
   doc_puts(doc, ")put\n");
 
- /*
-  * Then get a 14 point Helvetica-Bold font...
-  */
+  //
+  // Then get a 14 point Helvetica-Bold font...
+  //
 
   doc_puts(doc, "userdict/ESPpf /Helvetica-Bold findfont 14 scalefont put\n");
 
- /*
-  * Finally, the procedure to write the labels on the page...
-  */
+  //
+  // Finally, the procedure to write the labels on the page...
+  //
 
   doc_puts(doc, "userdict/ESPwl{\n");
   doc_puts(doc, "  ESPpf setfont\n");
@@ -5033,19 +5064,19 @@ write_label_prolog(pstops_doc_t *doc,   /* I - Document info */
 }
 
 
-/*
- * 'write_labels()' - Write the actual page labels.
- *
- * This function is a copy of the one in common.c since we need to
- * use doc_puts/doc_printf instead of puts/printf...
- */
+//
+// 'write_labels()' - Write the actual page labels.
+//
+// This function is a copy of the one in common.c since we need to
+// use doc_puts/doc_printf instead of puts/printf...
+//
 
 static void
-write_labels(pstops_doc_t *doc,                /* I - Document information */
-             int          orient)      /* I - Orientation of the page */
+write_labels(pstops_doc_t *doc,                // I - Document information
+             int          orient)      // I - Orientation of the page
 {
-  float        width,                          /* Width of page */
-       length;                         /* Length of page */
+  float        width,                          // Width of page
+       length;                         // Length of page
 
 
   doc_puts(doc, "gsave\n");
@@ -5063,13 +5094,13 @@ write_labels(pstops_doc_t *doc,         /* I - Document information */
 
   switch (orient & 3)
   {
-    case 1 : /* Landscape */
+    case 1 : // Landscape
         doc_printf(doc, "%.1f 0.0 translate 90 rotate\n", length);
         break;
-    case 2 : /* Reverse Portrait */
+    case 2 : // Reverse Portrait
         doc_printf(doc, "%.1f %.1f translate 180 rotate\n", width, length);
         break;
-    case 3 : /* Reverse Landscape */
+    case 3 : // Reverse Landscape
         doc_printf(doc, "0.0 %.1f translate -90 rotate\n", width);
         break;
   }
@@ -5079,20 +5110,20 @@ write_labels(pstops_doc_t *doc,         /* I - Document information */
 }
 
 
-/*
- * 'write_labels_outputfile_only()' - Write the actual page labels to the
- *                                    output file.
- *
- * This function is a copy of the one in common.c. Since we use it only
- * in this filter, we have moved it to here.
- */
+//
+// 'write_labels_outputfile_only()' - Write the actual page labels to the
+//                                    output file.
+//
+// This function is a copy of the one in common.c. Since we use it only
+// in this filter, we have moved it to here.
+//
 
 static void
-write_labels_outputfile_only(pstops_doc_t *doc,/* I - Document information */
-                            int        orient)/* I - Orientation of the page */
+write_labels_outputfile_only(pstops_doc_t *doc,// I - Document information
+                            int        orient)// I - Orientation of the page
 {
-  float        width,                          /* Width of page */
-       length;                         /* Length of page */
+  float        width,                          // Width of page
+       length;                         // Length of page
 
 
   doc_puts(doc, "gsave\n");
@@ -5110,14 +5141,14 @@ write_labels_outputfile_only(pstops_doc_t *doc,/* I - Document information */
 
   switch (orient & 3)
   {
-    case 1 : /* Landscape */
+    case 1 : // Landscape
         doc_printf(doc, "%.1f 0.0 translate 90 rotate\n", length);
         break;
-    case 2 : /* Reverse Portrait */
+    case 2 : // Reverse Portrait
         doc_printf(doc, "%.1f %.1f translate 180 rotate\n",
                width, length);
         break;
-    case 3 : /* Reverse Landscape */
+    case 3 : // Reverse Landscape
         doc_printf(doc, "0.0 %.1f translate -90 rotate\n", width);
         break;
   }
@@ -5127,27 +5158,27 @@ write_labels_outputfile_only(pstops_doc_t *doc,/* I - Document information */
 }
 
 
-/*
- * 'write_options()' - Write options provided via %%IncludeFeature.
- */
+//
+// 'write_options()' - Write options provided via %%IncludeFeature.
+//
 
 static void
 write_options(
-    pstops_doc_t  *doc,                /* I - Document */
-    ppd_file_t    *ppd,                /* I - PPD file */
-    int           num_options, /* I - Number of options */
-    cups_option_t *options)    /* I - Options */
+    pstops_doc_t  *doc,                // I - Document
+    ppd_file_t    *ppd,                // I - PPD file
+    int           num_options, // I - Number of options
+    cups_option_t *options)    // I - Options
 {
-  int          i;              /* Looping var */
-  ppd_option_t *option;        /* PPD option */
-  float                min_order;      /* Minimum OrderDependency value */
-  char         *doc_setup,     /* DocumentSetup commands to send */
-               *any_setup;     /* AnySetup commands to send */
+  int          i;              // Looping var
+  ppd_option_t *option;        // PPD option
+  float                min_order;      // Minimum OrderDependency value
+  char         *doc_setup,     // DocumentSetup commands to send
+               *any_setup;     // AnySetup commands to send
 
 
- /*
-  * Figure out the minimum OrderDependency value...
-  */
+  //
+  // Figure out the minimum OrderDependency value...
+  //
 
   if ((option = ppdFindOption(ppd, "PageRegion")) != NULL)
     min_order = option->order;
@@ -5159,24 +5190,24 @@ write_options(
        option->order < min_order)
       min_order = option->order;
 
- /*
-  * Mark and extract them...
-  */
+  //
+  // Mark and extract them...
+  //
 
   ppdMarkOptions(ppd, num_options, options);
 
   doc_setup = ppdEmitString(ppd, PPD_ORDER_DOCUMENT, min_order);
   any_setup = ppdEmitString(ppd, PPD_ORDER_ANY, min_order);
 
- /*
-  * Then send them out...
-  */
+  //
+  // Then send them out...
+  //
 
   if (doc->number_up > 1)
   {
-   /*
-    * Temporarily restore setpagedevice so we can set the options...
-    */
+    //
+    // Temporarily restore setpagedevice so we can set the options...
+    //
 
     doc_puts(doc, "userdict/setpagedevice/CUPSsetpagedevice load put\n");
   }
@@ -5195,36 +5226,36 @@ write_options(
 
   if (doc->number_up > 1)
   {
-   /*
-    * Disable setpagedevice again...
-    */
+    //
+    // Disable setpagedevice again...
+    //
 
     doc_puts(doc, "userdict/setpagedevice{pop}bind put\n");
   }
 }
 
 
-/*
- * 'write_text_comment()' - Write a DSC text comment.
- */
+//
+// 'write_text_comment()' - Write a DSC text comment.
+//
 
 static void
-write_text_comment(pstops_doc_t *doc,  /* I - Document */
-                  const char *name,    /* I - Comment name ("Title", etc.) */
-                   const char *value)  /* I - Comment value */
+write_text_comment(pstops_doc_t *doc,  // I - Document
+                  const char *name,    // I - Comment name ("Title", etc.)
+                   const char *value)  // I - Comment value
 {
-  int  len;                            /* Current line length */
+  int  len;                            // Current line length
 
 
- /*
-  * DSC comments are of the form:
-  *
-  *   %%name: value
-  *
-  * The name and value must be limited to 7-bit ASCII for most printers,
-  * so we escape all non-ASCII and ASCII control characters as described
-  * in the Adobe Document Structuring Conventions specification.
-  */
+  //
+  // DSC comments are of the form:
+  //
+  //   %%name: value
+  //
+  // The name and value must be limited to 7-bit ASCII for most printers,
+  // so we escape all non-ASCII and ASCII control characters as described
+  // in the Adobe Document Structuring Conventions specification.
+  //
 
   doc_printf(doc, "%%%%%s: (", name);
   len = 5 + strlen(name);
@@ -5233,11 +5264,11 @@ write_text_comment(pstops_doc_t *doc,   /* I - Document */
   {
     if (*value < ' ' || *value >= 127)
     {
-     /*
-      * Escape this character value...
-      */
+      //
+      // Escape this character value...
+      //
 
-      if (len >= 251)                  /* Keep line < 254 chars */
+      if (len >= 251)                  // Keep line < 254 chars
         break;
 
       doc_printf(doc, "\\%03o", *value & 255);
@@ -5245,11 +5276,11 @@ write_text_comment(pstops_doc_t *doc,   /* I - Document */
     }
     else if (*value == '\\')
     {
-     /*
-      * Escape the backslash...
-      */
+      //
+      // Escape the backslash...
+      //
 
-      if (len >= 253)                  /* Keep line < 254 chars */
+      if (len >= 253)                  // Keep line < 254 chars
         break;
 
       doc_putc(doc, '\\');
@@ -5258,11 +5289,11 @@ write_text_comment(pstops_doc_t *doc,   /* I - Document */
     }
     else
     {
-     /*
-      * Put this character literally...
-      */
+      //
+      // Put this character literally...
+      //
 
-      if (len >= 254)                  /* Keep line < 254 chars */
+      if (len >= 254)                  // Keep line < 254 chars
         break;
 
       doc_putc(doc, *value);
index b1189b7195050b440344aa1269767b1b0d1bd92f..8b36b7bc15b7f858c32043f4403d149f07db9f50 100644 (file)
@@ -1,61 +1,62 @@
-/*
- * Private IPP definitions for libppd.
- *
- * Copyright © 2007-2018 by Apple Inc.
- * Copyright © 1997-2006 by Easy Software Products.
- *
- * Licensed under Apache License v2.0.  See the file "LICENSE" for more
- * information.
- */
+//
+// Private IPP definitions for libppd.
+//
+// Copyright © 2007-2018 by Apple Inc.
+// Copyright © 1997-2006 by Easy Software Products.
+//
+// Licensed under Apache License v2.0.  See the file "LICENSE" for more
+// information.
+//
 
 #ifndef _PPD_IPP_PRIVATE_H_
 #  define _PPD_IPP_PRIVATE_H_
 
-/*
- * Include necessary headers...
- */
+
+//
+// Include necessary headers...
+//
 
 #  include <cups/file.h>
 #  include <cups/ipp.h>
 
 
-/*
- * C++ magic...
- */
+//
+// C++ magic...
+//
 
 #  ifdef __cplusplus
 extern "C" {
-#  endif /* __cplusplus */
+#  endif // __cplusplus
 
 
-/*
- * Structures...
- */
+//
+// Structures...
+//
 
-typedef struct _ppd_ipp_option_s               /**** Attribute mapping data ****/
+typedef struct _ppd_ipp_option_s       // **** Attribute mapping data ****
 {
-  int          multivalue;             /* Option has multiple values? */
-  const char   *name;                  /* Option/attribute name */
-  ipp_tag_t    value_tag;              /* Value tag for this attribute */
-  ipp_tag_t    group_tag;              /* Group tag for this attribute */
-  ipp_tag_t    alt_group_tag;          /* Alternate group tag for this
-                                        * attribute */
-  const ipp_op_t *operations;          /* Allowed operations for this attr */
+  int          multivalue;             // Option has multiple values?
+  const char   *name;                  // Option/attribute name
+  ipp_tag_t    value_tag;              // Value tag for this attribute
+  ipp_tag_t    group_tag;              // Group tag for this attribute
+  ipp_tag_t    alt_group_tag;          // Alternate group tag for this
+                                       // attribute
+  const ipp_op_t *operations;          // Allowed operations for this attr
 } _ppd_ipp_option_t;
 
-/*
- * Prototypes for private functions...
- */
+//
+// Prototypes for private functions...
+//
 
-/* encode.c */
+// encode.c
 extern _ppd_ipp_option_t       *_ppdIppFindOption(const char *name);
 
 
-/*
- * C++ magic...
- */
+//
+// C++ magic...
+//
 
 #  ifdef __cplusplus
 }
-#  endif /* __cplusplus */
-#endif /* !_PPD_IPP_PRIVATE_H_ */
+#  endif // __cplusplus
+#endif // !_PPD_IPP_PRIVATE_H_
index 89372f25a03c7df23653436238f006615d008d55..04bfab8531f79856652426e515d4e3aa321678df 100644 (file)
@@ -1,18 +1,19 @@
-/*
- * This file contains model number definitions for the CUPS sample
- * label printer driver.
- *
- * Copyright 2007 by Apple Inc.
- * Copyright 1997-2005 by Easy Software Products.
- *
- * Licensed under Apache License v2.0.  See the file "LICENSE" for more information.
- */
+//
+// This file contains model number definitions for the CUPS sample
+// label printer driver.
+//
+// Copyright 2007 by Apple Inc.
+// Copyright 1997-2005 by Easy Software Products.
+//
+// Licensed under Apache License v2.0.  See the file "LICENSE" for more
+// information.
+//
 
-#define DYMO_3x0       0               /* Dymo Labelwriter 300/330/330 Turbo */
+#define DYMO_3x0       0               // Dymo Labelwriter 300/330/330 Turbo
 
-#define ZEBRA_EPL_LINE  0x10            /* Zebra EPL line mode printers */
-#define ZEBRA_EPL_PAGE  0x11            /* Zebra EPL page mode printers */
-#define ZEBRA_ZPL       0x12            /* Zebra ZPL-based printers */
-#define ZEBRA_CPCL      0x13            /* Zebra CPCL-based printers */
+#define ZEBRA_EPL_LINE  0x10            // Zebra EPL line mode printers
+#define ZEBRA_EPL_PAGE  0x11            // Zebra EPL page mode printers
+#define ZEBRA_ZPL       0x12            // Zebra ZPL-based printers
+#define ZEBRA_CPCL      0x13            // Zebra CPCL-based printers
 
-#define INTELLITECH_PCL        0x20            /* Intellitech PCL-based printers */
+#define INTELLITECH_PCL        0x20            // Intellitech PCL-based printers
index 529c476a3924dccf390c4f88ba3b9aa021b4cc51..5bf96fc9322f977aac86d3a4a4784cfe0fe91746 100644 (file)
@@ -1,63 +1,64 @@
-/*
- * Private localization support for libppd.
- *
- * Copyright © 2007-2018 by Apple Inc.
- * Copyright © 1997-2006 by Easy Software Products.
- *
- * Licensed under Apache License v2.0.  See the file "LICENSE" for more
- * information.
- */
+//
+// Private localization support functions for libppd.
+//
+// Copyright © 2007-2018 by Apple Inc.
+// Copyright © 1997-2006 by Easy Software Products.
+//
+// Licensed under Apache License v2.0.  See the file "LICENSE" for more
+// information.
+//
 
 #ifndef _PPD_LANGUAGE_PRIVATE_H_
 #  define _PPD_LANGUAGE_PRIVATE_H_
 
-/*
- * Include necessary headers...
- */
+//
+// Include necessary headers...
+//
 
 #  include "config.h"
 #  include <stdio.h>
 #  include <cups/transcode.h>
 #  ifdef __APPLE__
 #    include <CoreFoundation/CoreFoundation.h>
-#  endif /* __APPLE__ */
+#  endif // __APPLE__
 
 #  ifdef __cplusplus
 extern "C" {
-#  endif /* __cplusplus */
+#  endif // __cplusplus
 
 
-/*
- * Macro for localized text...
- */
+//
+// Macro for localized text...
+//
 
 #  define _(x) x
 
 
-/*
- * Constants...
- */
+//
+// Constants...
+//
 
-#  define _PPD_MESSAGE_PO      0       /* Message file is in GNU .po format */
-#  define _PPD_MESSAGE_UNQUOTE 1       /* Unescape \foo in strings? */
-#  define _PPD_MESSAGE_STRINGS 2       /* Message file is in Apple .strings format */
-#  define _PPD_MESSAGE_EMPTY   4       /* Allow empty localized strings */
+#  define _PPD_MESSAGE_PO      0       // Message file is in GNU .po format
+#  define _PPD_MESSAGE_UNQUOTE 1       // Unescape \foo in strings?
+#  define _PPD_MESSAGE_STRINGS 2       // Message file is in Apple .strings
+                                       // format
+#  define _PPD_MESSAGE_EMPTY   4       // Allow empty localized strings
 
 
-/*
- * Types...
- */
+//
+// Types...
+//
 
-typedef struct _ppd_message_s          /**** Message catalog entry ****/
+typedef struct _ppd_message_s          // **** Message catalog entry ****
 {
-  char *msg,                           /* Original string */
-       *str;                           /* Localized string */
+  char *msg,                           // Original string
+       *str;                           // Localized string
 } _ppd_message_t;
 
 
-/*
- * Prototypes...
- */
+//
+// Prototypes...
+//
 
 extern const char      *_ppdLangString(cups_lang_t *lang, const char *message);
 extern void            _ppdMessageFree(cups_array_t *a);
@@ -68,6 +69,6 @@ extern cups_array_t   *_ppdMessageNew(void *context);
 
 #  ifdef __cplusplus
 }
-#  endif /* __cplusplus */
+#  endif // __cplusplus
 
-#endif /* !_PPD_LANGUAGE_PRIVATE_H_ */
+#endif // !_PPD_LANGUAGE_PRIVATE_H_
index 9b960a0ed15b8a6e635e117c45e4c2c01f1ee776..513ca12e21ea3ad49b8f591bf8633ca3ad3f3f63 100644 (file)
@@ -1,15 +1,16 @@
-/*
- * I18N/language support for libppd.
- *
- * Copyright 2007-2017 by Apple Inc.
- * Copyright 1997-2007 by Easy Software Products.
- *
- * Licensed under Apache License v2.0.  See the file "LICENSE" for more information.
- */
-
-/*
- * Include necessary headers...
- */
+//
+// I18N/language support for libppd.
+//
+// Copyright 2007-2017 by Apple Inc.
+// Copyright 1997-2007 by Easy Software Products.
+//
+// Licensed under Apache License v2.0.  See the file "LICENSE" for more
+// information.
+//
+
+//
+// Include necessary headers...
+//
 
 #include "string-private.h"
 #include "language-private.h"
 #include "debug-internal.h"
 #ifdef HAVE_LANGINFO_H
 #  include <langinfo.h>
-#endif /* HAVE_LANGINFO_H */
+#endif // HAVE_LANGINFO_H
 #ifdef _WIN32
 #  include <io.h>
 #else
 #  include <unistd.h>
-#endif /* _WIN32 */
+#endif // _WIN32
 #ifdef HAVE_COREFOUNDATION_H
 #  include <CoreFoundation/CoreFoundation.h>
-#endif /* HAVE_COREFOUNDATION_H */
+#endif // HAVE_COREFOUNDATION_H
 #include <cups/file.h>
 
 
-/*
- * Local globals...
- */
+//
+// Local globals...
+//
 
 static _ppd_mutex_t    lang_mutex = _PPD_MUTEX_INITIALIZER;
-                                       /* Mutex to control access to cache */
+                                       // Mutex to control access to cache
 
 #ifdef __APPLE__
 typedef struct
 {
-  const char * const language;         /* Language ID */
-  const char * const locale;           /* Locale ID */
+  const char * const language;         // Language ID
+  const char * const locale;           // Locale ID
 } _apple_language_locale_t;
 
 static const _apple_language_locale_t apple_language_locale[] =
-{                                      /* Language to locale ID LUT */
+{                                      // Language to locale ID LUT
   { "en",         "en_US" },
   { "nb",         "no" },
   { "nb_NO",      "no" },
@@ -54,13 +55,12 @@ static const _apple_language_locale_t apple_language_locale[] =
   { "zh_HANT",    "zh_TW" },
   { "zh-Hant_CN", "zh_TW" }
 };
-#endif /* __APPLE__ */
+#endif // __APPLE__
 
 
-/*
- * Local functions...
- */
-
+//
+// Local functions...
+//
 
 #ifdef __APPLE__
 static const char      *appleLangDefault(void);
@@ -70,11 +70,11 @@ static const char   *appleLangDefault(void);
 #        define CF_RETURNS_RETAINED __attribute__((cf_returns_retained))
 #      else
 #        define CF_RETURNS_RETAINED
-#      endif /* __has_feature(attribute_cf_returns_retained) */
-#    endif /* !CF_RETURNED_RETAINED */
+#      endif // __has_feature(attribute_cf_returns_retained)
+#    endif // !CF_RETURNED_RETAINED
 static cups_array_t    *appleMessageLoad(const char *locale) CF_RETURNS_RETAINED;
-#  endif /* CUPS_BUNDLEDIR */
-#endif /* __APPLE__ */
+#  endif // CUPS_BUNDLEDIR
+#endif // __APPLE__
 static int             ppd_message_compare(_ppd_message_t *m1, _ppd_message_t *m2);
 static void            ppd_message_free(_ppd_message_t *m);
 static void            ppd_message_load(cups_lang_t *lang);
@@ -82,34 +82,35 @@ static int          ppd_read_strings(cups_file_t *fp, int flags, cups_array_t *a);
 static void            ppd_unquote(char *d, const char *s);
 
 
-/*
- * '_ppdLangString()' - Get a message string.
- *
- * The returned string is UTF-8 encoded; use cupsUTF8ToCharset() to
- * convert the string to the language encoding.
- */
+//
+// '_ppdLangString()' - Get a message string.
+//
+// The returned string is UTF-8 encoded; use cupsUTF8ToCharset() to
+// convert the string to the language encoding.
+//
 
-const char *                           /* O - Localized message */
-_ppdLangString(cups_lang_t *lang,      /* I - Language */
-                const char  *message)  /* I - Message */
+const char *                           // O - Localized message
+_ppdLangString(cups_lang_t *lang,      // I - Language
+               const char  *message)   // I - Message
 {
-  const char *s;                       /* Localized message */
+  const char *s;                       // Localized message
 
 
-  DEBUG_printf(("_ppdLangString(lang=%p, message=\"%s\")", (void *)lang, message));
+  DEBUG_printf(("_ppdLangString(lang=%p, message=\"%s\")",
+               (void *)lang, message));
 
- /*
-  * Range check input...
-  */
+  //
+  // Range check input...
+  //
 
   if (!lang || !message || !*message)
     return (message);
 
   _ppdMutexLock(&lang_mutex);
 
- /*
-  * Load the message catalog if needed...
-  */
+  //
+  // Load the message catalog if needed...
+  //
 
   if (!lang->strings)
     ppd_message_load(lang);
@@ -122,53 +123,53 @@ _ppdLangString(cups_lang_t *lang, /* I - Language */
 }
 
 
-/*
- * '_ppdMessageFree()' - Free a messages array.
- */
+//
+// '_ppdMessageFree()' - Free a messages array.
+//
 
 void
-_ppdMessageFree(cups_array_t *a)       /* I - Message array */
+_ppdMessageFree(cups_array_t *a)       // I - Message array
 {
 #if defined(__APPLE__) && defined(CUPS_BUNDLEDIR)
- /*
-  * Release the cups.strings dictionary as needed...
-  */
+  //
+  // Release the cups.strings dictionary as needed...
+  //
 
   if (cupsArrayUserData(a))
     CFRelease((CFDictionaryRef)cupsArrayUserData(a));
-#endif /* __APPLE__ && CUPS_BUNDLEDIR */
+#endif // __APPLE__ && CUPS_BUNDLEDIR
 
- /*
-  * Free the array...
-  */
+  //
+  // Free the array...
+  //
 
   cupsArrayDelete(a);
 }
 
 
-/*
- * '_ppdMessageLoad()' - Load a .po or .strings file into a messages array.
- */
+//
+// '_ppdMessageLoad()' - Load a .po or .strings file into a messages array.
+//
 
-cups_array_t *                         /* O - New message array */
-_ppdMessageLoad(const char *filename,  /* I - Message catalog to load */
-                 int        flags)     /* I - Load flags */
+cups_array_t *                         // O - New message array
+_ppdMessageLoad(const char *filename,  // I - Message catalog to load
+                int        flags)      // I - Load flags
 {
-  cups_file_t          *fp;            /* Message file */
-  cups_array_t         *a;             /* Message array */
-  _ppd_message_t       *m;             /* Current message */
-  char                 s[4096],        /* String buffer */
-                       *ptr,           /* Pointer into buffer */
-                       *temp;          /* New string */
-  size_t               length,         /* Length of combined strings */
-                       ptrlen;         /* Length of string */
+  cups_file_t          *fp;            // Message file
+  cups_array_t         *a;             // Message array
+  _ppd_message_t       *m;             // Current message
+  char                 s[4096],        // String buffer
+                       *ptr,           // Pointer into buffer
+                       *temp;          // New string
+  size_t               length,         // Length of combined strings
+                       ptrlen;         // Length of string
 
 
   DEBUG_printf(("4_ppdMessageLoad(filename=\"%s\")", filename));
 
- /*
-  * Create an array to hold the messages...
-  */
+  //
+  // Create an array to hold the messages...
+  //
 
   if ((a = _ppdMessageNew(NULL)) == NULL)
   {
@@ -176,9 +177,9 @@ _ppdMessageLoad(const char *filename,       /* I - Message catalog to load */
     return (NULL);
   }
 
- /*
-  * Open the message catalog file...
-  */
+  //
+  // Open the message catalog file...
+  //
 
   if ((fp = cupsFileOpen(filename, "r")) == NULL)
   {
@@ -193,80 +194,78 @@ _ppdMessageLoad(const char *filename,     /* I - Message catalog to load */
   }
   else
   {
-   /*
-    * Read messages from the catalog file until EOF...
-    *
-    * The format is the GNU gettext .po format, which is fairly simple:
-    *
-    *     msgid "some text"
-    *     msgstr "localized text"
-    *
-    * The ID and localized text can span multiple lines using the form:
-    *
-    *     msgid ""
-    *     "some long text"
-    *     msgstr ""
-    *     "localized text spanning "
-    *     "multiple lines"
-    */
+    //
+    // Read messages from the catalog file until EOF...
+    //
+    // The format is the GNU gettext .po format, which is fairly simple:
+    //
+    //     msgid "some text"
+    //     msgstr "localized text"
+    //
+    // The ID and localized text can span multiple lines using the form:
+    //
+    //     msgid ""
+    //     "some long text"
+    //     msgstr ""
+    //     "localized text spanning "
+    //     "multiple lines"
+    //
 
     m = NULL;
 
     while (cupsFileGets(fp, s, sizeof(s)) != NULL)
     {
-     /*
-      * Skip blank and comment lines...
-      */
+      //
+      // Skip blank and comment lines...
+      //
 
       if (s[0] == '#' || !s[0])
        continue;
 
-     /*
-      * Strip the trailing quote...
-      */
+      //
+      // Strip the trailing quote...
+      //
 
       if ((ptr = strrchr(s, '\"')) == NULL)
        continue;
 
       *ptr = '\0';
 
-     /*
-      * Find start of value...
-      */
+      //
+      // Find start of value...
+      //
 
       if ((ptr = strchr(s, '\"')) == NULL)
        continue;
 
       ptr ++;
 
-     /*
-      * Unquote the text...
-      */
+      //
+      // Unquote the text...
+      //
 
       if (flags & _PPD_MESSAGE_UNQUOTE)
        ppd_unquote(ptr, ptr);
 
-     /*
-      * Create or add to a message...
-      */
+      //
+      // Create or add to a message...
+      //
 
       if (!strncmp(s, "msgid", 5))
       {
-       /*
-       * Add previous message as needed...
-       */
+       //
+       // Add previous message as needed...
+       //
 
        if (m)
        {
          if (m->str && (m->str[0] || (flags & _PPD_MESSAGE_EMPTY)))
-         {
            cupsArrayAdd(a, m);
-         }
          else
          {
-          /*
-           * Translation is empty, don't add it... (STR #4033)
-           */
+           //
+           // Translation is empty, don't add it... (STR #4033)
+           //
 
            free(m->msg);
            if (m->str)
@@ -275,9 +274,9 @@ _ppdMessageLoad(const char *filename,       /* I - Message catalog to load */
          }
        }
 
-       /*
-       * Create a new message with the given msgid string...
-       */
+       //
+       // Create a new message with the given msgid string...
+       //
 
        if ((m = (_ppd_message_t *)calloc(1, sizeof(_ppd_message_t))) == NULL)
          break;
@@ -291,14 +290,15 @@ _ppdMessageLoad(const char *filename,     /* I - Message catalog to load */
       }
       else if (s[0] == '\"' && m)
       {
-       /*
-       * Append to current string...
-       */
+       //
+       // Append to current string...
+       //
 
        length = strlen(m->str ? m->str : m->msg);
        ptrlen = strlen(ptr);
 
-       if ((temp = realloc(m->str ? m->str : m->msg, length + ptrlen + 1)) == NULL)
+       if ((temp = realloc(m->str ? m->str : m->msg,
+                           length + ptrlen + 1)) == NULL)
        {
          if (m->str)
            free(m->str);
@@ -310,11 +310,11 @@ _ppdMessageLoad(const char *filename,     /* I - Message catalog to load */
 
        if (m->str)
        {
-        /*
-         * Copy the new portion to the end of the msgstr string - safe
-         * to use memcpy because the buffer is allocated to the correct
-         * size...
-         */
+         //
+         // Copy the new portion to the end of the msgstr string - safe
+         // to use memcpy because the buffer is allocated to the correct
+         // size...
+         //
 
          m->str = temp;
 
@@ -322,11 +322,11 @@ _ppdMessageLoad(const char *filename,     /* I - Message catalog to load */
        }
        else
        {
-        /*
-         * Copy the new portion to the end of the msgid string - safe
-         * to use memcpy because the buffer is allocated to the correct
-         * size...
-         */
+         //
+         // Copy the new portion to the end of the msgid string - safe
+         // to use memcpy because the buffer is allocated to the correct
+         // size...
+         //
 
          m->msg = temp;
 
@@ -335,9 +335,9 @@ _ppdMessageLoad(const char *filename,       /* I - Message catalog to load */
       }
       else if (!strncmp(s, "msgstr", 6) && m)
       {
-       /*
-       * Set the string...
-       */
+       //
+       // Set the string...
+       //
 
        if ((m->str = strdup(ptr)) == NULL)
        {
@@ -349,21 +349,19 @@ _ppdMessageLoad(const char *filename,     /* I - Message catalog to load */
       }
     }
 
-   /*
-    * Add the last message string to the array as needed...
-    */
+    //
+    // Add the last message string to the array as needed...
+    //
 
     if (m)
     {
       if (m->str && (m->str[0] || (flags & _PPD_MESSAGE_EMPTY)))
-      {
        cupsArrayAdd(a, m);
-      }
       else
       {
-       /*
-       * Translation is empty, don't add it... (STR #4033)
-       */
+       //
+       // Translation is empty, don't add it... (STR #4033)
+       //
 
        free(m->msg);
        if (m->str)
@@ -373,36 +371,37 @@ _ppdMessageLoad(const char *filename,     /* I - Message catalog to load */
     }
   }
 
- /*
-  * Close the message catalog file and return the new array...
-  */
+  //
+  // Close the message catalog file and return the new array...
+  //
 
   cupsFileClose(fp);
 
-  DEBUG_printf(("5_ppdMessageLoad: Returning %d messages...", cupsArrayCount(a)));
+  DEBUG_printf(("5_ppdMessageLoad: Returning %d messages...",
+               cupsArrayCount(a)));
 
   return (a);
 }
 
 
-/*
- * '_ppdMessageLookup()' - Lookup a message string.
- */
+//
+// '_ppdMessageLookup()' - Lookup a message string.
+//
 
-const char *                           /* O - Localized message */
-_ppdMessageLookup(cups_array_t *a,     /* I - Message array */
-                   const char   *m)    /* I - Message */
+const char *                           // O - Localized message
+_ppdMessageLookup(cups_array_t *a,     // I - Message array
+                   const char   *m)    // I - Message
 {
-  _ppd_message_t       key,            /* Search key */
-                       *match;         /* Matching message */
+  _ppd_message_t       key,            // Search key
+                       *match;         // Matching message
 
 
   DEBUG_printf(("_ppdMessageLookup(a=%p, m=\"%s\")", (void *)a, m));
 
- /*
-  * Lookup the message string; if it doesn't exist in the catalog,
-  * then return the message that was passed to us...
-  */
+  //
+  // Lookup the message string; if it doesn't exist in the catalog,
+  // then return the message that was passed to us...
+  //
 
   key.msg = (char *)m;
   match   = (_ppd_message_t *)cupsArrayFind(a, &key);
@@ -410,28 +409,30 @@ _ppdMessageLookup(cups_array_t *a,        /* I - Message array */
 #if defined(__APPLE__) && defined(CUPS_BUNDLEDIR)
   if (!match && cupsArrayUserData(a))
   {
-   /*
-    * Try looking the string up in the cups.strings dictionary...
-    */
+    //
+    // Try looking the string up in the cups.strings dictionary...
+    //
 
-    CFDictionaryRef    dict;           /* cups.strings dictionary */
-    CFStringRef                cfm,            /* Message as a CF string */
-                       cfstr;          /* Localized text as a CF string */
+    CFDictionaryRef    dict;           // cups.strings dictionary
+    CFStringRef                cfm,            // Message as a CF string
+                       cfstr;          // Localized text as a CF string
 
     dict       = (CFDictionaryRef)cupsArrayUserData(a);
-    cfm        = CFStringCreateWithCString(kCFAllocatorDefault, m, kCFStringEncodingUTF8);
+    cfm        = CFStringCreateWithCString(kCFAllocatorDefault, m,
+                                          kCFStringEncodingUTF8);
     match      = calloc(1, sizeof(_ppd_message_t));
     match->msg = strdup(m);
     cfstr      = cfm ? CFDictionaryGetValue(dict, cfm) : NULL;
 
     if (cfstr)
     {
-      char     buffer[1024];           /* Message buffer */
+      char     buffer[1024];           // Message buffer
 
       CFStringGetCString(cfstr, buffer, sizeof(buffer), kCFStringEncodingUTF8);
       match->str = strdup(buffer);
 
-      DEBUG_printf(("1_ppdMessageLookup: Found \"%s\" as \"%s\"...", m, buffer));
+      DEBUG_printf(("1_ppdMessageLookup: Found \"%s\" as \"%s\"...",
+                   m, buffer));
     }
     else
     {
@@ -445,7 +446,7 @@ _ppdMessageLookup(cups_array_t *a,  /* I - Message array */
     if (cfm)
       CFRelease(cfm);
   }
-#endif /* __APPLE__ && CUPS_BUNDLEDIR */
+#endif // __APPLE__ && CUPS_BUNDLEDIR
 
   if (match && match->str)
     return (match->str);
@@ -454,12 +455,12 @@ _ppdMessageLookup(cups_array_t *a,        /* I - Message array */
 }
 
 
-/*
- * '_ppdMessageNew()' - Make a new message catalog array.
- */
+//
+// '_ppdMessageNew()' - Make a new message catalog array.
+//
 
-cups_array_t *                         /* O - Array */
-_ppdMessageNew(void *context)          /* I - User data */
+cups_array_t *                         // O - Array
+_ppdMessageNew(void *context)          // I - User data
 {
   return (cupsArrayNew3((cups_array_func_t)ppd_message_compare, context,
                         (cups_ahash_func_t)NULL, 0,
@@ -468,25 +469,25 @@ _ppdMessageNew(void *context)             /* I - User data */
 }
 
 
-/*
- * 'ppd_message_compare()' - Compare two messages.
- */
+//
+// 'ppd_message_compare()' - Compare two messages.
+//
 
-static int                             /* O - Result of comparison */
+static int                     // O - Result of comparison
 ppd_message_compare(
-    _ppd_message_t *m1,                /* I - First message */
-    _ppd_message_t *m2)                /* I - Second message */
+    _ppd_message_t *m1,                // I - First message
+    _ppd_message_t *m2)                // I - Second message
 {
   return (strcmp(m1->msg, m2->msg));
 }
 
 
-/*
- * 'ppd_message_free()' - Free a message.
- */
+//
+// 'ppd_message_free()' - Free a message.
+//
 
 static void
-ppd_message_free(_ppd_message_t *m)    /* I - Message */
+ppd_message_free(_ppd_message_t *m)    // I - Message
 {
   if (m->msg)
     free(m->msg);
@@ -498,26 +499,27 @@ ppd_message_free(_ppd_message_t *m)       /* I - Message */
 }
 
 
-/*
- * 'ppd_message_load()' - Load the message catalog for a language.
- */
+//
+// 'ppd_message_load()' - Load the message catalog for a language.
+//
 
 static void
-ppd_message_load(cups_lang_t *lang)    /* I - Language */
+ppd_message_load(cups_lang_t *lang)    // I - Language
 {
 #if defined(__APPLE__) && defined(CUPS_BUNDLEDIR)
   lang->strings = appleMessageLoad(lang->language);
 
 #else
-  char                 filename[1024]; /* Filename for language locale file */
-  char                 localedir[1003];/* Filename for language locale dir */
+  char                 filename[1024]; // Filename for language locale file
+  char                 localedir[1003];// Filename for language locale dir
   char                 *p;
 
-  /* Directory supplied by environment variable CUPS_LOCALEDIR */
+  // Directory supplied by environment variable CUPS_LOCALEDIR
   if ((p = getenv("CUPS_LOCALEDIR")) != NULL)
     strncpy (localedir, p, sizeof(localedir) - 1);
-  else {
-    /* Determine CUPS datadir (usually /usr/share/cups) */
+  else
+  {
+    // Determine CUPS datadir (usually /usr/share/cups)
     if ((p = getenv("CUPS_DATADIR")) == NULL)
       p = CUPS_DATADIR;
     snprintf(localedir, sizeof(localedir), "%s/locale", p);
@@ -528,18 +530,18 @@ ppd_message_load(cups_lang_t *lang)       /* I - Language */
 
   if (strchr(lang->language, '_') && access(filename, 0))
   {
-   /*
-    * Country localization not available, look for generic localization...
-    */
+    //
+    // Country localization not available, look for generic localization...
+    //
 
     snprintf(filename, sizeof(filename), "%s/%.2s/cups_%.2s.po", localedir,
              lang->language, lang->language);
 
     if (access(filename, 0))
     {
-     /*
-      * No generic localization, so use POSIX...
-      */
+      //
+      // No generic localization, so use POSIX...
+      //
 
       DEBUG_printf(("4ppd_message_load: access(\"%s\", 0): %s", filename,
                     strerror(errno)));
@@ -548,47 +550,47 @@ ppd_message_load(cups_lang_t *lang)       /* I - Language */
     }
   }
 
- /*
-  * Read the strings from the file...
-  */
+  //
+  // Read the strings from the file...
+  //
 
   lang->strings = _ppdMessageLoad(filename, _PPD_MESSAGE_UNQUOTE);
-#endif /* __APPLE__ && CUPS_BUNDLEDIR */
+#endif // __APPLE__ && CUPS_BUNDLEDIR
 }
 
 
-/*
- * 'ppd_read_strings()' - Read a pair of strings from a .strings file.
- */
+//
+// 'ppd_read_strings()' - Read a pair of strings from a .strings file.
+//
 
-static int                             /* O - 1 on success, 0 on failure */
-ppd_read_strings(cups_file_t  *fp,     /* I - .strings file */
-                  int          flags,  /* I - CUPS_MESSAGE_xxx flags */
-                 cups_array_t *a)      /* I - Message catalog array */
+static int                             // O - 1 on success, 0 on failure
+ppd_read_strings(cups_file_t  *fp,     // I - .strings file
+                  int          flags,  // I - CUPS_MESSAGE_xxx flags
+                 cups_array_t *a)      // I - Message catalog array
 {
-  char                 buffer[8192],   /* Line buffer */
-                       *bufptr,        /* Pointer into buffer */
-                       *msg,           /* Pointer to start of message */
-                       *str;           /* Pointer to start of translation string */
-  _ppd_message_t       *m;             /* New message */
+  char                 buffer[8192],   // Line buffer
+                       *bufptr,        // Pointer into buffer
+                       *msg,           // Pointer to start of message
+                       *str;           // Pointer to start of translation string
+  _ppd_message_t       *m;             // New message
 
 
   while (cupsFileGets(fp, buffer, sizeof(buffer)))
   {
-   /*
-    * Skip any line (comments, blanks, etc.) that isn't:
-    *
-    *   "message" = "translation";
-    */
+    //
+    // Skip any line (comments, blanks, etc.) that isn't:
+    //
+    //   "message" = "translation";
+    //
 
     for (bufptr = buffer; *bufptr && isspace(*bufptr & 255); bufptr ++);
 
     if (*bufptr != '\"')
       continue;
 
-   /*
-    * Find the end of the message...
-    */
+    //
+    // Find the end of the message...
+    //
 
     bufptr ++;
     for (msg = bufptr; *bufptr && *bufptr != '\"'; bufptr ++)
@@ -603,9 +605,9 @@ ppd_read_strings(cups_file_t  *fp,  /* I - .strings file */
     if (flags & _PPD_MESSAGE_UNQUOTE)
       ppd_unquote(msg, msg);
 
-   /*
-    * Find the start of the translation...
-    */
+    //
+    // Find the start of the translation...
+    //
 
     while (*bufptr && isspace(*bufptr & 255))
       bufptr ++;
@@ -620,9 +622,9 @@ ppd_read_strings(cups_file_t  *fp,  /* I - .strings file */
     if (*bufptr != '\"')
       continue;
 
-   /*
-    * Find the end of the translation...
-    */
+    //
+    // Find the end of the translation...
+    //
 
     bufptr ++;
     for (str = bufptr; *bufptr && *bufptr != '\"'; bufptr ++)
@@ -637,9 +639,9 @@ ppd_read_strings(cups_file_t  *fp,  /* I - .strings file */
     if (flags & _PPD_MESSAGE_UNQUOTE)
       ppd_unquote(str, str);
 
-   /*
-    * If we get this far we have a valid pair of strings, add them...
-    */
+    //
+    // If we get this far we have a valid pair of strings, add them...
+    //
 
     if ((m = malloc(sizeof(_ppd_message_t))) == NULL)
       break;
@@ -648,9 +650,7 @@ ppd_read_strings(cups_file_t  *fp,  /* I - .strings file */
     m->str = strdup(str);
 
     if (m->msg && m->str)
-    {
       cupsArrayAdd(a, m);
-    }
     else
     {
       if (m->msg)
@@ -666,21 +666,21 @@ ppd_read_strings(cups_file_t  *fp,        /* I - .strings file */
     return (1);
   }
 
- /*
-  * No more strings...
-  */
+  //
+  // No more strings...
+  //
 
   return (0);
 }
 
 
-/*
- * 'ppd_unquote()' - Unquote characters in strings...
- */
+//
+// 'ppd_unquote()' - Unquote characters in strings...
+//
 
 static void
-ppd_unquote(char       *d,             /* O - Unquoted string */
-             const char *s)            /* I - Original string */
+ppd_unquote(char       *d,             // O - Unquoted string
+             const char *s)            // I - Original string
 {
   while (*s)
   {
index 08f67bf6fbaac3b75673d2753a3d44107e22934e..137d7a026e97b0ce8910fabc0877897edc804138 100644 (file)
@@ -1,24 +1,24 @@
-/*
- * PDF-to-PostScript filter function for libppd.
- *
- * Copyright 2011-2020 by Till Kamppeter
- * Copyright 2007-2011 by Apple Inc.
- * Copyright 1997-2006 by Easy Software Products.
- *
- * Licensed under Apache License v2.0.  See the file "LICENSE" for more
- * information.
- *
- * Contents:
- *
- *   parsePDFTOPDFComment() - Check whether we are executed after pdftopdf
- *   remove_options()       - Remove unwished entries from an option list
- *   log_command_line()     - Log the command line of a program which we call
- *   ppdFilterPDFToPS()              - pdftops filter function
- */
-
-/*
- * Include necessary headers...
- */
+//
+// PDF-to-PostScript filter function for libppd.
+//
+// Copyright 2011-2020 by Till Kamppeter
+// Copyright 2007-2011 by Apple Inc.
+// Copyright 1997-2006 by Easy Software Products.
+//
+// Licensed under Apache License v2.0.  See the file "LICENSE" for more
+// information.
+//
+// Contents:
+//
+//   parsePDFTOPDFComment() - Check whether we are executed after pdftopdf
+//   remove_options()       - Remove unwished entries from an option list
+//   log_command_line()     - Log the command line of a program which we call
+//   ppdFilterPDFToPS()     - pdftops filter function
+//
+
+//
+// Include necessary headers...
+//
 
 #include <config.h>
 #include <cups/cups.h>
 
 #define MAX_CHECK_COMMENT_LINES        20
 
-/*
- * Type definitions
- */
+//
+// Type definitions
+//
 
 typedef unsigned renderer_t;
-enum renderer_e {GS = 0, PDFTOPS = 1, ACROREAD = 2, PDFTOCAIRO = 3, MUPDF = 4,
-                HYBRID = 5};
+enum renderer_e
+{
+  GS         = 0,
+  PDFTOPS    = 1,
+  ACROREAD   = 2,
+  PDFTOCAIRO = 3,
+  MUPDF      = 4,
+  HYBRID     = 5
+};
 
 
-/*
- * When calling the "pstops" filter we exclude the following options from its
- * command line as we have applied these options already to the PDF input,
- * either on the "pdftops"/Ghostscript call in this filter or by use of the
- * "pdftopdf" filter before this filter.
- */
+//
+// When calling the "pstops" filter we exclude the following options from its
+// command line as we have applied these options already to the PDF input,
+// either on the "pdftops"/Ghostscript call in this filter or by use of the
+// "pdftopdf" filter before this filter.
+//
 
-const char *pstops_exclude_general[] = {
+const char *pstops_exclude_general[] =
+{
   "crop-to-fit",
   "fill",
   "fitplot",
@@ -65,7 +73,8 @@ const char *pstops_exclude_general[] = {
   NULL
 };
 
-const char *pstops_exclude_page_management[] = {
+const char *pstops_exclude_page_management[] =
+{
   "brightness",
   "Collate",
   "even-duplex",
@@ -94,83 +103,90 @@ const char *pstops_exclude_page_management[] = {
   NULL
 };
 
-
-/*
- * Check whether we were called after the "pdftopdf" filter and extract
- * parameters passed over by "pdftopdf" in the header comments of the PDF
- * file
- */
+//
+// Check whether we were called after the "pdftopdf" filter and extract
+// parameters passed over by "pdftopdf" in the header comments of the PDF
+// file
+//
 
 static void
-parse_pdftopdf_comment(char *filename,       /* I - Input file */
-                                int *pdftopdfapplied, /* O - Does the input
-                                                             data come from
-                                                             pdftopdf filter?*/
-                                char *deviceCopies,   /* O - Number of copies
-                                                             (hardware) */
-                                int *deviceCollate,   /* O - Hardware collate*/
-                                cf_logfunc_t log, /* I - Log function */
-                                void *ld)             /* I - Aux. data for
-                                                             log function */
+parse_pdftopdf_comment(char *filename,         // I - Input file
+                      int *pdftopdfapplied,    // O - Does the input
+                                               //     data come from
+                                               //     pdftopdf filter?
+                      char *deviceCopies,      // O - Number of copies
+                                               //     (hardware)
+                      int *deviceCollate,      // O - Hardware collate
+                      cf_logfunc_t log,        // I - Log function
+                      void *ld)                // I - Aux. data for
+                                               //     log function
 {
   char buf[4096];
   int i;
   FILE *fp;
 
-  if ((fp = fopen(filename,"rb")) == NULL) {
+  if ((fp = fopen(filename, "rb")) == NULL)
+  {
     if (log) log(ld, CF_LOGLEVEL_ERROR,
                 "ppdFilterPDFToPS: Cannot open input file \"%s\"",
                 filename);
     return;
   }
 
-  /* skip until PDF start header */
-  while (fgets(buf,sizeof(buf),fp) != 0) {
-    if (strncmp(buf,"%PDF",4) == 0) {
+  // skip until PDF start header
+  while (fgets(buf, sizeof(buf), fp) != 0)
+  {
+    if (strncmp(buf, "%PDF", 4) == 0)
       break;
-    }
   }
-  for (i = 0;i < MAX_CHECK_COMMENT_LINES;i++) {
-    if (fgets(buf,sizeof(buf),fp) == 0) break;
-    if (strncmp(buf,"%%PDFTOPDFNumCopies",19) == 0) {
+  for (i = 0; i < MAX_CHECK_COMMENT_LINES; i ++)
+  {
+    if (fgets(buf, sizeof(buf), fp) == 0)
+      break;
+    if (strncmp(buf, "%%PDFTOPDFNumCopies", 19) == 0)
+    {
       char *p;
 
-      p = strchr(buf+19,':') + 1;
-      while (*p == ' ' || *p == '\t') p++;
+      p = strchr(buf + 19, ':') + 1;
+      while (*p == ' ' || *p == '\t')
+       p ++;
       strncpy(deviceCopies, p, 31);
       deviceCopies[31] = '\0';
       p = deviceCopies + strlen(deviceCopies) - 1;
-      while (*p == ' ' || *p == '\t'  || *p == '\r'  || *p == '\n') p--;
+      while (*p == ' ' || *p == '\t'  || *p == '\r'  || *p == '\n')
+       p --;
       *(p + 1) = '\0';
       *pdftopdfapplied = 1;
-    } else if (strncmp(buf,"%%PDFTOPDFCollate",17) == 0) {
+    }
+    else if (strncmp(buf, "%%PDFTOPDFCollate", 17) == 0)
+    {
       char *p;
 
-      p = strchr(buf+17,':') + 1;
-      while (*p == ' ' || *p == '\t') p++;
-      if (strncasecmp(p,"true",4) == 0) {
+      p = strchr(buf + 17, ':') + 1;
+      while (*p == ' ' || *p == '\t')
+       p ++;
+      if (strncasecmp(p, "true", 4) == 0)
        *deviceCollate = 1;
-      } else {
+      else
        *deviceCollate = 0;
-      }
-      *pdftopdfapplied = 1;
-    } else if (strcmp(buf,"% This file was generated by pdftopdf") == 0) {
       *pdftopdfapplied = 1;
     }
+    else if (strcmp(buf, "% This file was generated by pdftopdf") == 0)
+      *pdftopdfapplied = 1;
   }
 
   fclose(fp);
 }
 
 
-/*
- * Check whether given file is empty
- */
+//
+// Check whether given file is empty
+//
 
-static int                     /* O - Result: 1: Empty; 0: Contains pages */
-is_empty(char *filename,       /* I - Input file */
-        cf_logfunc_t log, /* I - Log function */
-        void *ld)             /* I - Auxiliary data for log function */
+static int                     // O - Result: 1: Empty; 0: Contains pages
+is_empty(char *filename,       // I - Input file
+        cf_logfunc_t log,     // I - Log function
+        void *ld)             // I - Auxiliary data for log function
 {
   FILE *fp = NULL;
   fp = fopen(filename, "rb");
@@ -179,42 +195,44 @@ is_empty(char *filename,       /* I - Input file */
     if (log) log(ld, CF_LOGLEVEL_ERROR,
                 "ppdFilterPDFToPS: Cannot open input file \"%s\"",
                 filename);
-    return 1;
+    return (1);
   }
   else
   {
     char buf[1];
     rewind(fp);
-    if (fread(buf, 1, 1, fp) == 0) {
+    if (fread(buf, 1, 1, fp) == 0)
+    {
       fclose(fp);
       if (log) log(ld, CF_LOGLEVEL_DEBUG,
                   "ppdFilterPDFToPS: Input is empty, outputting empty file.");
-      return 1;
+      return (1);
     }
     fclose(fp);
     int pages = cfPDFPages(filename);
-    if (pages == 0) {
+    if (pages == 0)
+    {
       if (log) log(ld, CF_LOGLEVEL_DEBUG,
                   "ppdFilterPDFToPS: No pages left, outputting empty file.");
-      return 1;
+      return (1);
     }
     if (pages > 0)
-      return 0;
-    return 1;
+      return (0);
+    return (1);
   }
 }
 
 
-/*
- * Before calling any command line utility, log its command line in CUPS'
- * debug mode
- */
+//
+// Before calling any command line utility, log its command line in CUPS'
+// debug mode
+//
 
 void
-log_command_line(const char* file,     /* I - Program to be executed */
-                char *const argv[],   /* I - Argument list */
-                cf_logfunc_t log, /* I - Log function */
-                void *ld)             /* I - Auxiliary data for log function */
+log_command_line(const char* file,     // I - Program to be executed
+                char *const argv[],   // I - Argument list
+                cf_logfunc_t log,     // I - Log function
+                void *ld)             // I - Auxiliary data for log function
 {
   int i;
   char *apos;
@@ -223,13 +241,15 @@ log_command_line(const char* file,     /* I - Program to be executed */
   if (log == NULL)
     return;
 
-  /* Debug output: Full command line of program to be called */
-  snprintf(buf, sizeof(buf) - 1, "ppdFilterPDFToPS: Running command line for %s:",
+  // Debug output: Full command line of program to be called
+  snprintf(buf, sizeof(buf) - 1,
+          "ppdFilterPDFToPS: Running command line for %s:",
           (file ? file : argv[0]));
   if (file)
     snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf) - 1,
             " %s", file);
-  for (i = (file ? 1 : 0); argv[i]; i ++) {
+  for (i = (file ? 1 : 0); argv[i]; i ++)
+  {
     if ((strchr(argv[i],' ')) || (strchr(argv[i],'\t')))
       apos = "'";
     else
@@ -243,93 +263,96 @@ log_command_line(const char* file,     /* I - Program to be executed */
 }
 
 
-/*
- * 'ppdFilterPDFToPS()' - Filter function to convert PDF input into
- *               PostScript to be printed on PostScript printers
- */
+//
+// 'ppdFilterPDFToPS()' - Filter function to convert PDF input into
+//                        PostScript to be printed on PostScript printers
+//
 
-int                          /* O - Error status */
-ppdFilterPDFToPS(int inputfd,         /* I - File descriptor input stream */
-       int outputfd,        /* I - File descriptor output stream */
-       int inputseekable,   /* I - Is input stream seekable? (unused) */
-       cf_filter_data_t *data, /* I - Job and printer data */
-       void *parameters)    /* I - Filter-specific parameters (unused) */
+int                                    // O - Error status
+ppdFilterPDFToPS(int inputfd,          // I - File descriptor input stream
+                int outputfd,          // I - File descriptor output stream
+                int inputseekable,     // I - Is input stream seekable?
+                                       //     (unused)
+                cf_filter_data_t *data,// I - Job and printer data
+                void *parameters)      // I - Filter-specific parameters
+                                       //     (unused)
 {
   ppd_filter_data_ext_t *filter_data_ext =
     (ppd_filter_data_ext_t *)cfFilterDataGetExt(data,
                                                PPD_FILTER_DATA_EXT);
-  renderer_t    renderer = CUPS_PDFTOPS_RENDERER; /* Renderer: gs or pdftops
-                                                    or acroread or pdftocairo
-                                                    or hybrid */
-  FILE          *inputfp;              /* Input file pointer */
-  int          fd = 0;                 /* Copy file descriptor */
+  renderer_t    renderer = CUPS_PDFTOPS_RENDERER; // Renderer: gs or pdftops
+                                                 // or acroread or pdftocairo
+                                                 // or hybrid
+  FILE          *inputfp;              // Input file pointer
+  int          fd = 0;                 // Copy file descriptor
   int           i, j;
-  int          pdftopdfapplied = 0;    /* Input data from pdftopdf filter? */
-  char         deviceCopies[32] = "1"; /* Hardware copies */
-  int          deviceCollate = 0;      /* Hardware collate */
-  char          make_model[128] = "";   /* Printer make and model (for quirks)*/
-  char         *filename,              /* PDF file to convert */
-               tempfile[1024];         /* Temporary file */
-  char         buffer[8192];           /* Copy buffer */
-  int          bytes;                  /* Bytes copied */
-  int          num_options = 0,                /* Number of options */
-                num_pstops_options;    /* Number of options for pstops */
-  cups_option_t        *options = NULL,                /* Options */
-                *pstops_options,       /* Options for pstops filter function */
+  int          pdftopdfapplied = 0;    // Input data from pdftopdf filter?
+  char         deviceCopies[32] = "1"; // Hardware copies
+  int          deviceCollate = 0;      // Hardware collate
+  char          make_model[128] = "";   // Printer make and model (for quirks)
+  char         *filename,              // PDF file to convert
+               tempfile[1024];         // Temporary file
+  char         buffer[8192];           // Copy buffer
+  int          bytes;                  // Bytes copied
+  int          num_options = 0,        // Number of options
+                num_pstops_options;    // Number of options for pstops
+  cups_option_t        *options = NULL,        // Options
+                *pstops_options,       // Options for pstops filter function
                 *option;
   const char    *exclude;
   cf_filter_data_t pstops_filter_data;
   int           ret;
-  const char   *val;                   /* Option value */
-  ppd_file_t   *ppd = NULL;            /* PPD file */
-  char         resolution[128] = "";   /* Output resolution */
-  int           xres = 0, yres = 0,     /* resolution values */
+  const char   *val;                   // Option value
+  ppd_file_t   *ppd = NULL;            // PPD file
+  char         resolution[128] = "";   // Output resolution
+  int           xres = 0, yres = 0,     // resolution values
                 mres, res,
                 maxres = CUPS_PDFTOPS_MAX_RESOLUTION,
-                                        /* Maximum image rendering resolution */
-                numvalues = 0;          /* Number of values actually read */
+                                        // Maximum image rendering resolution
+                numvalues = 0;          // Number of values actually read
   ppd_choice_t  *choice;
   ppd_attr_t    *attr;
   cups_page_header2_t header;
-  cups_file_t  *fp;                    /* Post-processing input file */
-  int          pdf_pid,                /* Process ID for pdftops/gs */
-               pdf_argc = 0,           /* Number of args for pdftops/gs */
-               pstops_pid = 0,         /* Process ID of pstops filter */
-               pstops_pipe[2],         /* Pipe to pstops filter */
-               need_post_proc = 0,     /* Post-processing needed? */
-               post_proc_pid = 0,      /* Process ID of post-processing */
-               post_proc_pipe[2],      /* Pipe to post-processing */
-               wait_children,          /* Number of child processes left */
-               wait_pid,               /* Process ID from wait() */
-               wait_status,            /* Status from child */
-               exit_status = 0;        /* Exit status */
-  int gray_output = 0; /* Checking for monochrome/grayscale PostScript output */
-  char         *pdf_argv[100],         /* Arguments for pdftops/gs */
-               *ptr;                   /* Pointer into value */
-  int          duplex, tumble;         /* Duplex settings for PPD-less
-                                          printing */
+  cups_file_t  *fp;                    // Post-processing input file
+  int          pdf_pid,                // Process ID for pdftops/gs
+               pdf_argc = 0,           // Number of args for pdftops/gs
+               pstops_pid = 0,         // Process ID of pstops filter
+               pstops_pipe[2],         // Pipe to pstops filter
+               need_post_proc = 0,     // Post-processing needed?
+               post_proc_pid = 0,      // Process ID of post-processing
+               post_proc_pipe[2],      // Pipe to post-processing
+               wait_children,          // Number of child processes left
+               wait_pid,               // Process ID from wait()
+               wait_status,            // Status from child
+               exit_status = 0;        // Exit status
+  int          gray_output = 0;        // Checking for monochrome/grayscale
+                                       // PostScript output
+  char         *pdf_argv[100],         // Arguments for pdftops/gs
+               *ptr;                   // Pointer into value
+  int          duplex, tumble;         // Duplex settings for PPD-less
+                                       // printing
   cups_cspace_t cspace = (cups_cspace_t)(-1);
-  cf_logfunc_t log = data->logfunc;
-  void          *ld = data->logdata;
+  cf_logfunc_t log = data->logfunc;
+  void         *ld = data->logdata;
   cf_filter_iscanceledfunc_t iscanceled = data->iscanceledfunc;
-  void          *icd = data->iscanceleddata;
-  ipp_t *printer_attrs = data->printer_attrs;
-  ipp_t *job_attrs = data->job_attrs;
+  void         *icd = data->iscanceleddata;
+  ipp_t                *printer_attrs = data->printer_attrs;
+  ipp_t                *job_attrs = data->job_attrs;
   ipp_attribute_t *ipp;
 
 
   (void)inputseekable;
   (void)parameters;
 
- /*
-  * Ignore broken pipe signals...
-  */
+  //
+  // Ignore broken pipe signals...
+  //
 
   signal(SIGPIPE, SIG_IGN);
 
- /*
-  * Open the input data stream specified by the inputfd...
-  */
+  //
+  // Open the input data stream specified by the inputfd...
+  //
 
   if ((inputfp = fdopen(inputfd, "r")) == NULL)
   {
@@ -342,9 +365,9 @@ ppdFilterPDFToPS(int inputfd,         /* I - File descriptor input stream */
     return (1);
   }
 
- /*
-  * Copy input into temporary file ...
-  */
+  //
+  // Copy input into temporary file ...
+  //
 
   if ((fd = cupsTempFd(tempfile, sizeof(tempfile))) < 0)
   {
@@ -369,10 +392,10 @@ ppdFilterPDFToPS(int inputfd,         /* I - File descriptor input stream */
 
   filename = tempfile;
 
- /*
-  * Stop on empty or zero-pages files without error, perhaps we eliminated
-  * all pages via the "page-ranges" option and a previous filter
-  */
+  //
+  // Stop on empty or zero-pages files without error, perhaps we eliminated
+  // all pages via the "page-ranges" option and a previous filter
+  //
 
   if (is_empty(filename, log, ld))
   {
@@ -380,16 +403,16 @@ ppdFilterPDFToPS(int inputfd,         /* I - File descriptor input stream */
     return 0;
   }
 
- /*
-  * Read out copy counts and collate setting passed over by pdftopdf
-  */
+  //
+  // Read out copy counts and collate setting passed over by pdftopdf
+  //
 
   parse_pdftopdf_comment(filename, &pdftopdfapplied, deviceCopies,
                         &deviceCollate, log, ld);
 
- /*
-  * CUPS option list
-  */
+  //
+  // CUPS option list
+  //
 
   num_options = cfJoinJobOptionsAndAttrs(data, num_options, &options);
   
@@ -397,9 +420,9 @@ ppdFilterPDFToPS(int inputfd,         /* I - File descriptor input stream */
   if (filter_data_ext)
     ppd = filter_data_ext->ppd;
 
- /*
-  * Process job options...
-  */
+  //
+  // Process job options...
+  //
 
   if ((val = cupsGetOption("make-and-model", num_options, options)) != NULL)
   {
@@ -409,15 +432,19 @@ ppdFilterPDFToPS(int inputfd,         /* I - File descriptor input stream */
     for (ptr = make_model; *ptr; ptr ++)
       if (*ptr == '-') *ptr = ' ';
   }
-  else if(printer_attrs){
-    if((ipp = ippFindAttribute(printer_attrs, "printer-make-and-model", IPP_TAG_ZERO))!=NULL){
+  else if(printer_attrs)
+  {
+    if ((ipp = ippFindAttribute(printer_attrs, "printer-make-and-model",
+                               IPP_TAG_ZERO)) != NULL)
+    {
       char make[56];
       char* model;
       ippAttributeString(ipp, make, sizeof(make));
       if (!strncasecmp(make, "Hewlett Packard ", 16) ||
-        !strncasecmp(make, "Hewlett-Packard ", 16)) {
-          model = make + 16;
-          strncpy(make, "HP", sizeof(make));
+         !strncasecmp(make, "Hewlett-Packard ", 16))
+      {
+       model = make + 16;
+       strncpy(make, "HP", sizeof(make));
       }
       else if ((model = strchr(make, ' ')) != NULL)
         *model++ = '\0';
@@ -435,12 +462,12 @@ ppdFilterPDFToPS(int inputfd,         /* I - File descriptor input stream */
   if (log) log(ld, CF_LOGLEVEL_DEBUG,
               "ppdFilterPDFToPS: Printer make and model: %s", make_model);
 
- /*
-  * Select the PDF renderer: Ghostscript (gs), Poppler (pdftops),
-  * Adobe Reader (arcoread), Poppler with Cairo (pdftocairo), or
-  * Hybrid (hybrid, Poppler for Brother, Minolta, Konica Minolta, Dell, and
-  * old HP LaserJets and Ghostscript otherwise)
-  */
+  //
+  // Select the PDF renderer: Ghostscript (gs), Poppler (pdftops),
+  // Adobe Reader (arcoread), Poppler with Cairo (pdftocairo), or
+  // Hybrid (hybrid, Poppler for Brother, Minolta, Konica Minolta, Dell, and
+  // old HP LaserJets and Ghostscript otherwise)
+  //
 
   if ((val = cupsGetOption("pdftops-renderer", num_options, options)) != NULL)
   {
@@ -480,13 +507,15 @@ ppdFilterPDFToPS(int inputfd,         /* I - File descriptor input stream */
     }
     else
       renderer = GS;
-   /*
-    * Use Poppler instead of Ghostscript for old HP LaserJet printers due to
-    * a bug in their PS interpreters. They are very slow with Ghostscript.
-    * A LaserJet is considered old if its model number does not have a letter
-    * in the beginning, like LaserJet 3 or LaserJet 4000, not LaserJet P2015.
-    * See https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=742765
-    */
+
+    //
+    // Use Poppler instead of Ghostscript for old HP LaserJet printers due to
+    // a bug in their PS interpreters. They are very slow with Ghostscript.
+    // A LaserJet is considered old if its model number does not have a letter
+    // in the beginning, like LaserJet 3 or LaserJet 4000, not LaserJet P2015.
+    // See https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=742765
+    //
+
     if (make_model[0] &&
        ((!strncasecmp(make_model, "HP", 2) ||
          !strncasecmp(make_model, "Hewlett-Packard", 15) ||
@@ -498,8 +527,9 @@ ppdFilterPDFToPS(int inputfd,         /* I - File descriptor input stream */
        if (isspace(*ptr)) continue;
        if (isdigit(*ptr))
        {
-         while (*ptr && isalnum(*ptr)) ptr ++;
-         if (!*ptr) /* End of string, no further word */
+         while (*ptr && isalnum(*ptr))
+           ptr ++;
+         if (!*ptr) // End of string, no further word
          {
            if (log) log(ld, CF_LOGLEVEL_DEBUG,
                         "ppdFilterPDFToPS: Switching to Poppler's pdftops instead of "
@@ -515,25 +545,29 @@ ppdFilterPDFToPS(int inputfd,         /* I - File descriptor input stream */
     }
   }
 
- /*
-  * Create option list for pstops filter function, stripping options which
-  * "pstops" does not need to apply any more
-  */
+  //
+  // Create option list for pstops filter function, stripping options which
+  // "pstops" does not need to apply any more
+  //
 
   num_pstops_options = 0;
   pstops_options = NULL;
   for (i = num_options, option = options; i > 0; i --, option ++)
   {
     for (j = 0, exclude = pstops_exclude_general[j]; exclude;
-        j++, exclude = pstops_exclude_general[j])
-      if (!strcasecmp(option->name, exclude)) break;
-    if (exclude) continue;
+        j ++, exclude = pstops_exclude_general[j])
+      if (!strcasecmp(option->name, exclude))
+       break;
+    if (exclude)
+      continue;
     if (pdftopdfapplied)
     {
       for (j = 0, exclude = pstops_exclude_page_management[j]; exclude;
           j++, exclude = pstops_exclude_page_management[j])
-       if (!strcasecmp(option->name, exclude)) break;
-      if (exclude) continue;
+       if (!strcasecmp(option->name, exclude))
+         break;
+      if (exclude)
+       continue;
     }
     num_pstops_options = cupsAddOption(option->name,
                                       option->value,
@@ -542,19 +576,19 @@ ppdFilterPDFToPS(int inputfd,         /* I - File descriptor input stream */
 
   if (pdftopdfapplied && deviceCollate)
   {
-   /*
-    * Add collate option to the pstops call if pdftopdf has found out that the
-    * printer does hardware collate.
-    */
+    //
+    // Add collate option to the pstops call if pdftopdf has found out that the
+    // printer does hardware collate.
+    //
 
     num_pstops_options = cupsAddOption("Collate",
                                       "True",
                                       num_pstops_options, &pstops_options);
   }
 
- /*
-  * Create data record to call the pstops filter function
-  */
+  //
+  // Create data record to call the pstops filter function
+  //
 
   pstops_filter_data.job_id = data->job_id;
   pstops_filter_data.job_user = data->job_user;
@@ -573,62 +607,71 @@ ppdFilterPDFToPS(int inputfd,         /* I - File descriptor input stream */
   pstops_filter_data.iscanceledfunc = iscanceled;
   pstops_filter_data.iscanceleddata = icd;
 
- /*
-  * Force monochrome/grayscale PostScript output 
-  * if job is to be printed in monochrome/grayscale
-  */
-  if (ppd && ppd->color_device == 0)  /* Monochrome printer */
+  //
+  // Force monochrome/grayscale PostScript output 
+  // if job is to be printed in monochrome/grayscale
+  //
+
+  if (ppd && ppd->color_device == 0)  // Monochrome printer
     gray_output = 1;
-  else  /*Color Printer - user option for Grayscale */
+  else  //Color Printer - user option for Grayscale
   {
     if ((val = cupsGetOption("pwg-raster-document-type", num_options,
-               options)) != NULL ||
-      (val = cupsGetOption("PwgRasterDocumentType", num_options,
-               options)) != NULL ||
-      (val = cupsGetOption("print-color-mode", num_options,
-               options)) != NULL ||
-      (val = cupsGetOption("PrintColorMode", num_options,
-               options)) != NULL ||
-      (val = cupsGetOption("color-space", num_options,
-               options)) != NULL ||
-      (val = cupsGetOption("ColorSpace", num_options,
-               options)) != NULL ||
-      (val = cupsGetOption("color-model", num_options,
-               options)) != NULL ||
-      (val = cupsGetOption("ColorModel", num_options,
-               options)) != NULL ||
-      (val = cupsGetOption("output-mode", num_options,
-               options)) != NULL ||
-      (val = cupsGetOption("OutputMode", num_options,
-               options)) != NULL)
+                            options)) != NULL ||
+       (val = cupsGetOption("PwgRasterDocumentType", num_options,
+                            options)) != NULL ||
+       (val = cupsGetOption("print-color-mode", num_options,
+                            options)) != NULL ||
+       (val = cupsGetOption("PrintColorMode", num_options,
+                            options)) != NULL ||
+       (val = cupsGetOption("color-space", num_options,
+                            options)) != NULL ||
+       (val = cupsGetOption("ColorSpace", num_options,
+                            options)) != NULL ||
+       (val = cupsGetOption("color-model", num_options,
+                            options)) != NULL ||
+       (val = cupsGetOption("ColorModel", num_options,
+                            options)) != NULL ||
+       (val = cupsGetOption("output-mode", num_options,
+                            options)) != NULL ||
+       (val = cupsGetOption("OutputMode", num_options,
+                            options)) != NULL)
+    {
+      if (strcasestr(val, "Black") ||
+         strcasestr(val, "Gray") ||
+         strcasestr(val, "Mono"))
+       gray_output = 1;
+    }
+    else
+    {
+      if(job_attrs != NULL)
       {
-          if (strcasestr(val, "Black") ||
-             strcasestr(val, "Gray") ||
-             strcasestr(val, "Mono"))
-            gray_output = 1;
-      }
-      else{
-        if(job_attrs!=NULL){
-          if((ipp = ippFindAttribute(job_attrs, "pwg-raster-document-type", IPP_TAG_ZERO))!=NULL ||
-            (ipp = ippFindAttribute(job_attrs, "color-space", IPP_TAG_ZERO))!=NULL ||
-            (ipp = ippFindAttribute(job_attrs, "color-model", IPP_TAG_ZERO))!=NULL ||
-            (ipp = ippFindAttribute(job_attrs, "print-color-mode", IPP_TAG_ZERO))!=NULL ||
-            (ipp = ippFindAttribute(job_attrs, "output-mode", IPP_TAG_ZERO))){
-              ippAttributeString(ipp, buffer, sizeof(buffer));
-              val = buffer;
-              if(strcasestr(val, "Black") ||
-                (strcasestr(val, "Gray")) ||
-                (strcasestr(val, "Mono")))
-                  gray_output = 1;
-            }
-        }
+       if ((ipp = ippFindAttribute(job_attrs, "pwg-raster-document-type",
+                                   IPP_TAG_ZERO)) != NULL ||
+           (ipp = ippFindAttribute(job_attrs, "color-space",
+                                   IPP_TAG_ZERO)) != NULL ||
+           (ipp = ippFindAttribute(job_attrs, "color-model",
+                                   IPP_TAG_ZERO)) != NULL ||
+           (ipp = ippFindAttribute(job_attrs, "print-color-mode",
+                                   IPP_TAG_ZERO)) != NULL ||
+           (ipp = ippFindAttribute(job_attrs, "output-mode",
+                                   IPP_TAG_ZERO)) != NULL)
+       {
+         ippAttributeString(ipp, buffer, sizeof(buffer));
+         val = buffer;
+         if(strcasestr(val, "Black") ||
+            (strcasestr(val, "Gray")) ||
+            (strcasestr(val, "Mono")))
+           gray_output = 1;
+       }
       }
+    }
   }
 
- /*
-  * Build the command-line for the ppdFilterPDFToPS, gs, mutool, pdftocairo, or
-  * acroread filter...
-  */
+  //
+  // Build the command-line for the ppdFilterPDFToPS, gs, mutool, pdftocairo, or
+  // acroread filter...
+  //
 
   if (renderer == PDFTOPS)
   {
@@ -648,11 +691,11 @@ ppdFilterPDFToPS(int inputfd,         /* I - File descriptor input stream */
     pdf_argv[7] = (char *)"-sDEVICE=ps2write";
 #    else
     pdf_argv[7] = (char *)"-sDEVICE=pswrite";
-#    endif /* HAVE_GHOSTSCRIPT_PS2WRITE */
+#    endif // HAVE_GHOSTSCRIPT_PS2WRITE
     pdf_argv[8] = (char *)"-dShowAcroForm";
     pdf_argv[9] = (char *)"-sOUTPUTFILE=%stdout";
-    if (gray_output == 1) /* Checking for monochrome/grayscale PostScript
-                            output */
+    if (gray_output == 1) // Checking for monochrome/grayscale PostScript
+                          // output
     {
       pdf_argv[10] = (char *)"-sProcessColorModel=DeviceGray";
       pdf_argv[11] = (char *)"-sColorConversionStrategy=Gray";
@@ -669,8 +712,8 @@ ppdFilterPDFToPS(int inputfd,         /* I - File descriptor input stream */
     pdf_argv[3] = (char *)"-smtf";
     pdf_argv[4] = (char *)"-Fps";
     pdf_argv[5] = (char *)"-o-";
-    if (gray_output == 1) /* Checking for monochrome/grayscale PostScript
-                            output */
+    if (gray_output == 1) // Checking for monochrome/grayscale PostScript
+                          // output
       pdf_argv[6] = (char *)"-cgray";
     else
       pdf_argv[6] = (char *)"-crgb";
@@ -689,9 +732,9 @@ ppdFilterPDFToPS(int inputfd,         /* I - File descriptor input stream */
     pdf_argc    = 2;
   }
 
- /*
-  * Set language level and TrueType font handling...
-  */
+  //
+  // Set language level and TrueType font handling...
+  //
 
   if (ppd)
   {
@@ -731,18 +774,18 @@ ppdFilterPDFToPS(int inputfd,         /* I - File descriptor input stream */
       }
       else if (renderer == GS)
        pdf_argv[pdf_argc++] = (char *)"-dLanguageLevel=2";
-      else if (renderer != MUPDF) /* MuPDF is PS level 2 only */
-       /* PDFTOCAIRO, ACROREAD */
+      else if (renderer != MUPDF) // MuPDF is PS level 2 only
+       // PDFTOCAIRO, ACROREAD
         pdf_argv[pdf_argc++] = (char *)"-level2";
     }
     else
     {
       if (renderer == PDFTOPS)
       {
-        /* Do not emit PS Level 3 with Poppler on Brother and HP PostScript
-          laser printers as some do not like it.
-          See https://bugs.launchpad.net/bugs/277404 and
-          https://bugs.launchpad.net/bugs/1306849 comment #42. */
+        // Do not emit PS Level 3 with Poppler on Brother and HP PostScript
+       // laser printers as some do not like it.
+       // See https://bugs.launchpad.net/bugs/277404 and
+       // https://bugs.launchpad.net/bugs/1306849 comment #42.
        if (!make_model[0] ||
            !strncasecmp(make_model, "Brother", 7) ||
            ((!strncasecmp(make_model, "HP", 2) ||
@@ -755,9 +798,9 @@ ppdFilterPDFToPS(int inputfd,         /* I - File descriptor input stream */
       }
       else if (renderer == GS)
       {
-        /* Do not emit PS Level 3 with Ghostscript on Brother PostScript
-          laser printers as some do not like it.
-          See https://bugs.launchpad.net/bugs/1306849 comment #42. */
+        // Do not emit PS Level 3 with Ghostscript on Brother PostScript
+       // laser printers as some do not like it.
+       // See https://bugs.launchpad.net/bugs/1306849 comment #42.
        if (!make_model[0] ||
            !strncasecmp(make_model, "Brother", 7))
          pdf_argv[pdf_argc++] = (char *)"-dLanguageLevel=2";
@@ -769,7 +812,7 @@ ppdFilterPDFToPS(int inputfd,         /* I - File descriptor input stream */
        if (log) log(ld, CF_LOGLEVEL_WARN,
                     "ppdFilterPDFToPS: Level 3 PostScript not supported by mutool.");
       }
-      else /* PDFTOCAIRO || ACROREAD */
+      else // PDFTOCAIRO || ACROREAD
         pdf_argv[pdf_argc++] = (char *)"-level3";
     }
   }
@@ -777,8 +820,8 @@ ppdFilterPDFToPS(int inputfd,         /* I - File descriptor input stream */
   {
     if (renderer == PDFTOPS)
     {
-      /* Do not emit PS Level 3 with Poppler on HP PostScript laser printers
-        as some do not like it. See https://bugs.launchpad.net/bugs/277404.*/
+      // Do not emit PS Level 3 with Poppler on HP PostScript laser printers
+      // as some do not like it. See https://bugs.launchpad.net/bugs/277404.
       if (!make_model[0] ||
          ((!strncasecmp(make_model, "HP", 2) ||
            !strncasecmp(make_model, "Hewlett-Packard", 15) ||
@@ -791,45 +834,45 @@ ppdFilterPDFToPS(int inputfd,         /* I - File descriptor input stream */
     }
     else if (renderer == GS)
       pdf_argv[pdf_argc++] = (char *)"-dLanguageLevel=3";
-    else if (renderer != MUPDF) /* MuPDF is PS level 2 only */
-      /* PDFTOCAIRO || ACROREAD */
+    else if (renderer != MUPDF) // MuPDF is PS level 2 only
+      // PDFTOCAIRO || ACROREAD
       pdf_argv[pdf_argc++] = (char *)"-level3";
   }
 
 #ifdef HAVE_POPPLER_PDFTOPS_WITH_ORIGPAGESIZES
   if ((renderer == PDFTOPS) || (renderer == PDFTOCAIRO))
   {
-   /*
-     Use the page sizes of the original PDF document, this way documents
-     which contain pages of different sizes can be printed correctly
-    */
+    //
+    // Use the page sizes of the original PDF document, this way documents
+    // which contain pages of different sizes can be printed correctly
+    //
 
     pdf_argv[pdf_argc++] = (char *)"-origpagesizes";
     pdf_argv[pdf_argc++] = (char *)"-nocenter";
   }
   else
-#endif /* HAVE_POPPLER_PDFTOPS_WITH_ORIGPAGESIZES */
+#endif // HAVE_POPPLER_PDFTOPS_WITH_ORIGPAGESIZES
   if (renderer == ACROREAD)
   {
-   /*
-    * Use the page sizes of the original PDF document, this way documents
-    * which contain pages of different sizes can be printed correctly
-    */
+    //
+    // Use the page sizes of the original PDF document, this way documents
+    // which contain pages of different sizes can be printed correctly
+    //
 
     pdf_argv[pdf_argc++] = (char *)"-choosePaperByPDFPageSize";
   }
 
- /*
-  * Set output resolution ...
-  */
+  //
+  // Set output resolution ...
+  //
 
   if (ppd)
   {
-    /* Ignore error exits of ppdRasterInterpretPPD(), if it found a resolution
-       setting before erroring it is OK for us */
+    // Ignore error exits of ppdRasterInterpretPPD(), if it found a resolution
+    // setting before erroring it is OK for us
     ppdRasterInterpretPPD(&header, ppd, num_options, options, NULL);
-    /* 100 dpi is default, this means that if we have 100 dpi here this
-       method failed to find the printing resolution */
+    // 100 dpi is default, this means that if we have 100 dpi here this
+    // method failed to find the printing resolution
     resolution[0] = '\0';
     if (header.HWResolution[0] != 100 || header.HWResolution[1] != 100)
     {
@@ -851,7 +894,8 @@ ppdFilterPDFToPS(int inputfd,         /* I - File descriptor input stream */
            "ppdFilterPDFToPS: No resolution information found in the PPD file.");
     }
   }
-  else{
+  else
+  {
     cfRasterPrepareHeader(&header, data, CF_FILTER_OUT_FORMAT_CUPS_RASTER,
                          CF_FILTER_OUT_FORMAT_CUPS_RASTER, 0, &cspace);
     if (header.HWResolution[0] > 100 && header.HWResolution[1] > 100)
@@ -859,36 +903,43 @@ ppdFilterPDFToPS(int inputfd,         /* I - File descriptor input stream */
       xres = header.HWResolution[0];
       yres = header.HWResolution[1];
     }
-    else if((ipp = ippFindAttribute(printer_attrs, "printer-resolution-default", IPP_TAG_ZERO))!=NULL){
+    else if ((ipp = ippFindAttribute(printer_attrs,
+                                    "printer-resolution-default",
+                                    IPP_TAG_ZERO)) != NULL)
+    {
       ippAttributeString(ipp, buffer, sizeof(buffer));
       const char *p = buffer;
       xres = atoi(p);
-      if((p = strchr(p, 'x'))!=NULL){
-        yres = atoi(p+1);
-      }
-      else yres = xres;
+      if ((p = strchr(p, 'x')) != NULL)
+        yres = atoi(p + 1);
+      else
+       yres = xres;
     }
-    else if((ipp = ippFindAttribute(printer_attrs, "printer-resolution-supported", IPP_TAG_ZERO))!=NULL){
+    else if ((ipp = ippFindAttribute(printer_attrs,
+                                    "printer-resolution-supported",
+                                    IPP_TAG_ZERO))!=NULL){
       ippAttributeString(ipp, buffer, sizeof(buffer));
-      for(i=0; buffer[i]!='\0';i++){
-        if(buffer[i]==' ' ||
-          buffer[i]==','){
-            buffer[i]='\0';
-            break;
-          }
+      for (i = 0; buffer[i] != '\0'; i ++)
+      {
+        if(buffer[i] == ' ' ||
+          buffer[i] == ',')
+       {
+         buffer[i] = '\0';
+         break;
+       }
       }
       const char *p = buffer;
       xres = atoi(p);
-      if((p = strchr(p, 'x'))!=NULL){
-        yres = atoi(p+1);
-      }
-      else yres = xres;
+      if((p = strchr(p, 'x')) != NULL)
+        yres = atoi(p + 1);
+      else
+       yres = xres;
     }
   }
   if ((xres == 0) && (yres == 0))
   {
     if ((val = cupsGetOption("printer-resolution", num_options,
-                          options)) != NULL ||
+                            options)) != NULL ||
        (val = cupsGetOption("Resolution", num_options, options)) != NULL)
     {
       xres = yres = strtol(val, (char **)&ptr, 10);
@@ -930,9 +981,9 @@ ppdFilterPDFToPS(int inputfd,         /* I - File descriptor input stream */
   else
     res = 300;
 
- /*
-  * Get the ceiling for the image rendering resolution
-  */
+  //
+  // Get the ceiling for the image rendering resolution
+  //
 
   if ((val = cupsGetOption("pdftops-max-image-resolution",
                           num_options, options)) != NULL)
@@ -946,12 +997,12 @@ ppdFilterPDFToPS(int inputfd,         /* I - File descriptor input stream */
                   val);
   }
 
- /*
-  * Reduce the image rendering resolution to not exceed a given maximum
-  * to make processing of jobs by the PDF->PS converter and the printer faster
-  *
-  * maxres = 0 means no limit
-  */
+  //
+  // Reduce the image rendering resolution to not exceed a given maximum
+  // to make processing of jobs by the PDF->PS converter and the printer faster
+  //
+  // maxres = 0 means no limit
+  //
 
   if (maxres)
     while (res > maxres)
@@ -960,32 +1011,37 @@ ppdFilterPDFToPS(int inputfd,         /* I - File descriptor input stream */
   if ((renderer == PDFTOPS) || (renderer == PDFTOCAIRO))
   {
 #ifdef HAVE_POPPLER_PDFTOPS_WITH_RESOLUTION
-   /*
-    * Set resolution to avoid slow processing by the printer when the
-    * resolution of embedded images does not match the printer's resolution
-    */
+    //
+    // Set resolution to avoid slow processing by the printer when the
+    // resolution of embedded images does not match the printer's resolution
+    //
+
     pdf_argv[pdf_argc++] = (char *)"-r";
     snprintf(resolution, sizeof(resolution), "%d", res);
     pdf_argv[pdf_argc++] = resolution;
     if (log) log(ld, CF_LOGLEVEL_DEBUG,
-                "ppdFilterPDFToPS: Using image rendering resolution %d dpi", res);
-#endif /* HAVE_POPPLER_PDFTOPS_WITH_RESOLUTION */
-    if (gray_output == 1) /* Checking for monochrome/grayscale PostScript
-                            output */
+                "ppdFilterPDFToPS: Using image rendering resolution %d dpi",
+                res);
+#endif // HAVE_POPPLER_PDFTOPS_WITH_RESOLUTION
+    if (gray_output == 1) // Checking for monochrome/grayscale PostScript
+                          // output
     {
-      /* Poppler does not explicitly support turning colored PDF files into
-        grayscale PostScript. As a workaround, one could let the "pdftops"
-         command line utility generate PostScript level 1 output which is
-         always grayscale, but output files get huge and printing too 
-         slow.
-        Recommended solution is to not use Poppler as PDF renderer for
-        printing, especially if one uses a color PostScript printer and
-        wants to have the possibility to print jobs also in grayscale.
-        See the use of the "pdftops-renderer" option in the README file. */
-      /* Example code for PostScript level1 workaround: */
-      /* pdf_argv[1] = (char *)"-level1";
-        pdf_argv[pdf_argc++] = (char *)"-optimizecolorspace"; */
-      /* Issue a warning message when printing a grayscale job with Poppler */
+      //
+      // Poppler does not explicitly support turning colored PDF files into
+      // grayscale PostScript. As a workaround, one could let the "pdftops"
+      // command line utility generate PostScript level 1 output which is
+      // always grayscale, but output files get huge and printing too 
+      // slow.
+      // Recommended solution is to not use Poppler as PDF renderer for
+      // printing, especially if one uses a color PostScript printer and
+      // wants to have the possibility to print jobs also in grayscale.
+      // See the use of the "pdftops-renderer" option in the README file.
+      // Example code for PostScript level1 workaround:
+      // pdf_argv[1] = (char *)"-level1";
+      // pdf_argv[pdf_argc++] = (char *)"-optimizecolorspace";
+      //
+
+      // Issue a warning message when printing a grayscale job with Poppler
       if (log) log(ld, CF_LOGLEVEL_WARN,
                   "ppdFilterPDFToPS: Grayscale/monochrome printing requested for this "
                   "job but Poppler is not able to convert to "
@@ -1000,22 +1056,26 @@ ppdFilterPDFToPS(int inputfd,         /* I - File descriptor input stream */
   }
   else if (renderer == GS)
   {
-   /*
-    * Set resolution to avoid slow processing by the printer when the
-    * resolution of embedded images does not match the printer's resolution
-    */
+    //
+    // Set resolution to avoid slow processing by the printer when the
+    // resolution of embedded images does not match the printer's resolution
+    //
+
     snprintf(resolution, 127, "-r%d", res);
     pdf_argv[pdf_argc++] = resolution;
     if (log) log(ld, CF_LOGLEVEL_DEBUG,
-                "ppdFilterPDFToPS: Using image rendering resolution %d dpi", res);
-   /*
-    * PostScript debug mode: If you send a job with "lpr -o psdebug" Ghostscript
-    * will not compress the pages, so that the PostScript code can get
-    * analysed. This is especially important if a PostScript printer errors or
-    * misbehaves on Ghostscript's output.
-    * On Kyocera and Utax (uses Kyocera hard- and software) printers we always
-    * suppress page compression, to avoid slow processing of raster images.
-    */
+                "ppdFilterPDFToPS: Using image rendering resolution %d dpi",
+                res);
+    //
+    // PostScript debug mode: If you send a job with "lpr -o psdebug"
+    // Ghostscript will not compress the pages, so that the PostScript
+    // code can get analysed. This is especially important if a
+    // PostScript printer errors or misbehaves on Ghostscript's
+    // output. On Kyocera and Utax (uses Kyocera hard- and software)
+    // printers we always suppress page compression, to avoid slow
+    // processing of raster images.
+    //
+
     val = cupsGetOption("psdebug", num_options, options);
     if ((val && strcasecmp(val, "no") && strcasecmp(val, "off") &&
         strcasecmp(val, "false")) ||
@@ -1029,12 +1089,14 @@ ppdFilterPDFToPS(int inputfd,         /* I - File descriptor input stream */
                   "or Kyocera/Utax printer)");
       pdf_argv[pdf_argc++] = (char *)"-dCompressPages=false";
     }
-   /*
-    * The PostScript interpreters on many printers have bugs which make
-    * the interpreter crash, error out, or otherwise misbehave on too
-    * heavily compressed input files, especially if code with compressed
-    * elements is compressed again. Therefore we reduce compression here.
-    */
+
+    //
+    // The PostScript interpreters on many printers have bugs which make
+    // the interpreter crash, error out, or otherwise misbehave on too
+    // heavily compressed input files, especially if code with compressed
+    // elements is compressed again. Therefore we reduce compression here.
+    //
+
     pdf_argv[pdf_argc++] = (char *)"-dCompressFonts=false";
     pdf_argv[pdf_argc++] = (char *)"-dNoT3CCITT";
     if (make_model[0] &&
@@ -1046,13 +1108,15 @@ ppdFilterPDFToPS(int inputfd,         /* I - File descriptor input stream */
       pdf_argv[pdf_argc++] = (char *)"-dEncodeMonoImages=false";
       pdf_argv[pdf_argc++] = (char *)"-dEncodeColorImages=false";
     }
-   /*
-    * Toshiba's PS interpreters have an issue with how we handle
-    * TrueType/Type42 fonts, therefore we add command line options to turn
-    * the TTF outlines into bitmaps, usually Type 3 PostScript fonts, only
-    * large glyphs into normal image data.
-    * See https://bugs.launchpad.net/bugs/978120
-    */
+
+    //
+    // Toshiba's PS interpreters have an issue with how we handle
+    // TrueType/Type42 fonts, therefore we add command line options to turn
+    // the TTF outlines into bitmaps, usually Type 3 PostScript fonts, only
+    // large glyphs into normal image data.
+    // See https://bugs.launchpad.net/bugs/978120
+    //
+
     if (make_model[0] &&
        !strncasecmp(make_model, "Toshiba", 7))
     {
@@ -1073,15 +1137,18 @@ ppdFilterPDFToPS(int inputfd,         /* I - File descriptor input stream */
   }
   else if (renderer == MUPDF)
   {
-   /*
-    * Add Resolution option to avoid slow processing by the printer when the
-    * resolution of embedded images does not match the printer's resolution
-    */
+    //
+    // Add Resolution option to avoid slow processing by the printer when the
+    // resolution of embedded images does not match the printer's resolution
+    //
+   
     snprintf(resolution, 127, "-r%dx%d", res, res);
     pdf_argv[pdf_argc++] = resolution;
-   /*
-    * Add input file name
-    */
+
+    //
+    // Add input file name
+    //
+   
     pdf_argv[pdf_argc++] = filename;
   }
 
@@ -1089,10 +1156,10 @@ ppdFilterPDFToPS(int inputfd,         /* I - File descriptor input stream */
 
   log_command_line(NULL, pdf_argv, log, ld);
 
- /*
-  * Do we need post-processing of the PostScript output to work around bugs
-  * of the printer's PostScript interpreter?
-  */
+  //
+  // Do we need post-processing of the PostScript output to work around bugs
+  // of the printer's PostScript interpreter?
+  //
 
   if ((renderer == PDFTOPS) || (renderer == PDFTOCAIRO) ||
       (renderer == MUPDF))
@@ -1106,23 +1173,23 @@ ppdFilterPDFToPS(int inputfd,         /* I - File descriptor input stream */
   else
     need_post_proc = 1;
 
- /*
-  * Do we need post-processing of the PostScript output to apply option
-  * settings when doing PPD-less printing?
-  */
+  //
+  // Do we need post-processing of the PostScript output to apply option
+  // settings when doing PPD-less printing?
+  //
 
   if (!ppd)
     need_post_proc = 1;
 
- /*
-  * Execute "pdftops/gs/mutool [ | PS post-processing ] [ | pstops ]"...
-  */
+  //
+  // Execute "pdftops/gs/mutool [ | PS post-processing ] [ | pstops ]"...
+  //
 
 
- /*
-  * Create a pipe for each pair of subsequent processes. The variables
-  * are named by the receiving process.
-  */
+  //
+  // Create a pipe for each pair of subsequent processes. The variables
+  // are named by the receiving process.
+  //
 
   if (ppd)
   {
@@ -1152,9 +1219,9 @@ ppdFilterPDFToPS(int inputfd,         /* I - File descriptor input stream */
 
   if ((pdf_pid = fork()) == 0)
   {
-   /*
-    * Child comes here...
-    */
+    //
+    // Child comes here...
+    //
 
     if (need_post_proc)
     {
@@ -1194,9 +1261,9 @@ ppdFilterPDFToPS(int inputfd,         /* I - File descriptor input stream */
     }
     else if (renderer == ACROREAD)
     {
-      /*
-       * use filename as stdin for acroread to force output to stdout
-       */
+      //
+      // use filename as stdin for acroread to force output to stdout
+      //
 
       if ((fd = open(filename, O_RDONLY)))
       {
@@ -1221,9 +1288,9 @@ ppdFilterPDFToPS(int inputfd,         /* I - File descriptor input stream */
   }
   else if (pdf_pid < 0)
   {
-   /*
-    * Unable to fork!
-    */
+    //
+    // Unable to fork!
+    //
 
     if (log)
     {
@@ -1254,15 +1321,16 @@ ppdFilterPDFToPS(int inputfd,         /* I - File descriptor input stream */
   }
 
   if (log) log(ld, CF_LOGLEVEL_DEBUG,
-              "ppdFilterPDFToPS: Started filter %s (PID %d)", pdf_argv[0], pdf_pid);
+              "ppdFilterPDFToPS: Started filter %s (PID %d)",
+              pdf_argv[0], pdf_pid);
 
   if (need_post_proc)
   {
     if ((post_proc_pid = fork()) == 0)
     {
-     /*
-      * Child comes here...
-      */
+      //
+      // Child comes here...
+      //
 
       close(post_proc_pipe[1]);
       if (ppd)
@@ -1278,10 +1346,10 @@ ppdFilterPDFToPS(int inputfd,         /* I - File descriptor input stream */
 
       if (renderer == ACROREAD)
       {
-       /*
-        * Set %Title and %For from filter arguments since acroread inserts
-        * garbage for these when using -toPostScript
-        */
+       //
+        // Set %Title and %For from filter arguments since acroread inserts
+        // garbage for these when using -toPostScript
+       //
 
         while ((bytes = cupsFileGetLine(fp, buffer, sizeof(buffer))) > 0 &&
                strncmp(buffer, "%%BeginProlog", 13))
@@ -1294,18 +1362,19 @@ ppdFilterPDFToPS(int inputfd,         /* I - File descriptor input stream */
             printf("%s", buffer);
         }
 
-       /*
-       * Copy the rest of the file
-       */
+       //
+       // Copy the rest of the file
+       //
+
        while ((bytes = cupsFileRead(fp, buffer, sizeof(buffer))) > 0)
          fwrite(buffer, 1, bytes, stdout);
       }
       else
       {
+       //
+       // Copy everything until after initial comments (Prolog section)
+       //
 
-       /*
-       * Copy everything until after initial comments (Prolog section)
-       */
        while ((bytes = cupsFileGetLine(fp, buffer, sizeof(buffer))) > 0 &&
               strncmp(buffer, "%%BeginProlog", 13) &&
               strncmp(buffer, "%%EndProlog", 11) &&
@@ -1315,13 +1384,14 @@ ppdFilterPDFToPS(int inputfd,         /* I - File descriptor input stream */
 
        if (bytes > 0)
        {
-        /*
-         * Insert PostScript interpreter bug fix code in the beginning of
-         * the Prolog section (before the first active PostScript code)
-         */
+         //
+         // Insert PostScript interpreter bug fix code in the beginning of
+         // the Prolog section (before the first active PostScript code)
+         //
+
          if (strncmp(buffer, "%%BeginProlog", 13))
          {
-           /* No Prolog section, create one */
+           // No Prolog section, create one
            if (log) log(ld, CF_LOGLEVEL_DEBUG,
                         "ppdFilterPDFToPS: Adding Prolog section for workaround "
                         "PostScript code");
@@ -1332,23 +1402,22 @@ ppdFilterPDFToPS(int inputfd,         /* I - File descriptor input stream */
 
          if (renderer == GS && make_model[0])
          {
-
-          /*
-           * Kyocera (and Utax) printers have a bug in their PostScript
-           * interpreter making them crashing on PostScript input data
-           * generated by Ghostscript's "ps2write" output device.
-           *
-           * The problem can be simply worked around by preceding the
-           * PostScript code with some extra bits.
-           *
-           * See https://bugs.launchpad.net/bugs/951627
-           *
-           * In addition, at least some of Kyocera's PostScript printers are
-           * very slow on rendering images which request interpolation. So we
-           * also add some code to eliminate interpolation requests.
-           *
-           * See https://bugs.launchpad.net/bugs/1026974
-           */
+           //
+           // Kyocera (and Utax) printers have a bug in their PostScript
+           // interpreter making them crashing on PostScript input data
+           // generated by Ghostscript's "ps2write" output device.
+           //
+           // The problem can be simply worked around by preceding the
+           // PostScript code with some extra bits.
+           //
+           // See https://bugs.launchpad.net/bugs/951627
+           //
+           // In addition, at least some of Kyocera's PostScript printers are
+           // very slow on rendering images which request interpolation. So we
+           // also add some code to eliminate interpolation requests.
+           //
+           // See https://bugs.launchpad.net/bugs/1026974
+           //
 
            if (!strncasecmp(make_model, "Kyocera", 7) ||
                !strncasecmp(make_model, "Utax", 4))
@@ -1376,16 +1445,16 @@ ppdFilterPDFToPS(int inputfd,         /* I - File descriptor input stream */
              puts("% =====");
            }
 
-          /*
-           * Brother printers have a bug in their PostScript interpreter
-           * making them printing one blank page if PostScript input data
-           * generated by Ghostscript's "ps2write" output device is used.
-           *
-           * The problem can be simply worked around by preceding the
-           * PostScript code with some extra bits.
-           *
-           * See https://bugs.launchpad.net/bugs/950713
-           */
+           //
+           // Brother printers have a bug in their PostScript interpreter
+           // making them printing one blank page if PostScript input data
+           // generated by Ghostscript's "ps2write" output device is used.
+           //
+           // The problem can be simply worked around by preceding the
+           // PostScript code with some extra bits.
+           //
+           // See https://bugs.launchpad.net/bugs/950713
+           //
 
            else if (!strncasecmp(make_model, "Brother", 7))
            {
@@ -1408,7 +1477,7 @@ ppdFilterPDFToPS(int inputfd,         /* I - File descriptor input stream */
 
          if (strncmp(buffer, "%%BeginProlog", 13))
          {
-           /* Close newly created Prolog section */
+           // Close newly created Prolog section
            if (strncmp(buffer, "%%EndProlog", 11))
              puts("%%EndProlog");
            printf("%s", buffer);
@@ -1416,9 +1485,10 @@ ppdFilterPDFToPS(int inputfd,         /* I - File descriptor input stream */
 
          if (!ppd)
          {
-          /*
-           * Copy everything until the setup section
-           */
+           //
+           // Copy everything until the setup section
+           //
+
            while (bytes > 0 &&
                   strncmp(buffer, "%%BeginSetup", 12) &&
                   strncmp(buffer, "%%EndSetup", 10) &&
@@ -1432,21 +1502,23 @@ ppdFilterPDFToPS(int inputfd,         /* I - File descriptor input stream */
          
            if (bytes > 0)
            {
-            /*
-             * Insert option PostScript code in Setup section
-             */
+             //
+             // Insert option PostScript code in Setup section
+             //
+
              if (strncmp(buffer, "%%BeginSetup", 12))
              {
-               /* No Setup section, create one */
+               // No Setup section, create one
                if (log) log(ld, CF_LOGLEVEL_DEBUG,
                             "ppdFilterPDFToPS: Adding Setup section for option "
                             "PostScript code");
                puts("%%BeginSetup");
              }
 
-            /*
-             * Duplex
-             */
+             //
+             // Duplex
+             //
+
              duplex = 0;
              tumble = 0;
              if ((val = cupsGetOption("sides",
@@ -1495,15 +1567,17 @@ ppdFilterPDFToPS(int inputfd,         /* I - File descriptor input stream */
              else
                puts("<</Duplex false>> setpagedevice");
 
-            /*
-             * Resolution
-             */
+             //
+             // Resolution
+             //
+
              if ((xres > 0) && (yres > 0))
                printf("<</HWResolution[%d %d]>> setpagedevice\n", xres, yres);
 
-            /*
-             * InputSlot/MediaSource
-             */
+             //
+             // InputSlot/MediaSource
+             //
+
              if ((val = cupsGetOption("media-position", num_options,
                                       options)) != NULL ||
                  (val = cupsGetOption("MediaPosition", num_options,
@@ -1538,9 +1612,10 @@ ppdFilterPDFToPS(int inputfd,         /* I - File descriptor input stream */
                  puts("<</MediaPosition 1 /ManualFeed false>> setpagedevice");
              }
 
-            /*
-             * ColorModel
-             */
+             //
+             // ColorModel
+             //
+
              if ((val = cupsGetOption("pwg-raster-document-type", num_options,
                                       options)) != NULL ||
                  (val = cupsGetOption("PwgRasterDocumentType", num_options,
@@ -1574,7 +1649,7 @@ ppdFilterPDFToPS(int inputfd,         /* I - File descriptor input stream */
 
              if (strncmp(buffer, "%%BeginSetup", 12))
              {
-               /* Close newly created Setup section */
+               // Close newly created Setup section
                if (strncmp(buffer, "%%EndSetup", 10))
                  puts("%%EndSetup");
                printf("%s", buffer);
@@ -1582,9 +1657,10 @@ ppdFilterPDFToPS(int inputfd,         /* I - File descriptor input stream */
            }
          }
 
-        /*
-         * Copy the rest of the file
-         */
+         //
+         // Copy the rest of the file
+         //
+
          while ((bytes = cupsFileRead(fp, buffer, sizeof(buffer))) > 0)
            fwrite(buffer, 1, bytes, stdout);
        }
@@ -1595,9 +1671,9 @@ ppdFilterPDFToPS(int inputfd,         /* I - File descriptor input stream */
     }
     else if (post_proc_pid < 0)
     {
-     /*
-      * Unable to fork!
-      */
+      //
+      // Unable to fork!
+      //
 
       if (log) log(ld, CF_LOGLEVEL_ERROR,
                   "ppdFilterPDFToPS: Unable to execute post-processing process: %s",
@@ -1608,16 +1684,17 @@ ppdFilterPDFToPS(int inputfd,         /* I - File descriptor input stream */
     }
 
     if (log) log(ld, CF_LOGLEVEL_DEBUG,
-                "ppdFilterPDFToPS: Started post-processing (PID %d)", post_proc_pid);
+                "ppdFilterPDFToPS: Started post-processing (PID %d)",
+                post_proc_pid);
   }
 
   if (ppd)
   {
     if ((pstops_pid = fork()) == 0)
     {
-     /*
-      * Child comes here...
-      */
+      //
+      // Child comes here...
+      //
 
       close(pstops_pipe[1]);
       if (need_post_proc)
@@ -1626,7 +1703,8 @@ ppdFilterPDFToPS(int inputfd,         /* I - File descriptor input stream */
        close(post_proc_pipe[1]);
       }
 
-      ret = ppdFilterPSToPS(pstops_pipe[0], outputfd, 0, &pstops_filter_data, NULL);
+      ret = ppdFilterPSToPS(pstops_pipe[0], outputfd, 0, &pstops_filter_data,
+                           NULL);
       close(pstops_pipe[0]);
 
       if (ret && log) log(ld, CF_LOGLEVEL_ERROR,
@@ -1637,9 +1715,9 @@ ppdFilterPDFToPS(int inputfd,         /* I - File descriptor input stream */
     }
     else if (pstops_pid < 0)
     {
-     /*
-      * Unable to fork!
-      */
+      //
+      // Unable to fork!
+      //
 
       if (log) log(ld, CF_LOGLEVEL_ERROR,
                   "ppdFilterPDFToPS: Unable to execute pstops program: %s",
@@ -1650,7 +1728,8 @@ ppdFilterPDFToPS(int inputfd,         /* I - File descriptor input stream */
     }
 
     if (log) log(ld, CF_LOGLEVEL_DEBUG,
-                "ppdFilterPDFToPS: Started filter pstops (PID %d)", pstops_pid);
+                "ppdFilterPDFToPS: Started filter pstops (PID %d)",
+                pstops_pid);
 
     close(pstops_pipe[0]);
     close(pstops_pipe[1]);
@@ -1662,17 +1741,17 @@ ppdFilterPDFToPS(int inputfd,         /* I - File descriptor input stream */
     close(post_proc_pipe[1]);
   }
 
- /*
-  * Wait for the child processes to exit...
-  */
+  //
+  // Wait for the child processes to exit...
+  //
 
   wait_children = 1 + need_post_proc + (ppd ? 1 : 0);
 
   while (wait_children > 0)
   {
-   /*
-    * Wait until we get a valid process ID or the job is canceled...
-    */
+    //
+    // Wait until we get a valid process ID or the job is canceled...
+    //
 
     while ((wait_pid = wait(&wait_status)) < 0 && errno == EINTR)
     {
@@ -1690,9 +1769,9 @@ ppdFilterPDFToPS(int inputfd,         /* I - File descriptor input stream */
 
     wait_children --;
 
-   /*
-    * Report child status...
-    */
+    //
+    // Report child status...
+    //
 
     if (wait_status)
     {
@@ -1771,11 +1850,11 @@ ppdFilterPDFToPS(int inputfd,         /* I - File descriptor input stream */
     }
   }
 
- /*
-  * Cleanup and exit...
-  */
+  //
+  // Cleanup and exit...
+  //
 
 error:
+ error:
 
   if (log) log(ld, CF_LOGLEVEL_DEBUG,
               "ppdFilterPDFToPS: Closing files ...");
index 357755470eab8a44a35d20c3ed7bdeb48a89eb51..f0bec8c078491c46f5f6c2d74b5aaefc50d50e93 100644 (file)
@@ -1,65 +1,66 @@
-/*
- * PPD model-specific attribute routines for libppd.
- *
- * Copyright 2007-2015 by Apple Inc.
- * Copyright 1997-2006 by Easy Software Products.
- *
- * Licensed under Apache License v2.0.  See the file "LICENSE" for more
- * information.
- */
-
-/*
- * Include necessary headers...
- */
+//
+// PPD model-specific attribute routines for libppd.
+//
+// Copyright 2007-2015 by Apple Inc.
+// Copyright 1997-2006 by Easy Software Products.
+//
+// Licensed under Apache License v2.0.  See the file "LICENSE" for more
+// information.
+//
+
+//
+// Include necessary headers...
+//
 
 #include "string-private.h"
 #include "ppd.h"
 #include "debug-internal.h"
 
 
-/*
- * 'ppdFindAttr()' - Find the first matching attribute.
- *
- * @since CUPS 1.1.19/macOS 10.3@
- */
+//
+// 'ppdFindAttr()' - Find the first matching attribute.
+//
+// @since CUPS 1.1.19/macOS 10.3@
+//
 
-ppd_attr_t *                           /* O - Attribute or @code NULL@ if not found */
-ppdFindAttr(ppd_file_t *ppd,           /* I - PPD file data */
-            const char *name,          /* I - Attribute name */
-            const char *spec)          /* I - Specifier string or @code NULL@ */
+ppd_attr_t *                           // O - Attribute or @code NULL@ if not
+                                       //     found
+ppdFindAttr(ppd_file_t *ppd,           // I - PPD file data
+            const char *name,          // I - Attribute name
+            const char *spec)          // I - Specifier string or @code NULL@
 {
-  ppd_attr_t   key,                    /* Search key */
-               *attr;                  /* Current attribute */
+  ppd_attr_t   key,                    // Search key
+               *attr;                  // Current attribute
 
 
   DEBUG_printf(("2ppdFindAttr(ppd=%p, name=\"%s\", spec=\"%s\")", ppd, name,
                 spec));
 
- /*
-  * Range check input...
-  */
+  //
+  // Range check input...
+  //
 
   if (!ppd || !name || ppd->num_attrs == 0)
     return (NULL);
 
- /*
-  * Search for a matching attribute...
-  */
+  //
+  // Search for a matching attribute...
+  //
 
   memset(&key, 0, sizeof(key));
   strlcpy(key.name, name, sizeof(key.name));
 
- /*
-  * Return the first matching attribute, if any...
-  */
+  //
+  // Return the first matching attribute, if any...
+  //
 
   if ((attr = (ppd_attr_t *)cupsArrayFind(ppd->sorted_attrs, &key)) != NULL)
   {
     if (spec)
     {
-     /*
-      * Loop until we find the first matching attribute for "spec"...
-      */
+      //
+      // Loop until we find the first matching attribute for "spec"...
+      //
 
       while (attr && _ppd_strcasecmp(spec, attr->spec))
       {
@@ -74,42 +75,43 @@ ppdFindAttr(ppd_file_t *ppd,                /* I - PPD file data */
 }
 
 
-/*
- * 'ppdFindNextAttr()' - Find the next matching attribute.
- *
- * @since CUPS 1.1.19/macOS 10.3@
- */
+//
+// 'ppdFindNextAttr()' - Find the next matching attribute.
+//
+// @since CUPS 1.1.19/macOS 10.3@
+//
 
-ppd_attr_t *                           /* O - Attribute or @code NULL@ if not found */
-ppdFindNextAttr(ppd_file_t *ppd,       /* I - PPD file data */
-                const char *name,      /* I - Attribute name */
-               const char *spec)       /* I - Specifier string or @code NULL@ */
+ppd_attr_t *                           // O - Attribute or @code NULL@ if not
+                                       //     found
+ppdFindNextAttr(ppd_file_t *ppd,       // I - PPD file data
+                const char *name,      // I - Attribute name
+               const char *spec)       // I - Specifier string or @code NULL@
 {
-  ppd_attr_t   *attr;                  /* Current attribute */
+  ppd_attr_t   *attr;                  // Current attribute
 
 
- /*
-  * Range check input...
-  */
+  //
+  // Range check input...
+  //
 
   if (!ppd || !name || ppd->num_attrs == 0)
     return (NULL);
 
- /*
-  * See if there are more attributes to return...
-  */
+  //
+  // See if there are more attributes to return...
+  //
 
   while ((attr = (ppd_attr_t *)cupsArrayNext(ppd->sorted_attrs)) != NULL)
   {
-   /*
-    * Check the next attribute to see if it is a match...
-    */
+    //
+    // Check the next attribute to see if it is a match...
+    //
 
     if (_ppd_strcasecmp(attr->name, name))
     {
-     /*
-      * Nope, reset the current pointer to the end of the array...
-      */
+      //
+      // Nope, reset the current pointer to the end of the array...
+      //
 
       cupsArrayIndex(ppd->sorted_attrs, cupsArrayCount(ppd->sorted_attrs));
 
@@ -120,28 +122,29 @@ ppdFindNextAttr(ppd_file_t *ppd,  /* I - PPD file data */
       break;
   }
 
- /*
-  * Return the next attribute's value...
-  */
+  //
+  // Return the next attribute's value...
+  //
 
   return (attr);
 }
 
 
-/*
- * 'ppdNormalizeMakeAndModel()' - Normalize a product/make-and-model string.
- *
- * This function tries to undo the mistakes made by many printer manufacturers
- * to produce a clean make-and-model string we can use.
- */
+//
+// 'ppdNormalizeMakeAndModel()' - Normalize a product/make-and-model string.
+//
+// This function tries to undo the mistakes made by many printer manufacturers
+// to produce a clean make-and-model string we can use.
+//
 
-char *                                 /* O - Normalized make-and-model string or NULL on error */
+char *                                 // O - Normalized make-and-model string
+                                       //     or NULL on error
 ppdNormalizeMakeAndModel(
-    const char *make_and_model,                /* I - Original make-and-model string */
-    char       *buffer,                        /* I - String buffer */
-    size_t     bufsize)                        /* I - Size of string buffer */
+    const char *make_and_model,                // I - Original make-and-model string
+    char       *buffer,                        // I - String buffer
+    size_t     bufsize)                        // I - Size of string buffer
 {
-  char *bufptr;                        /* Pointer into buffer */
+  char *bufptr;                        // Pointer into buffer
 
 
   if (!make_and_model || !buffer || bufsize < 1)
@@ -152,16 +155,16 @@ ppdNormalizeMakeAndModel(
     return (NULL);
   }
 
- /*
-  * Skip leading whitespace...
-  */
+  //
+  // Skip leading whitespace...
+  //
 
   while (_ppd_isspace(*make_and_model))
     make_and_model ++;
 
- /*
-  * Remove parenthesis and add manufacturers as needed...
-  */
+  //
+  // Remove parenthesis and add manufacturers as needed...
+  //
 
   if (make_and_model[0] == '(')
   {
@@ -172,74 +175,74 @@ ppdNormalizeMakeAndModel(
   }
   else if (!_ppd_strncasecmp(make_and_model, "XPrint", 6))
   {
-   /*
-    * Xerox XPrint...
-    */
+    //
+    // Xerox XPrint...
+    //
 
     snprintf(buffer, bufsize, "Xerox %s", make_and_model);
   }
   else if (!_ppd_strncasecmp(make_and_model, "Eastman", 7))
   {
-   /*
-    * Kodak...
-    */
+    //
+    // Kodak...
+    //
 
     snprintf(buffer, bufsize, "Kodak %s", make_and_model + 7);
   }
   else if (!_ppd_strncasecmp(make_and_model, "laserwriter", 11))
   {
-   /*
-    * Apple LaserWriter...
-    */
+    //
+    // Apple LaserWriter...
+    //
 
     snprintf(buffer, bufsize, "Apple LaserWriter%s", make_and_model + 11);
   }
   else if (!_ppd_strncasecmp(make_and_model, "colorpoint", 10))
   {
-   /*
-    * Seiko...
-    */
+    //
+    // Seiko...
+    //
 
     snprintf(buffer, bufsize, "Seiko %s", make_and_model);
   }
   else if (!_ppd_strncasecmp(make_and_model, "fiery", 5))
   {
-   /*
-    * EFI...
-    */
+    //
+    // EFI...
+    //
 
     snprintf(buffer, bufsize, "EFI %s", make_and_model);
   }
   else if (!_ppd_strncasecmp(make_and_model, "ps ", 3) ||
           !_ppd_strncasecmp(make_and_model, "colorpass", 9))
   {
-   /*
-    * Canon...
-    */
+    //
+    // Canon...
+    //
 
     snprintf(buffer, bufsize, "Canon %s", make_and_model);
   }
   else if (!_ppd_strncasecmp(make_and_model, "designjet", 9) ||
            !_ppd_strncasecmp(make_and_model, "deskjet", 7))
   {
-   /*
-    * HP...
-    */
+    //
+    // HP...
+    //
 
     snprintf(buffer, bufsize, "HP %s", make_and_model);
   }
   else
     strlcpy(buffer, make_and_model, bufsize);
 
- /*
-  * Clean up the make...
-  */
+  //
+  // Clean up the make...
+  //
 
   if (!_ppd_strncasecmp(buffer, "agfa", 4))
   {
-   /*
-    * Replace with AGFA (all uppercase)...
-    */
+    //
+    // Replace with AGFA (all uppercase)...
+    //
 
     buffer[0] = 'A';
     buffer[1] = 'G';
@@ -248,9 +251,9 @@ ppdNormalizeMakeAndModel(
   }
   else if (!_ppd_strncasecmp(buffer, "Hewlett-Packard hp ", 19))
   {
-   /*
-    * Just put "HP" on the front...
-    */
+    //
+    // Just put "HP" on the front...
+    //
 
     buffer[0] = 'H';
     buffer[1] = 'P';
@@ -258,9 +261,9 @@ ppdNormalizeMakeAndModel(
   }
   else if (!_ppd_strncasecmp(buffer, "Hewlett-Packard ", 16))
   {
-   /*
-    * Just put "HP" on the front...
-    */
+    //
+    // Just put "HP" on the front...
+    //
 
     buffer[0] = 'H';
     buffer[1] = 'P';
@@ -268,17 +271,17 @@ ppdNormalizeMakeAndModel(
   }
   else if (!_ppd_strncasecmp(buffer, "Lexmark International", 21))
   {
-   /*
-    * Strip "International"...
-    */
+    //
+    // Strip "International"...
+    //
 
     _ppd_strcpy(buffer + 8, buffer + 21);
   }
   else if (!_ppd_strncasecmp(buffer, "herk", 4))
   {
-   /*
-    * Replace with LHAG...
-    */
+    //
+    // Replace with LHAG...
+    //
 
     buffer[0] = 'L';
     buffer[1] = 'H';
@@ -287,9 +290,9 @@ ppdNormalizeMakeAndModel(
   }
   else if (!_ppd_strncasecmp(buffer, "linotype", 8))
   {
-   /*
-    * Replace with LHAG...
-    */
+    //
+    // Replace with LHAG...
+    //
 
     buffer[0] = 'L';
     buffer[1] = 'H';
@@ -298,9 +301,9 @@ ppdNormalizeMakeAndModel(
     _ppd_strcpy(buffer + 4, buffer + 8);
   }
 
- /*
-  * Remove trailing whitespace and return...
-  */
+  //
+  // Remove trailing whitespace and return...
+  //
 
   for (bufptr = buffer + strlen(buffer) - 1;
        bufptr >= buffer && _ppd_isspace(*bufptr);
index 5c4060a2333a7b8c9f0bbec895d40337250d0e4f..9ce9f9b8a08ce75d6d2b03ed9d8d65981d003cbf 100644 (file)
@@ -1,15 +1,15 @@
-/*
- * PPD cache implementation for libppd.
- *
- * Copyright © 2010-2019 by Apple Inc.
- *
- * Licensed under Apache License v2.0.  See the file "LICENSE" for more
- * information.
- */
-
-/*
- * Include necessary headers...
- */
+//
+// PPD cache implementation for libppd.
+//
+// Copyright © 2010-2019 by Apple Inc.
+//
+// Licensed under Apache License v2.0.  See the file "LICENSE" for more
+// information.
+//
+
+//
+// Include necessary headers...
+//
 
 #include "string-private.h"
 #include "array-private.h"
 #include <errno.h>
 
 
-/*
- * Macro to test for two almost-equal PWG measurements.
- */
+//
+// Macro to test for two almost-equal PWG measurements.
+//
 
 #define _PPD_PWG_EQUIVALENT(x, y)      (abs((x)-(y)) < 2)
 
-/*
- * Macros to work around typos in older libcups version
- */
+//
+// Macros to work around typos in older libcups version
+//
 
 #if (CUPS_VERSION_MAJOR < 2) || ((CUPS_VERSION_MAJOR == 2) && ((CUPS_VERSION_MINOR < 3) || ((CUPS_VERSION_MINOR == 3) && (CUPS_VERSION_PATCH < 1))))
 #define IPP_FINISHINGS_CUPS_FOLD_ACCORDION IPP_FINISHINGS_CUPS_FOLD_ACCORDIAN
 #endif
 
 
-/*
- * Local functions...
- */
+//
+// Local functions...
+//
 
 static void    ppd_pwg_add_finishing(cups_array_t *finishings, ipp_finishings_t template, const char *name, const char *value);
 static void    ppd_pwg_add_message(cups_array_t *a, const char *msg, const char *str);
 static int     ppd_pwg_compare_finishings(ppd_pwg_finishings_t *a, ppd_pwg_finishings_t *b);
 static void    ppd_pwg_free_finishings(ppd_pwg_finishings_t *f);
 
-char            *ppd_cache_status_message = NULL; /* Last PPD cache error */
+char            *ppd_cache_status_message = NULL; // Last PPD cache error
 
 
-/*
- * 'set_error()' - Set the last status-message of PPD cache functions.
- */
+//
+// 'set_error()' - Set the last status-message of PPD cache functions.
+//
 
-void
-set_error(const char   *message,       /* I - status-message value */
-             int          localize)    /* I - Localize the message? */
+static void
+set_error(const char   *message,       // I - status-message value
+         int          localize)        // I - Localize the message?
 {
   if (!message && errno)
   {
@@ -75,9 +75,9 @@ set_error(const char   *message,      /* I - status-message value */
   {
     if (localize)
     {
-     /*
-      * Get the message catalog...
-      */
+     //
+     // Get the message catalog...
+     //
 
       ppd_cache_status_message =
        _ppdStrAlloc(_ppdLangString(cupsLangDefault(),
@@ -91,102 +91,116 @@ set_error(const char   *message,  /* I - status-message value */
                 ppd_cache_status_message));
 }
 
-/*
- * 'ppdConvertOptions()' - Convert printer options to standard IPP attributes.
- *
- * This functions converts PPD and CUPS-specific options to their standard IPP
- * attributes and values and adds them to the specified IPP request.
- */
+//
+// 'ppdConvertOptions()' - Convert printer options to standard IPP attributes.
+//
+// This functions converts PPD and CUPS-specific options to their standard IPP
+// attributes and values and adds them to the specified IPP request.
+//
 
-int                                    /* O - New number of copies */
+int                                    // O - New number of copies
 ppdConvertOptions(
-    ipp_t           *request,          /* I - IPP request */
-    ppd_file_t      *ppd,              /* I - PPD file */
-    ppd_cache_t    *pc,                /* I - PPD cache info */
-    ipp_attribute_t *media_col_sup,    /* I - media-col-supported values */
-    ipp_attribute_t *doc_handling_sup, /* I - multiple-document-handling-supported values */
+    ipp_t           *request,          // I - IPP request
+    ppd_file_t      *ppd,              // I - PPD file
+    ppd_cache_t     *pc,               // I - PPD cache info
+    ipp_attribute_t *media_col_sup,    // I - media-col-supported values
+    ipp_attribute_t *doc_handling_sup,
+                       // I - multiple-document-handling-supported values
     ipp_attribute_t *print_color_mode_sup,
-                                       /* I - Printer supports print-color-mode */
-    const char    *user,               /* I - User info */
-    const char    *format,             /* I - document-format value */
-    int           copies,              /* I - Number of copies */
-    int           num_options,         /* I - Number of options */
-    cups_option_t *options)            /* I - Options */
+                                       // I - Printer supports print-color-mode
+    const char    *user,               // I - User info
+    const char    *format,             // I - document-format value
+    int           copies,              // I - Number of copies
+    int           num_options,         // I - Number of options
+    cups_option_t *options)            // I - Options
 {
-  int          i;                      /* Looping var */
-  const char   *keyword,               /* PWG keyword */
-               *password;              /* Password string */
-  pwg_size_t   *size;                  /* PWG media size */
-  ipp_t                *media_col,             /* media-col value */
-               *media_size;            /* media-size value */
-  const char   *media_source,          /* media-source value */
-               *media_type,            /* media-type value */
-               *collate_str,           /* multiple-document-handling value */
-               *color_attr_name,       /* Supported color attribute */
-               *mandatory,             /* Mandatory attributes */
-               *finishing_template;    /* Finishing template */
-  int          num_finishings = 0,     /* Number of finishing values */
-               finishings[10];         /* Finishing enum values */
-  ppd_choice_t *choice;                /* Marked choice */
+  int          i;                      // Looping var
+  const char   *keyword,               // PWG keyword
+               *password;              // Password string
+  pwg_size_t   *size;                  // PWG media size
+  ipp_t                *media_col,             // media-col value
+               *media_size;            // media-size value
+  const char   *media_source,          // media-source value
+               *media_type,            // media-type value
+               *collate_str,           // multiple-document-handling value
+               *color_attr_name,       // Supported color attribute
+               *mandatory,             // Mandatory attributes
+               *finishing_template;    // Finishing template
+  int          num_finishings = 0,     // Number of finishing values
+               finishings[10];         // Finishing enum values
+  ppd_choice_t *choice;                // Marked choice
   int           finishings_copies = copies;
-                                        /* Number of copies for finishings */
+                                        // Number of copies for finishings
 
 
- /*
-  * Send standard IPP attributes...
-  */
+  //
+  // Send standard IPP attributes...
+  //
 
-  if (pc->password && (password = cupsGetOption("job-password", num_options, options)) != NULL && ippGetOperation(request) != IPP_OP_VALIDATE_JOB)
+  if (pc->password &&
+      (password = cupsGetOption("job-password",
+                               num_options, options)) != NULL &&
+      ippGetOperation(request) != IPP_OP_VALIDATE_JOB)
   {
-    ipp_attribute_t    *attr = NULL;   /* job-password attribute */
+    ipp_attribute_t    *attr = NULL;   // job-password attribute
 
-    if ((keyword = cupsGetOption("job-password-encryption", num_options, options)) == NULL)
+    if ((keyword = cupsGetOption("job-password-encryption", num_options,
+                                options)) == NULL)
       keyword = "none";
 
     if (!strcmp(keyword, "none"))
     {
-     /*
-      * Add plain-text job-password...
-      */
+      //
+      // Add plain-text job-password...
+      //
 
-      attr = ippAddOctetString(request, IPP_TAG_OPERATION, "job-password", password, (int)strlen(password));
+      attr = ippAddOctetString(request, IPP_TAG_OPERATION, "job-password",
+                              password, (int)strlen(password));
     }
     else
     {
-     /*
-      * Add hashed job-password...
-      */
+      //
+      // Add hashed job-password...
+      //
 
-      unsigned char    hash[64];       /* Hash of password */
-      ssize_t          hashlen;        /* Length of hash */
+      unsigned char    hash[64];       // Hash of password
+      ssize_t          hashlen;        // Length of hash
 
-      if ((hashlen = cupsHashData(keyword, password, strlen(password), hash, sizeof(hash))) > 0)
-        attr = ippAddOctetString(request, IPP_TAG_OPERATION, "job-password", hash, (int)hashlen);
+      if ((hashlen = cupsHashData(keyword, password, strlen(password), hash,
+                                 sizeof(hash))) > 0)
+        attr = ippAddOctetString(request, IPP_TAG_OPERATION, "job-password",
+                                hash, (int)hashlen);
     }
 
     if (attr)
-      ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_KEYWORD, "job-password-encryption", NULL, keyword);
+      ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_KEYWORD,
+                  "job-password-encryption", NULL, keyword);
   }
 
   if (pc->account_id)
   {
-    if ((keyword = cupsGetOption("job-account-id", num_options, options)) == NULL)
+    if ((keyword = cupsGetOption("job-account-id",
+                                num_options, options)) == NULL)
       keyword = cupsGetOption("job-billing", num_options, options);
 
     if (keyword)
-      ippAddString(request, IPP_TAG_JOB, IPP_TAG_NAME, "job-account-id", NULL, keyword);
+      ippAddString(request, IPP_TAG_JOB, IPP_TAG_NAME, "job-account-id", NULL,
+                  keyword);
   }
 
   if (pc->accounting_user_id)
   {
-    if ((keyword = cupsGetOption("job-accounting-user-id", num_options, options)) == NULL)
+    if ((keyword = cupsGetOption("job-accounting-user-id",
+                                num_options, options)) == NULL)
       keyword = user;
 
     if (keyword)
-      ippAddString(request, IPP_TAG_JOB, IPP_TAG_NAME, "job-accounting-user-id", NULL, keyword);
+      ippAddString(request, IPP_TAG_JOB, IPP_TAG_NAME,
+                  "job-accounting-user-id", NULL, keyword);
   }
 
-  for (mandatory = (const char *)cupsArrayFirst(pc->mandatory); mandatory; mandatory = (const char *)cupsArrayNext(pc->mandatory))
+  for (mandatory = (const char *)cupsArrayFirst(pc->mandatory); mandatory;
+       mandatory = (const char *)cupsArrayNext(pc->mandatory))
   {
     if (strcmp(mandatory, "copies") &&
        strcmp(mandatory, "destination-uris") &&
@@ -207,22 +221,24 @@ ppdConvertOptions(
        (keyword = cupsGetOption(mandatory, num_options, options)) != NULL)
     {
       _ppd_ipp_option_t *opt = _ppdIppFindOption(mandatory);
-                                   /* Option type */
+                                   // Option type
       ipp_tag_t        value_tag = opt ? opt->value_tag : IPP_TAG_NAME;
-                                   /* Value type */
+                                   // Value type
 
       switch (value_tag)
       {
        case IPP_TAG_INTEGER :
        case IPP_TAG_ENUM :
-           ippAddInteger(request, IPP_TAG_JOB, value_tag, mandatory, atoi(keyword));
+           ippAddInteger(request, IPP_TAG_JOB, value_tag, mandatory,
+                         atoi(keyword));
            break;
        case IPP_TAG_BOOLEAN :
-           ippAddBoolean(request, IPP_TAG_JOB, mandatory, !_ppd_strcasecmp(keyword, "true"));
+           ippAddBoolean(request, IPP_TAG_JOB, mandatory,
+                         !_ppd_strcasecmp(keyword, "true"));
            break;
        case IPP_TAG_RANGE :
            {
-             int lower, upper; /* Range */
+             int lower, upper; // Range
 
              if (sscanf(keyword, "%d-%d", &lower, &upper) != 2)
                lower = upper = atoi(keyword);
@@ -231,18 +247,23 @@ ppdConvertOptions(
            }
            break;
        case IPP_TAG_STRING :
-           ippAddOctetString(request, IPP_TAG_JOB, mandatory, keyword, (int)strlen(keyword));
+           ippAddOctetString(request, IPP_TAG_JOB, mandatory, keyword,
+                             (int)strlen(keyword));
            break;
        default :
-           if (!strcmp(mandatory, "print-color-mode") && !strcmp(keyword, "monochrome"))
+           if (!strcmp(mandatory, "print-color-mode") &&
+               !strcmp(keyword, "monochrome"))
            {
              if (ippContainsString(print_color_mode_sup, "auto-monochrome"))
                keyword = "auto-monochrome";
-             else if (ippContainsString(print_color_mode_sup, "process-monochrome") && !ippContainsString(print_color_mode_sup, "monochrome"))
+             else if (ippContainsString(print_color_mode_sup,
+                                        "process-monochrome") &&
+                      !ippContainsString(print_color_mode_sup, "monochrome"))
                keyword = "process-monochrome";
            }
 
-           ippAddString(request, IPP_TAG_JOB, value_tag, mandatory, NULL, keyword);
+           ippAddString(request, IPP_TAG_JOB, value_tag, mandatory, NULL,
+                        keyword);
            break;
       }
     }
@@ -251,15 +272,17 @@ ppdConvertOptions(
   if ((keyword = cupsGetOption("PageSize", num_options, options)) == NULL)
     keyword = cupsGetOption("media", num_options, options);
 
-  media_source = ppdCacheGetSource(pc, cupsGetOption("InputSlot", num_options, options));
-  media_type   = ppdCacheGetType(pc, cupsGetOption("MediaType", num_options, options));
+  media_source = ppdCacheGetSource(pc, cupsGetOption("InputSlot", num_options,
+                                                    options));
+  media_type   = ppdCacheGetType(pc, cupsGetOption("MediaType", num_options,
+                                                  options));
   size         = ppdCacheGetSize(pc, keyword);
 
   if (size || media_source || media_type)
   {
-   /*
-    * Add a media-col value...
-    */
+    //
+    // Add a media-col value...
+    //
 
     media_col = ippNew();
 
@@ -312,11 +335,13 @@ ppdConvertOptions(
   }
 
   if (keyword)
-    ippAddString(request, IPP_TAG_JOB, IPP_TAG_KEYWORD, "output-bin", NULL, keyword);
+    ippAddString(request, IPP_TAG_JOB, IPP_TAG_KEYWORD, "output-bin", NULL,
+                keyword);
 
   color_attr_name = print_color_mode_sup ? "print-color-mode" : "output-mode";
 
-  if ((keyword = cupsGetOption("print-color-mode", num_options, options)) == NULL)
+  if ((keyword = cupsGetOption("print-color-mode",
+                              num_options, options)) == NULL)
   {
     if ((choice = ppdFindMarkedChoice(ppd, "ColorModel")) != NULL)
     {
@@ -331,42 +356,55 @@ ppdConvertOptions(
   {
     if (ippContainsString(print_color_mode_sup, "auto-monochrome"))
       keyword = "auto-monochrome";
-    else if (ippContainsString(print_color_mode_sup, "process-monochrome") && !ippContainsString(print_color_mode_sup, "monochrome"))
+    else if (ippContainsString(print_color_mode_sup, "process-monochrome") &&
+            !ippContainsString(print_color_mode_sup, "monochrome"))
       keyword = "process-monochrome";
   }
 
   if (keyword)
-    ippAddString(request, IPP_TAG_JOB, IPP_TAG_KEYWORD, color_attr_name, NULL, keyword);
+    ippAddString(request, IPP_TAG_JOB, IPP_TAG_KEYWORD, color_attr_name, NULL,
+                keyword);
 
   if ((keyword = cupsGetOption("print-quality", num_options, options)) != NULL)
-    ippAddInteger(request, IPP_TAG_JOB, IPP_TAG_ENUM, "print-quality", atoi(keyword));
+    ippAddInteger(request, IPP_TAG_JOB, IPP_TAG_ENUM, "print-quality",
+                 atoi(keyword));
   else if ((choice = ppdFindMarkedChoice(ppd, "cupsPrintQuality")) != NULL)
   {
     if (!_ppd_strcasecmp(choice->choice, "draft"))
-      ippAddInteger(request, IPP_TAG_JOB, IPP_TAG_ENUM, "print-quality", IPP_QUALITY_DRAFT);
+      ippAddInteger(request, IPP_TAG_JOB, IPP_TAG_ENUM, "print-quality",
+                   IPP_QUALITY_DRAFT);
     else if (!_ppd_strcasecmp(choice->choice, "normal"))
-      ippAddInteger(request, IPP_TAG_JOB, IPP_TAG_ENUM, "print-quality", IPP_QUALITY_NORMAL);
+      ippAddInteger(request, IPP_TAG_JOB, IPP_TAG_ENUM, "print-quality",
+                   IPP_QUALITY_NORMAL);
     else if (!_ppd_strcasecmp(choice->choice, "high"))
-      ippAddInteger(request, IPP_TAG_JOB, IPP_TAG_ENUM, "print-quality", IPP_QUALITY_HIGH);
+      ippAddInteger(request, IPP_TAG_JOB, IPP_TAG_ENUM, "print-quality",
+                   IPP_QUALITY_HIGH);
   }
 
   if ((keyword = cupsGetOption("sides", num_options, options)) != NULL)
     ippAddString(request, IPP_TAG_JOB, IPP_TAG_KEYWORD, "sides", NULL, keyword);
-  else if (pc->sides_option && (choice = ppdFindMarkedChoice(ppd, pc->sides_option)) != NULL)
+  else if (pc->sides_option &&
+          (choice = ppdFindMarkedChoice(ppd, pc->sides_option)) != NULL)
   {
     if (pc->sides_1sided && !_ppd_strcasecmp(choice->choice, pc->sides_1sided))
-      ippAddString(request, IPP_TAG_JOB, IPP_TAG_KEYWORD, "sides", NULL, "one-sided");
-    else if (pc->sides_2sided_long && !_ppd_strcasecmp(choice->choice, pc->sides_2sided_long))
-      ippAddString(request, IPP_TAG_JOB, IPP_TAG_KEYWORD, "sides", NULL, "two-sided-long-edge");
-    else if (pc->sides_2sided_short && !_ppd_strcasecmp(choice->choice, pc->sides_2sided_short))
-      ippAddString(request, IPP_TAG_JOB, IPP_TAG_KEYWORD, "sides", NULL, "two-sided-short-edge");
+      ippAddString(request, IPP_TAG_JOB, IPP_TAG_KEYWORD, "sides", NULL,
+                  "one-sided");
+    else if (pc->sides_2sided_long &&
+            !_ppd_strcasecmp(choice->choice, pc->sides_2sided_long))
+      ippAddString(request, IPP_TAG_JOB, IPP_TAG_KEYWORD, "sides", NULL,
+                  "two-sided-long-edge");
+    else if (pc->sides_2sided_short &&
+            !_ppd_strcasecmp(choice->choice, pc->sides_2sided_short))
+      ippAddString(request, IPP_TAG_JOB, IPP_TAG_KEYWORD, "sides", NULL,
+                  "two-sided-short-edge");
   }
 
- /*
-  * Copies...
-  */
+  //
+  // Copies...
+  //
 
-  if ((keyword = cupsGetOption("multiple-document-handling", num_options, options)) != NULL)
+  if ((keyword = cupsGetOption("multiple-document-handling",
+                              num_options, options)) != NULL)
   {
     if (strstr(keyword, "uncollated"))
       keyword = "false";
@@ -385,19 +423,19 @@ ppdConvertOptions(
        !_ppd_strcasecmp(format, "image/tiff") ||
        !_ppd_strncasecmp(format, "image/x-", 8))
     {
-     /*
-      * Collation makes no sense for single page image formats...
-      */
+      //
+      // Collation makes no sense for single page image formats...
+      //
 
       keyword = "false";
     }
     else if (!_ppd_strncasecmp(format, "image/", 6) ||
             !_ppd_strcasecmp(format, "application/vnd.cups-raster"))
     {
-     /*
-      * Multi-page image formats will have copies applied by the upstream
-      * filters...
-      */
+      //
+      // Multi-page image formats will have copies applied by the upstream
+      // filters...
+      //
 
       copies = 1;
     }
@@ -424,44 +462,57 @@ ppdConvertOptions(
       copies = 1;
   }
 
- /*
-  * Map finishing options...
-  */
+  //
+  // Map finishing options...
+  //
 
-  if ((finishing_template = cupsGetOption("cupsFinishingTemplate", num_options, options)) == NULL)
-    finishing_template = cupsGetOption("finishing-template", num_options, options);
+  if ((finishing_template = cupsGetOption("cupsFinishingTemplate",
+                                         num_options, options)) == NULL)
+    finishing_template = cupsGetOption("finishing-template",
+                                      num_options, options);
 
   if (finishing_template && strcmp(finishing_template, "none"))
   {
-    ipp_t *fin_col = ippNew();         /* finishings-col value */
+    ipp_t *fin_col = ippNew();         // finishings-col value
 
-    ippAddString(fin_col, IPP_TAG_JOB, IPP_TAG_KEYWORD, "finishing-template", NULL, finishing_template);
+    ippAddString(fin_col, IPP_TAG_JOB, IPP_TAG_KEYWORD, "finishing-template",
+                NULL, finishing_template);
     ippAddCollection(request, IPP_TAG_JOB, "finishings-col", fin_col);
     ippDelete(fin_col);
 
-    if (copies != finishings_copies && (keyword = cupsGetOption("job-impressions", num_options, options)) != NULL)
+    if (copies != finishings_copies &&
+       (keyword = cupsGetOption("job-impressions",
+                                num_options, options)) != NULL)
     {
-     /*
-      * Send job-pages-per-set attribute to apply finishings correctly...
-      */
+      //
+      // Send job-pages-per-set attribute to apply finishings correctly...
+      //
 
-      ippAddInteger(request, IPP_TAG_JOB, IPP_TAG_INTEGER, "job-pages-per-set", atoi(keyword) / finishings_copies);
+      ippAddInteger(request, IPP_TAG_JOB, IPP_TAG_INTEGER, "job-pages-per-set",
+                   atoi(keyword) / finishings_copies);
     }
   }
   else
   {
-    num_finishings = ppdCacheGetFinishingValues(ppd, pc, (int)(sizeof(finishings) / sizeof(finishings[0])), finishings);
+    num_finishings =
+      ppdCacheGetFinishingValues(ppd, pc,
+                                (int)(sizeof(finishings) /
+                                      sizeof(finishings[0])), finishings);
     if (num_finishings > 0)
     {
-      ippAddIntegers(request, IPP_TAG_JOB, IPP_TAG_ENUM, "finishings", num_finishings, finishings);
+      ippAddIntegers(request, IPP_TAG_JOB, IPP_TAG_ENUM, "finishings",
+                    num_finishings, finishings);
 
-      if (copies != finishings_copies && (keyword = cupsGetOption("job-impressions", num_options, options)) != NULL)
+      if (copies != finishings_copies &&
+         (keyword = cupsGetOption("job-impressions",
+                                  num_options, options)) != NULL)
       {
-       /*
-       * Send job-pages-per-set attribute to apply finishings correctly...
-       */
+       //
+       // Send job-pages-per-set attribute to apply finishings correctly...
+       //
 
-       ippAddInteger(request, IPP_TAG_JOB, IPP_TAG_INTEGER, "job-pages-per-set", atoi(keyword) / finishings_copies);
+       ippAddInteger(request, IPP_TAG_JOB, IPP_TAG_INTEGER,
+                     "job-pages-per-set", atoi(keyword) / finishings_copies);
       }
     }
   }
@@ -470,46 +521,46 @@ ppdConvertOptions(
 }
 
 
-/*
- * 'ppdCacheCreateWithFile()' - Create PPD cache and mapping data from a
- *                               written file.
- *
- * Use the @link ppdCacheWriteFile@ function to write PWG mapping data to a
- * file.
- */
+//
+// 'ppdCacheCreateWithFile()' - Create PPD cache and mapping data from a
+//                               written file.
+//
+// Use the @link ppdCacheWriteFile@ function to write PWG mapping data to a
+// file.
+//
 
-ppd_cache_t *                          /* O  - PPD cache and mapping data */
+ppd_cache_t *                          // O  - PPD cache and mapping data
 ppdCacheCreateWithFile(
-    const char *filename,              /* I  - File to read */
-    ipp_t      **attrs)                        /* IO - IPP attributes, if any */
+    const char *filename,              // I  - File to read
+    ipp_t      **attrs)                        // IO - IPP attributes, if any
 {
-  cups_file_t  *fp;                    /* File */
-  ppd_cache_t  *pc;                    /* PWG mapping data */
-  pwg_size_t   *size;                  /* Current size */
-  pwg_map_t    *map;                   /* Current map */
-  ppd_pwg_finishings_t *finishings;    /* Current finishings option */
-  int          linenum,                /* Current line number */
-               num_bins,               /* Number of bins in file */
-               num_sizes,              /* Number of sizes in file */
-               num_sources,            /* Number of sources in file */
-               num_types;              /* Number of types in file */
-  char         line[2048],             /* Current line */
-               *value,                 /* Pointer to value in line */
-               *valueptr,              /* Pointer into value */
-               pwg_keyword[128],       /* PWG keyword */
+  cups_file_t  *fp;                    // File
+  ppd_cache_t  *pc;                    // PWG mapping data
+  pwg_size_t   *size;                  // Current size
+  pwg_map_t    *map;                   // Current map
+  ppd_pwg_finishings_t *finishings;    // Current finishings option
+  int          linenum,                // Current line number
+               num_bins,               // Number of bins in file
+               num_sizes,              // Number of sizes in file
+               num_sources,            // Number of sources in file
+               num_types;              // Number of types in file
+  char         line[2048],             // Current line
+               *value,                 // Pointer to value in line
+               *valueptr,              // Pointer into value
+               pwg_keyword[128],       // PWG keyword
                ppd_keyword[PPD_MAX_NAME];
-                                       /* PPD keyword */
+                                       // PPD keyword
   ppd_pwg_print_color_mode_t print_color_mode;
-                                       /* Print color mode for preset */
-  ppd_pwg_print_quality_t print_quality;/* Print quality for preset */
+                                       // Print color mode for preset
+  ppd_pwg_print_quality_t print_quality;// Print quality for preset
   ppd_pwg_print_content_optimize_t print_content_optimize;
-                                        /* Content optimize for preset */
+                                        // Content optimize for preset
 
   DEBUG_printf(("ppdCacheCreateWithFile(filename=\"%s\")", filename));
 
- /*
-  * Range check input...
-  */
+  //
+  // Range check input...
+  //
 
   if (attrs)
     *attrs = NULL;
@@ -520,9 +571,9 @@ ppdCacheCreateWithFile(
     return (NULL);
   }
 
- /*
-  * Open the file...
-  */
+  //
+  // Open the file...
+  //
 
   if ((fp = cupsFileOpen(filename, "r")) == NULL)
   {
@@ -530,9 +581,9 @@ ppdCacheCreateWithFile(
     return (NULL);
   }
 
- /*
-  * Read the first line and make sure it has "#CUPS-PPD-CACHE-version" in it...
-  */
+  //
+  // Read the first line and make sure it has "#CUPS-PPD-CACHE-version" in it...
+  //
 
   if (!cupsFileGets(fp, line, sizeof(line)))
   {
@@ -559,9 +610,9 @@ ppdCacheCreateWithFile(
     return (NULL);
   }
 
- /*
-  * Allocate the mapping data structure...
-  */
+  //
+  // Allocate the mapping data structure...
+  //
 
   if ((pc = calloc(1, sizeof(ppd_cache_t))) == NULL)
   {
@@ -572,9 +623,9 @@ ppdCacheCreateWithFile(
 
   pc->max_copies = 9999;
 
- /*
-  * Read the file...
-  */
+  //
+  // Read the file...
+  //
 
   linenum     = 0;
   num_bins    = 0;
@@ -597,14 +648,18 @@ ppdCacheCreateWithFile(
     else if (!_ppd_strcasecmp(line, "Filter"))
     {
       if (!pc->filters)
-        pc->filters = cupsArrayNew3(NULL, NULL, NULL, 0, (cups_acopy_func_t)strdup, (cups_afree_func_t)free);
+        pc->filters = cupsArrayNew3(NULL, NULL, NULL, 0,
+                                   (cups_acopy_func_t)strdup,
+                                   (cups_afree_func_t)free);
 
       cupsArrayAdd(pc->filters, value);
     }
     else if (!_ppd_strcasecmp(line, "PreFilter"))
     {
       if (!pc->prefilters)
-        pc->prefilters = cupsArrayNew3(NULL, NULL, NULL, 0, (cups_acopy_func_t)strdup, (cups_afree_func_t)free);
+        pc->prefilters = cupsArrayNew3(NULL, NULL, NULL, 0,
+                                      (cups_acopy_func_t)strdup,
+                                      (cups_afree_func_t)free);
 
       cupsArrayAdd(pc->prefilters, value);
     }
@@ -618,9 +673,9 @@ ppdCacheCreateWithFile(
     }
     else if (!_ppd_strcasecmp(line, "IPP"))
     {
-      off_t    pos = cupsFileTell(fp), /* Position in file */
+      off_t    pos = cupsFileTell(fp), // Position in file
                length = strtol(value, NULL, 10);
-                                       /* Length of IPP attributes */
+                                       // Length of IPP attributes
 
       if (attrs && *attrs)
       {
@@ -637,9 +692,9 @@ ppdCacheCreateWithFile(
 
       if (attrs)
       {
-       /*
-        * Read IPP attributes into the provided variable...
-       */
+       //
+        // Read IPP attributes into the provided variable...
+       //
 
         *attrs = ippNew();
 
@@ -653,9 +708,9 @@ ppdCacheCreateWithFile(
       }
       else
       {
-       /*
-        * Skip the IPP data entirely...
-       */
+       //
+        // Skip the IPP data entirely...
+       //
 
         cupsFileSeek(fp, pos + length);
       }
@@ -822,7 +877,8 @@ ppdCacheCreateWithFile(
        goto create_error;
       }
 
-      if ((pc->sources = calloc((size_t)num_sources, sizeof(pwg_map_t))) == NULL)
+      if ((pc->sources = calloc((size_t)num_sources,
+                               sizeof(pwg_map_t))) == NULL)
       {
         DEBUG_printf(("ppdCacheCreateWithFile: Unable to allocate %d sources.",
                      num_sources));
@@ -905,12 +961,14 @@ ppdCacheCreateWithFile(
     }
     else if (!_ppd_strcasecmp(line, "Preset"))
     {
-     /*
-      * Preset output-mode print-quality name=value ...
-      */
+      //
+      // Preset output-mode print-quality name=value ...
+      //
 
-      print_color_mode = (ppd_pwg_print_color_mode_t)strtol(value, &valueptr, 10);
-      print_quality    = (ppd_pwg_print_quality_t)strtol(valueptr, &valueptr, 10);
+      print_color_mode =
+       (ppd_pwg_print_color_mode_t)strtol(value, &valueptr, 10);
+      print_quality =
+       (ppd_pwg_print_quality_t)strtol(valueptr, &valueptr, 10);
 
       if (print_color_mode < PPD_PWG_PRINT_COLOR_MODE_MONOCHROME ||
           print_color_mode >= PPD_PWG_PRINT_COLOR_MODE_MAX ||
@@ -930,11 +988,12 @@ ppdCacheCreateWithFile(
     }
     else if (!_ppd_strcasecmp(line, "OptimizePreset"))
     {
-     /*
-      * Preset print_content_optimize name=value ...
-      */
+      //
+      // Preset print_content_optimize name=value ...
+      //
 
-      print_content_optimize = (ppd_pwg_print_content_optimize_t)strtol(value, &valueptr, 10);
+      print_content_optimize =
+       (ppd_pwg_print_content_optimize_t)strtol(value, &valueptr, 10);
 
       if (print_content_optimize < PPD_PWG_PRINT_CONTENT_OPTIMIZE_AUTO ||
           print_content_optimize >= PPD_PWG_PRINT_CONTENT_OPTIMIZE_MAX ||
@@ -978,7 +1037,9 @@ ppdCacheCreateWithFile(
     else if (!_ppd_strcasecmp(line, "FinishingTemplate"))
     {
       if (!pc->templates)
-        pc->templates = cupsArrayNew3((cups_array_func_t)strcmp, NULL, NULL, 0, (cups_acopy_func_t)strdup, (cups_afree_func_t)free);
+        pc->templates = cupsArrayNew3((cups_array_func_t)strcmp, NULL, NULL, 0,
+                                     (cups_acopy_func_t)strdup,
+                                     (cups_afree_func_t)free);
 
       cupsArrayAdd(pc->templates, value);
     }
@@ -1002,7 +1063,9 @@ ppdCacheCreateWithFile(
     else if (!_ppd_strcasecmp(line, "SupportFile"))
     {
       if (!pc->support_files)
-        pc->support_files = cupsArrayNew3(NULL, NULL, NULL, 0, (cups_acopy_func_t)strdup, (cups_afree_func_t)free);
+        pc->support_files = cupsArrayNew3(NULL, NULL, NULL, 0,
+                                         (cups_acopy_func_t)strdup,
+                                         (cups_afree_func_t)free);
 
       cupsArrayAdd(pc->support_files, value);
     }
@@ -1041,9 +1104,9 @@ ppdCacheCreateWithFile(
 
   return (pc);
 
- /*
-  * If we get here the file was bad - free any data and return...
-  */
+  //
+  // If we get here the file was bad - free any data and return...
+  //
 
   create_error:
 
@@ -1060,71 +1123,71 @@ ppdCacheCreateWithFile(
 }
 
 
-/*
- * 'ppdCacheCreateWithPPD()' - Create PWG mapping data from a PPD file.
- */
+//
+// 'ppdCacheCreateWithPPD()' - Create PWG mapping data from a PPD file.
+//
 
-ppd_cache_t *                          /* O - PPD cache and mapping data */
-ppdCacheCreateWithPPD(ppd_file_t *ppd) /* I - PPD file */
+ppd_cache_t *                          // O - PPD cache and mapping data
+ppdCacheCreateWithPPD(ppd_file_t *ppd) // I - PPD file
 {
-  int                  i, j, k;        /* Looping vars */
-  ppd_cache_t          *pc;            /* PWG mapping data */
-  ppd_option_t         *input_slot,    /* InputSlot option */
-                       *media_type,    /* MediaType option */
-                       *output_bin,    /* OutputBin option */
-                       *color_model,   /* ColorModel option */
-                       *duplex,        /* Duplex option */
-                       *ppd_option;    /* Other PPD option */
-  ppd_choice_t         *choice;        /* Current InputSlot/MediaType */
-  pwg_map_t            *map;           /* Current source/type map */
-  int                   preset_added = 0; /* Preset definition found in PPD? */
-  ppd_attr_t           *ppd_attr;      /* Current PPD preset attribute */
-  int                  num_options;    /* Number of preset options and props */
-  cups_option_t                *options;       /* Preset options and properties */
-  ppd_size_t           *ppd_size;      /* Current PPD size */
-  pwg_size_t           *pwg_size;      /* Current PWG size */
+  int                  i, j, k;        // Looping vars
+  ppd_cache_t          *pc;            // PWG mapping data
+  ppd_option_t         *input_slot,    // InputSlot option
+                       *media_type,    // MediaType option
+                       *output_bin,    // OutputBin option
+                       *color_model,   // ColorModel option
+                       *duplex,        // Duplex option
+                       *ppd_option;    // Other PPD option
+  ppd_choice_t         *choice;        // Current InputSlot/MediaType
+  pwg_map_t            *map;           // Current source/type map
+  int                   preset_added = 0; // Preset definition found in PPD?
+  ppd_attr_t           *ppd_attr;      // Current PPD preset attribute
+  int                  num_options;    // Number of preset options and props
+  cups_option_t                *options;       // Preset options and properties
+  ppd_size_t           *ppd_size;      // Current PPD size
+  pwg_size_t           *pwg_size;      // Current PWG size
   char                 pwg_keyword[3 + PPD_MAX_NAME + 1 + 12 + 1 + 12 + 3],
-                                       /* PWG keyword string */
+                                       // PWG keyword string
                        ppd_name[PPD_MAX_NAME];
-                                       /* Normalized PPD name */
-  const char           *pwg_name;      /* Standard PWG media name */
-  pwg_media_t          *pwg_media;     /* PWG media data */
+                                       // Normalized PPD name
+  const char           *pwg_name;      // Standard PWG media name
+  pwg_media_t          *pwg_media;     // PWG media data
   ppd_pwg_print_color_mode_t pwg_print_color_mode;
-                                       /* print-color-mode index */
-  ppd_pwg_print_quality_t      pwg_print_quality;
-                                       /* print-quality index */
-  int                  similar;        /* Are the old and new size similar? */
-  pwg_size_t           *old_size;      /* Current old size */
-  int                  old_imageable,  /* Old imageable length in 2540ths */
-                       old_borderless, /* Old borderless state */
-                       old_known_pwg;  /* Old PWG name is well-known */
-  int                  new_width,      /* New width in 2540ths */
-                       new_length,     /* New length in 2540ths */
-                       new_left,       /* New left margin in 2540ths */
-                       new_bottom,     /* New bottom margin in 2540ths */
-                       new_right,      /* New right margin in 2540ths */
-                       new_top,        /* New top margin in 2540ths */
-                       new_imageable,  /* New imageable length in 2540ths */
-                       new_borderless, /* New borderless state */
-                       new_known_pwg;  /* New PWG name is well-known */
-  pwg_size_t           *new_size;      /* New size to add, if any */
-  const char           *filter;        /* Current filter */
-  ppd_pwg_finishings_t *finishings;    /* Current finishings value */
-  char                 msg_id[256];    /* Message identifier */
+                                       // print-color-mode index
+  ppd_pwg_print_quality_t pwg_print_quality;
+                                       // print-quality index
+  int                  similar;        // Are the old and new size similar?
+  pwg_size_t           *old_size;      // Current old size
+  int                  old_imageable,  // Old imageable length in 2540ths
+                       old_borderless, // Old borderless state
+                       old_known_pwg;  // Old PWG name is well-known
+  int                  new_width,      // New width in 2540ths
+                       new_length,     // New length in 2540ths
+                       new_left,       // New left margin in 2540ths
+                       new_bottom,     // New bottom margin in 2540ths
+                       new_right,      // New right margin in 2540ths
+                       new_top,        // New top margin in 2540ths
+                       new_imageable,  // New imageable length in 2540ths
+                       new_borderless, // New borderless state
+                       new_known_pwg;  // New PWG name is well-known
+  pwg_size_t           *new_size;      // New size to add, if any
+  const char           *filter;        // Current filter
+  ppd_pwg_finishings_t *finishings;    // Current finishings value
+  char                 msg_id[256];    // Message identifier
 
 
   DEBUG_printf(("ppdCacheCreateWithPPD(ppd=%p)", ppd));
 
- /*
-  * Range check input...
-  */
+  //
+  // Range check input...
+  //
 
   if (!ppd)
     return (NULL);
 
- /*
-  * Allocate memory...
-  */
+  //
+  // Allocate memory...
+  //
 
   if ((pc = calloc(1, sizeof(ppd_cache_t))) == NULL)
   {
@@ -1134,13 +1197,14 @@ ppdCacheCreateWithPPD(ppd_file_t *ppd)  /* I - PPD file */
 
   pc->strings = _ppdMessageNew(NULL);
 
- /*
-  * Copy and convert size data...
-  */
+  //
+  // Copy and convert size data...
+  //
 
   if (ppd->num_sizes > 0)
   {
-    if ((pc->sizes = calloc((size_t)ppd->num_sizes, sizeof(pwg_size_t))) == NULL)
+    if ((pc->sizes = calloc((size_t)ppd->num_sizes,
+                           sizeof(pwg_size_t))) == NULL)
     {
       DEBUG_printf(("ppdCacheCreateWithPPD: Unable to allocate %d "
                    "pwg_size_t's.", ppd->num_sizes));
@@ -1151,22 +1215,24 @@ ppdCacheCreateWithPPD(ppd_file_t *ppd)  /* I - PPD file */
         i > 0;
         i --, ppd_size ++)
     {
-     /*
-      * Don't copy over custom size...
-      */
+      //
+      // Don't copy over custom size...
+      //
 
       if (!_ppd_strcasecmp(ppd_size->name, "Custom"))
        continue;
 
-     /*
-      * Convert the PPD size name to the corresponding PWG keyword name.
-      */
+      //
+      // Convert the PPD size name to the corresponding PWG keyword name.
+      //
 
-      if ((pwg_media = pwgMediaForSize(PWG_FROM_POINTS(ppd_size->width), PWG_FROM_POINTS(ppd_size->length))) != NULL)
+      if ((pwg_media =
+          pwgMediaForSize(PWG_FROM_POINTS(ppd_size->width),
+                          PWG_FROM_POINTS(ppd_size->length))) != NULL)
       {
-       /*
-       * Standard name, do we have conflicts?
-       */
+       //
+       // Standard name, do we have conflicts?
+       //
 
        for (j = 0; j < pc->num_sizes; j ++)
          if (!strcmp(pc->sizes[j].map.pwg, pwg_media->pwg))
@@ -1178,20 +1244,20 @@ ppdCacheCreateWithPPD(ppd_file_t *ppd)  /* I - PPD file */
 
       if (pwg_media && strncmp(pwg_media->pwg, "custom_", 7) != 0)
       {
-       /*
-       * Standard name and no conflicts, use it!
-       */
+       //
+       // Standard name and no conflicts, use it!
+       //
 
        pwg_name      = pwg_media->pwg;
        new_known_pwg = 1;
       }
       else
       {
-       /*
-       * Not a standard name; convert it to a PWG vendor name of the form:
-       *
-       *     pp_lowerppd_WIDTHxHEIGHTuu
-       */
+       //
+       // Not a standard name; convert it to a PWG vendor name of the form:
+       //
+       //     pp_lowerppd_WIDTHxHEIGHTuu
+       //
 
        pwg_name      = pwg_keyword;
        new_known_pwg = 0;
@@ -1202,11 +1268,11 @@ ppdCacheCreateWithPPD(ppd_file_t *ppd)  /* I - PPD file */
                          PWG_FROM_POINTS(ppd_size->length), NULL);
       }
 
-     /*
-      * If we have a similar paper with non-zero margins then we only want to
-      * keep it if it has a larger imageable area length.  The NULL check is for
-      * dimensions that are <= 0...
-      */
+      //
+      // If we have a similar paper with non-zero margins then we only
+      // want to keep it if it has a larger imageable area length.
+      // The NULL check is for dimensions that are <= 0...
+      //
 
       if ((pwg_media = pwgMediaForSize(PWG_FROM_POINTS(ppd_size->width),
                                       PWG_FROM_POINTS(ppd_size->length))) ==
@@ -1223,7 +1289,8 @@ ppdCacheCreateWithPPD(ppd_file_t *ppd)    /* I - PPD file */
       new_borderless = new_bottom == 0 && new_top == 0 &&
                       new_left == 0 && new_right == 0;
 
-      for (k = pc->num_sizes, similar = 0, old_size = pc->sizes, new_size = NULL;
+      for (k = pc->num_sizes, similar = 0, old_size = pc->sizes,
+            new_size = NULL;
           k > 0 && !similar;
           k --, old_size ++)
       {
@@ -1238,13 +1305,14 @@ ppdCacheCreateWithPPD(ppd_file_t *ppd)  /* I - PPD file */
                  _PPD_PWG_EQUIVALENT(old_size->length, new_length);
 
        if (similar &&
-           (new_known_pwg || (!old_known_pwg && new_imageable > old_imageable)))
+           (new_known_pwg ||
+            (!old_known_pwg && new_imageable > old_imageable)))
        {
-        /*
-         * The new paper has a larger imageable area so it could replace
-         * the older paper.  Regardless of the imageable area, we always
-         * prefer the size with a well-known PWG name.
-         */
+         //
+         // The new paper has a larger imageable area so it could replace
+         // the older paper.  Regardless of the imageable area, we always
+         // prefer the size with a well-known PWG name.
+         //
 
          new_size = old_size;
          free(old_size->map.ppd);
@@ -1254,10 +1322,10 @@ ppdCacheCreateWithPPD(ppd_file_t *ppd)  /* I - PPD file */
 
       if (!similar)
       {
-       /*
-       * The paper was unique enough to deserve its own entry so add it to the
-       * end.
-       */
+       //
+       // The paper was unique enough to deserve its own entry so add it to the
+       // end.
+       //
 
        new_size = pwg_size ++;
        pc->num_sizes ++;
@@ -1265,9 +1333,9 @@ ppdCacheCreateWithPPD(ppd_file_t *ppd)    /* I - PPD file */
 
       if (new_size)
       {
-       /*
-       * Save this size...
-       */
+       //
+       // Save this size...
+       //
 
        new_size->map.ppd = strdup(ppd_size->name);
        new_size->map.pwg = strdup(pwg_name);
@@ -1283,17 +1351,17 @@ ppdCacheCreateWithPPD(ppd_file_t *ppd)  /* I - PPD file */
 
   if (ppd->variable_sizes)
   {
-   /*
-    * Generate custom size data...
-    */
+    //
+    // Generate custom size data...
+    //
 
     pwgFormatSizeName(pwg_keyword, sizeof(pwg_keyword), "custom", "max",
                      PWG_FROM_POINTS(ppd->custom_max[0]),
                      PWG_FROM_POINTS(ppd->custom_max[1]), NULL);
 
-    /* Some PPD files have upper limits too large to be treated with
-       int numbers, if we have an overflow (negative result for one
-       dimension) use a fixed, large value instead */
+    // Some PPD files have upper limits too large to be treated with
+    // int numbers, if we have an overflow (negative result for one
+    // dimension) use a fixed, large value instead
     char *p1, *p2;
     char *newmax = (pwg_keyword[strlen(pwg_keyword) - 1] == 'n' ?
                    "10000" : "100000");
@@ -1331,9 +1399,9 @@ ppdCacheCreateWithPPD(ppd_file_t *ppd)    /* I - PPD file */
     pc->custom_size.top    = PWG_FROM_POINTS(ppd->custom_margins[3]);
   }
 
- /*
-  * Copy and convert InputSlot data...
-  */
+  //
+  // Copy and convert InputSlot data...
+  //
 
   if ((input_slot = ppdFindOption(ppd, "InputSlot")) == NULL)
     input_slot = ppdFindOption(ppd, "HPPaperSource");
@@ -1342,7 +1410,8 @@ ppdCacheCreateWithPPD(ppd_file_t *ppd)    /* I - PPD file */
   {
     pc->source_option = strdup(input_slot->keyword);
 
-    if ((pc->sources = calloc((size_t)input_slot->num_choices, sizeof(pwg_map_t))) == NULL)
+    if ((pc->sources = calloc((size_t)input_slot->num_choices,
+                             sizeof(pwg_map_t))) == NULL)
     {
       DEBUG_printf(("ppdCacheCreateWithPPD: Unable to allocate %d "
                     "pwg_map_t's for InputSlot.", input_slot->num_choices));
@@ -1383,9 +1452,9 @@ ppdCacheCreateWithPPD(ppd_file_t *ppd)    /* I - PPD file */
         pwg_name = "main-roll";
       else
       {
-       /*
-        * Convert PPD name to lowercase...
-       */
+       //
+        // Convert PPD name to lowercase...
+       //
 
         pwg_name = pwg_keyword;
        ppdPwgUnppdizeName(choice->choice, pwg_keyword, sizeof(pwg_keyword),
@@ -1395,22 +1464,23 @@ ppdCacheCreateWithPPD(ppd_file_t *ppd)  /* I - PPD file */
       map->pwg = strdup(pwg_name);
       map->ppd = strdup(choice->choice);
 
-     /*
-      * Add localized text for PWG keyword to message catalog...
-      */
+      //
+      // Add localized text for PWG keyword to message catalog...
+      //
 
       snprintf(msg_id, sizeof(msg_id), "media-source.%s", pwg_name);
       ppd_pwg_add_message(pc->strings, msg_id, choice->text);
     }
   }
 
- /*
-  * Copy and convert MediaType data...
-  */
+  //
+  // Copy and convert MediaType data...
+  //
 
   if ((media_type = ppdFindOption(ppd, "MediaType")) != NULL)
   {
-    if ((pc->types = calloc((size_t)media_type->num_choices, sizeof(pwg_map_t))) == NULL)
+    if ((pc->types = calloc((size_t)media_type->num_choices,
+                           sizeof(pwg_map_t))) == NULL)
     {
       DEBUG_printf(("ppdCacheCreateWithPPD: Unable to allocate %d "
                     "pwg_map_t's for MediaType.", media_type->num_choices));
@@ -1454,9 +1524,9 @@ ppdCacheCreateWithPPD(ppd_file_t *ppd)    /* I - PPD file */
         pwg_name = "transparency";
       else
       {
-       /*
-        * Convert PPD name to lowercase...
-       */
+       //
+        // Convert PPD name to lowercase...
+       //
 
         pwg_name = pwg_keyword;
        ppdPwgUnppdizeName(choice->choice, pwg_keyword, sizeof(pwg_keyword),
@@ -1466,22 +1536,23 @@ ppdCacheCreateWithPPD(ppd_file_t *ppd)  /* I - PPD file */
       map->pwg = strdup(pwg_name);
       map->ppd = strdup(choice->choice);
 
-     /*
-      * Add localized text for PWG keyword to message catalog...
-      */
+      //
+      // Add localized text for PWG keyword to message catalog...
+      //
 
       snprintf(msg_id, sizeof(msg_id), "media-type.%s", pwg_name);
       ppd_pwg_add_message(pc->strings, msg_id, choice->text);
     }
   }
 
- /*
-  * Copy and convert OutputBin data...
-  */
+  //
+  // Copy and convert OutputBin data...
+  //
 
   if ((output_bin = ppdFindOption(ppd, "OutputBin")) != NULL)
   {
-    if ((pc->bins = calloc((size_t)output_bin->num_choices, sizeof(pwg_map_t))) == NULL)
+    if ((pc->bins = calloc((size_t)output_bin->num_choices,
+                          sizeof(pwg_map_t))) == NULL)
     {
       DEBUG_printf(("ppdCacheCreateWithPPD: Unable to allocate %d "
                     "pwg_map_t's for OutputBin.", output_bin->num_choices));
@@ -1500,9 +1571,9 @@ ppdCacheCreateWithPPD(ppd_file_t *ppd)    /* I - PPD file */
       map->pwg = strdup(pwg_keyword);
       map->ppd = strdup(choice->choice);
 
-     /*
-      * Add localized text for PWG keyword to message catalog...
-      */
+      //
+      // Add localized text for PWG keyword to message catalog...
+      //
 
       snprintf(msg_id, sizeof(msg_id), "output-bin.%s", pwg_keyword);
       ppd_pwg_add_message(pc->strings, msg_id, choice->text);
@@ -1511,32 +1582,35 @@ ppdCacheCreateWithPPD(ppd_file_t *ppd)  /* I - PPD file */
 
   if ((ppd_attr = ppdFindAttr(ppd, "APPrinterPreset", NULL)) != NULL)
   {
-   /*
-    * "Classic" Mac OS approach
-    */
-
-   /*
-    * Copy and convert APPrinterPreset (output-mode + print-quality) data...
-    */
-
-    const char *quality,               /* com.apple.print.preset.quality value */
-               *output_mode,           /* com.apple.print.preset.output-mode value */
-               *color_model_val,       /* ColorModel choice */
-               *graphicsType,          /* com.apple.print.preset.graphicsType value */
-               *media_front_coating;   /* com.apple.print.preset.media-front-coating value */
+    //
+    // "Classic" Mac OS approach
+    //
+
+    //
+    // Copy and convert APPrinterPreset (output-mode + print-quality) data...
+    //
+
+    const char *quality,               // com.apple.print.preset.quality value
+               *output_mode,           // com.apple.print.preset.output-mode
+                                       // value
+               *color_model_val,       // ColorModel choice
+               *graphicsType,          // com.apple.print.preset.graphicsType
+                                       // value
+               *media_front_coating;
+                             // com.apple.print.preset.media-front-coating value
 
     do
     {
-     /*
-      * Add localized text for PWG keyword to message catalog...
-      */
+      //
+      // Add localized text for PWG keyword to message catalog...
+      //
 
       snprintf(msg_id, sizeof(msg_id), "preset-name.%s", ppd_attr->spec);
       ppd_pwg_add_message(pc->strings, msg_id, ppd_attr->text);
 
-     /*
-      * Get the options for this preset...
-      */
+      //
+      // Get the options for this preset...
+      //
 
       num_options = ppdParseOptions(ppd_attr->value, 0, &options,
                                      PPD_PARSE_ALL);
@@ -1544,9 +1618,9 @@ ppdCacheCreateWithPPD(ppd_file_t *ppd)    /* I - PPD file */
       if ((quality = cupsGetOption("com.apple.print.preset.quality",
                                    num_options, options)) != NULL)
       {
-       /*
-        * Get the print-quality for this preset...
-       */
+       //
+        // Get the print-quality for this preset...
+       //
 
        if (!strcmp(quality, "low"))
          pwg_print_quality = PPD_PWG_PRINT_QUALITY_DRAFT;
@@ -1555,9 +1629,9 @@ ppdCacheCreateWithPPD(ppd_file_t *ppd)    /* I - PPD file */
        else
          pwg_print_quality = PPD_PWG_PRINT_QUALITY_NORMAL;
 
-       /*
-       * Ignore graphicsType "Photo" presets that are not high quality.
-       */
+       //
+       // Ignore graphicsType "Photo" presets that are not high quality.
+       //
 
        graphicsType = cupsGetOption("com.apple.print.preset.graphicsType",
                                      num_options, options);
@@ -1566,10 +1640,10 @@ ppdCacheCreateWithPPD(ppd_file_t *ppd)  /* I - PPD file */
            !strcmp(graphicsType, "Photo"))
          continue;
 
-       /*
-       * Ignore presets for normal and draft quality where the coating
-       * isn't "none" or "autodetect".
-       */
+       //
+       // Ignore presets for normal and draft quality where the coating
+       // isn't "none" or "autodetect".
+       //
 
        media_front_coating = cupsGetOption(
                                  "com.apple.print.preset.media-front-coating",
@@ -1581,9 +1655,9 @@ ppdCacheCreateWithPPD(ppd_file_t *ppd)    /* I - PPD file */
            strcmp(media_front_coating, "autodetect"))
          continue;
 
-       /*
-        * Get the output mode for this preset...
-       */
+       //
+        // Get the output mode for this preset...
+       //
 
         output_mode     = cupsGetOption("com.apple.print.preset.output-mode",
                                        num_options, options);
@@ -1606,9 +1680,9 @@ ppdCacheCreateWithPPD(ppd_file_t *ppd)    /* I - PPD file */
        else
          pwg_print_color_mode = PPD_PWG_PRINT_COLOR_MODE_COLOR;
 
-       /*
-        * Save the options for this combination as needed...
-       */
+       //
+        // Save the options for this combination as needed...
+       //
 
         if (!pc->num_presets[pwg_print_color_mode][pwg_print_quality])
          pc->num_presets[pwg_print_color_mode][pwg_print_quality] =
@@ -1627,13 +1701,13 @@ ppdCacheCreateWithPPD(ppd_file_t *ppd)  /* I - PPD file */
        !pc->num_presets[PPD_PWG_PRINT_COLOR_MODE_MONOCHROME][PPD_PWG_PRINT_QUALITY_NORMAL] &&
        !pc->num_presets[PPD_PWG_PRINT_COLOR_MODE_MONOCHROME][PPD_PWG_PRINT_QUALITY_HIGH])
     {
-     /*
-      * Try adding some common color options to create grayscale presets.  These
-      * are listed in order of popularity...
-      */
+      //
+      // Try adding some common color options to create grayscale
+      // presets. These are listed in order of popularity...
+      //
 
-      const char       *color_option = NULL,   /* Color control option */
-                       *gray_choice = NULL;    /* Choice to select grayscale */
+      const char       *color_option = NULL,   // Color control option
+                       *gray_choice = NULL;    // Choice to select grayscale
 
       if ((color_model = ppdFindOption(ppd, "ColorModel")) != NULL &&
          ppdFindChoice(color_model, "Gray"))
@@ -1668,12 +1742,12 @@ ppdCacheCreateWithPPD(ppd_file_t *ppd)  /* I - PPD file */
 
       if (color_option && gray_choice)
       {
-       /*
-       * Copy and convert ColorModel (output-mode) data...
-       */
+       //
+       // Copy and convert ColorModel (output-mode) data...
+       //
 
-       cups_option_t   *coption,       /* Color option */
-                       *moption;       /* Monochrome option */
+       cups_option_t   *coption,       // Color option
+                       *moption;       // Monochrome option
 
        for (pwg_print_quality = PPD_PWG_PRINT_QUALITY_DRAFT;
             pwg_print_quality < PPD_PWG_PRINT_QUALITY_MAX;
@@ -1681,9 +1755,9 @@ ppdCacheCreateWithPPD(ppd_file_t *ppd)    /* I - PPD file */
         {
          if (pc->num_presets[PPD_PWG_PRINT_COLOR_MODE_COLOR][pwg_print_quality])
          {
-          /*
-           * Copy the color options...
-           */
+           //
+           // Copy the color options...
+           //
 
            num_options = pc->num_presets[PPD_PWG_PRINT_COLOR_MODE_COLOR]
                                         [pwg_print_quality];
@@ -1710,9 +1784,9 @@ ppdCacheCreateWithPPD(ppd_file_t *ppd)    /* I - PPD file */
          else if (pwg_print_quality != PPD_PWG_PRINT_QUALITY_NORMAL)
            continue;
 
-         /*
-         * Add the grayscale option to the preset...
-         */
+         //
+         // Add the grayscale option to the preset...
+         //
 
          pc->num_presets[PPD_PWG_PRINT_COLOR_MODE_MONOCHROME][pwg_print_quality] =
              cupsAddOption(color_option, gray_choice,
@@ -1727,24 +1801,24 @@ ppdCacheCreateWithPPD(ppd_file_t *ppd)  /* I - PPD file */
 
   if (!preset_added)
   {
-   /*
-    * Auto-association of PPD file option settings with the IPP job attributes
-    * print-color-mode, print-quality, and print-content-optimize
-    *
-    * This is used to retro-fit PPD files and classic CUPS drivers into
-    * Printer Applications, which are IPP printers for the clients and so
-    * should get controlled by standard IPP attributes as far as possible
-    *
-    * Note that settings assigned to print-content-optimize are only used
-    * when printing with "high" print-quality
-    */
+    //
+    // Auto-association of PPD file option settings with the IPP job attributes
+    // print-color-mode, print-quality, and print-content-optimize
+    //
+    // This is used to retro-fit PPD files and classic CUPS drivers into
+    // Printer Applications, which are IPP printers for the clients and so
+    // should get controlled by standard IPP attributes as far as possible
+    //
+    // Note that settings assigned to print-content-optimize are only used
+    // when printing with "high" print-quality
+    //
 
     ppdCacheAssignPresets(ppd, pc);
   }
 
- /*
-  * Copy and convert Duplex (sides) data...
-  */
+  //
+  // Copy and convert Duplex (sides) data...
+  //
 
   if ((duplex = ppdFindOption(ppd, "Duplex")) == NULL)
     if ((duplex = ppdFindOption(ppd, "JCLDuplex")) == NULL)
@@ -1762,11 +1836,13 @@ ppdCacheCreateWithPPD(ppd_file_t *ppd)  /* I - PPD file */
         i --, choice ++)
     {
       if ((!_ppd_strcasecmp(choice->choice, "None") ||
-          !_ppd_strcasecmp(choice->choice, "False")) && !pc->sides_1sided)
+          !_ppd_strcasecmp(choice->choice, "False")) &&
+         !pc->sides_1sided)
         pc->sides_1sided = strdup(choice->choice);
       else if ((!_ppd_strcasecmp(choice->choice, "DuplexNoTumble") ||
                !_ppd_strcasecmp(choice->choice, "LongEdge") ||
-               !_ppd_strcasecmp(choice->choice, "Top")) && !pc->sides_2sided_long)
+               !_ppd_strcasecmp(choice->choice, "Top")) &&
+              !pc->sides_2sided_long)
         pc->sides_2sided_long = strdup(choice->choice);
       else if ((!_ppd_strcasecmp(choice->choice, "DuplexTumble") ||
                !_ppd_strcasecmp(choice->choice, "ShortEdge") ||
@@ -1776,11 +1852,12 @@ ppdCacheCreateWithPPD(ppd_file_t *ppd)  /* I - PPD file */
     }
   }
 
- /*
-  * Copy filters and pre-filters...
-  */
+  //
+  // Copy filters and pre-filters...
+  //
 
-  pc->filters = cupsArrayNew3(NULL, NULL, NULL, 0, (cups_acopy_func_t)strdup, (cups_afree_func_t)free);
+  pc->filters = cupsArrayNew3(NULL, NULL, NULL, 0, (cups_acopy_func_t)strdup,
+                             (cups_afree_func_t)free);
 
   cupsArrayAdd(pc->filters,
                "application/vnd.cups-raw application/octet-stream 0 -");
@@ -1801,9 +1878,9 @@ ppdCacheCreateWithPPD(ppd_file_t *ppd)    /* I - PPD file */
   else
     cupsArrayAdd(pc->filters, "application/vnd.cups-postscript 0 -");
 
- /*
-  * See if we have a command filter...
-  */
+  //
+  // See if we have a command filter...
+  //
 
   for (filter = (const char *)cupsArrayFirst(pc->filters);
        filter;
@@ -1816,11 +1893,11 @@ ppdCacheCreateWithPPD(ppd_file_t *ppd)  /* I - PPD file */
       ((ppd_attr = ppdFindAttr(ppd, "cupsCommands", NULL)) == NULL ||
        _ppd_strcasecmp(ppd_attr->value, "none")))
   {
-   /*
-    * No command filter and no cupsCommands keyword telling us not to use one.
-    * See if this is a PostScript printer, and if so add a PostScript command
-    * filter...
-    */
+    //
+    // No command filter and no cupsCommands keyword telling us not to use one.
+    // See if this is a PostScript printer, and if so add a PostScript command
+    // filter...
+    //
 
     for (filter = (const char *)cupsArrayFirst(pc->filters);
         filter;
@@ -1837,38 +1914,39 @@ ppdCacheCreateWithPPD(ppd_file_t *ppd)  /* I - PPD file */
 
   if ((ppd_attr = ppdFindAttr(ppd, "cupsPreFilter", NULL)) != NULL)
   {
-    pc->prefilters = cupsArrayNew3(NULL, NULL, NULL, 0, (cups_acopy_func_t)strdup, (cups_afree_func_t)free);
+    pc->prefilters = cupsArrayNew3(NULL, NULL, NULL, 0,
+                                  (cups_acopy_func_t)strdup,
+                                  (cups_afree_func_t)free);
 
     do
-    {
       cupsArrayAdd(pc->prefilters, ppd_attr->value);
-    }
     while ((ppd_attr = ppdFindNextAttr(ppd, "cupsPreFilter", NULL)) != NULL);
   }
 
   if ((ppd_attr = ppdFindAttr(ppd, "cupsSingleFile", NULL)) != NULL)
     pc->single_file = !_ppd_strcasecmp(ppd_attr->value, "true");
 
- /*
-  * Copy the product string, if any...
-  */
+  //
+  // Copy the product string, if any...
+  //
 
   if (ppd->product)
     pc->product = strdup(ppd->product);
 
- /*
-  * Copy finishings mapping data...
-  */
+  //
+  // Copy finishings mapping data...
+  //
 
   if ((ppd_attr = ppdFindAttr(ppd, "cupsIPPFinishings", NULL)) != NULL)
   {
-   /*
-    * Have proper vendor mapping of IPP finishings values to PPD options...
-    */
+    //
+    // Have proper vendor mapping of IPP finishings values to PPD options...
+    //
 
-    pc->finishings = cupsArrayNew3((cups_array_func_t)ppd_pwg_compare_finishings,
-                                   NULL, NULL, 0, NULL,
-                                   (cups_afree_func_t)ppd_pwg_free_finishings);
+    pc->finishings =
+      cupsArrayNew3((cups_array_func_t)ppd_pwg_compare_finishings,
+                   NULL, NULL, 0, NULL,
+                   (cups_afree_func_t)ppd_pwg_free_finishings);
 
     do
     {
@@ -1877,8 +1955,8 @@ ppdCacheCreateWithPPD(ppd_file_t *ppd)    /* I - PPD file */
 
       finishings->value       = (ipp_finishings_t)atoi(ppd_attr->spec);
       finishings->num_options = ppdParseOptions(ppd_attr->value, 0,
-                                                 &(finishings->options),
-                                                 PPD_PARSE_OPTIONS);
+                                               &(finishings->options),
+                                               PPD_PARSE_OPTIONS);
 
       cupsArrayAdd(pc->finishings, finishings);
     }
@@ -1887,64 +1965,92 @@ ppdCacheCreateWithPPD(ppd_file_t *ppd)  /* I - PPD file */
   }
   else
   {
-   /*
-    * No IPP mapping data, try to map common/standard PPD keywords...
-    */
+    //
+    // No IPP mapping data, try to map common/standard PPD keywords...
+    //
 
-    pc->finishings = cupsArrayNew3((cups_array_func_t)ppd_pwg_compare_finishings, NULL, NULL, 0, NULL, (cups_afree_func_t)ppd_pwg_free_finishings);
+    pc->finishings =
+      cupsArrayNew3((cups_array_func_t)ppd_pwg_compare_finishings,
+                   NULL, NULL, 0, NULL,
+                   (cups_afree_func_t)ppd_pwg_free_finishings);
 
     if ((ppd_option = ppdFindOption(ppd, "StapleLocation")) != NULL)
     {
-     /*
-      * Add staple finishings...
-      */
+      //
+      // Add staple finishings...
+      //
 
       if (ppdFindChoice(ppd_option, "SinglePortrait"))
-        ppd_pwg_add_finishing(pc->finishings, IPP_FINISHINGS_STAPLE_TOP_LEFT, "StapleLocation", "SinglePortrait");
-      if (ppdFindChoice(ppd_option, "UpperLeft")) /* Ricoh extension */
-        ppd_pwg_add_finishing(pc->finishings, IPP_FINISHINGS_STAPLE_TOP_LEFT, "StapleLocation", "UpperLeft");
-      if (ppdFindChoice(ppd_option, "UpperRight")) /* Ricoh extension */
-        ppd_pwg_add_finishing(pc->finishings, IPP_FINISHINGS_STAPLE_TOP_RIGHT, "StapleLocation", "UpperRight");
+        ppd_pwg_add_finishing(pc->finishings, IPP_FINISHINGS_STAPLE_TOP_LEFT,
+                             "StapleLocation", "SinglePortrait");
+      if (ppdFindChoice(ppd_option, "UpperLeft")) // Ricoh extension
+        ppd_pwg_add_finishing(pc->finishings, IPP_FINISHINGS_STAPLE_TOP_LEFT,
+                             "StapleLocation", "UpperLeft");
+      if (ppdFindChoice(ppd_option, "UpperRight")) // Ricoh extension
+        ppd_pwg_add_finishing(pc->finishings, IPP_FINISHINGS_STAPLE_TOP_RIGHT,
+                             "StapleLocation", "UpperRight");
       if (ppdFindChoice(ppd_option, "SingleLandscape"))
-        ppd_pwg_add_finishing(pc->finishings, IPP_FINISHINGS_STAPLE_BOTTOM_LEFT, "StapleLocation", "SingleLandscape");
+        ppd_pwg_add_finishing(pc->finishings,
+                             IPP_FINISHINGS_STAPLE_BOTTOM_LEFT,
+                             "StapleLocation", "SingleLandscape");
       if (ppdFindChoice(ppd_option, "DualLandscape"))
-        ppd_pwg_add_finishing(pc->finishings, IPP_FINISHINGS_STAPLE_DUAL_LEFT, "StapleLocation", "DualLandscape");
+        ppd_pwg_add_finishing(pc->finishings, IPP_FINISHINGS_STAPLE_DUAL_LEFT,
+                             "StapleLocation", "DualLandscape");
     }
 
     if ((ppd_option = ppdFindOption(ppd, "RIPunch")) != NULL)
     {
-     /*
-      * Add (Ricoh) punch finishings...
-      */
+      //
+      // Add (Ricoh) punch finishings...
+      //
 
       if (ppdFindChoice(ppd_option, "Left2"))
-        ppd_pwg_add_finishing(pc->finishings, IPP_FINISHINGS_PUNCH_DUAL_LEFT, "RIPunch", "Left2");
+        ppd_pwg_add_finishing(pc->finishings,
+                             IPP_FINISHINGS_PUNCH_DUAL_LEFT,
+                             "RIPunch", "Left2");
       if (ppdFindChoice(ppd_option, "Left3"))
-        ppd_pwg_add_finishing(pc->finishings, IPP_FINISHINGS_PUNCH_TRIPLE_LEFT, "RIPunch", "Left3");
+        ppd_pwg_add_finishing(pc->finishings,
+                             IPP_FINISHINGS_PUNCH_TRIPLE_LEFT,
+                             "RIPunch", "Left3");
       if (ppdFindChoice(ppd_option, "Left4"))
-        ppd_pwg_add_finishing(pc->finishings, IPP_FINISHINGS_PUNCH_QUAD_LEFT, "RIPunch", "Left4");
+        ppd_pwg_add_finishing(pc->finishings,
+                             IPP_FINISHINGS_PUNCH_QUAD_LEFT,
+                             "RIPunch", "Left4");
       if (ppdFindChoice(ppd_option, "Right2"))
-        ppd_pwg_add_finishing(pc->finishings, IPP_FINISHINGS_PUNCH_DUAL_RIGHT, "RIPunch", "Right2");
+        ppd_pwg_add_finishing(pc->finishings,
+                             IPP_FINISHINGS_PUNCH_DUAL_RIGHT,
+                             "RIPunch", "Right2");
       if (ppdFindChoice(ppd_option, "Right3"))
-        ppd_pwg_add_finishing(pc->finishings, IPP_FINISHINGS_PUNCH_TRIPLE_RIGHT, "RIPunch", "Right3");
+        ppd_pwg_add_finishing(pc->finishings,
+                             IPP_FINISHINGS_PUNCH_TRIPLE_RIGHT,
+                             "RIPunch", "Right3");
       if (ppdFindChoice(ppd_option, "Right4"))
-        ppd_pwg_add_finishing(pc->finishings, IPP_FINISHINGS_PUNCH_QUAD_RIGHT, "RIPunch", "Right4");
+        ppd_pwg_add_finishing(pc->finishings,
+                             IPP_FINISHINGS_PUNCH_QUAD_RIGHT,
+                             "RIPunch", "Right4");
       if (ppdFindChoice(ppd_option, "Upper2"))
-        ppd_pwg_add_finishing(pc->finishings, IPP_FINISHINGS_PUNCH_DUAL_TOP, "RIPunch", "Upper2");
+        ppd_pwg_add_finishing(pc->finishings,
+                             IPP_FINISHINGS_PUNCH_DUAL_TOP,
+                             "RIPunch", "Upper2");
       if (ppdFindChoice(ppd_option, "Upper3"))
-        ppd_pwg_add_finishing(pc->finishings, IPP_FINISHINGS_PUNCH_TRIPLE_TOP, "RIPunch", "Upper3");
+        ppd_pwg_add_finishing(pc->finishings,
+                             IPP_FINISHINGS_PUNCH_TRIPLE_TOP,
+                             "RIPunch", "Upper3");
       if (ppdFindChoice(ppd_option, "Upper4"))
-        ppd_pwg_add_finishing(pc->finishings, IPP_FINISHINGS_PUNCH_QUAD_TOP, "RIPunch", "Upper4");
+        ppd_pwg_add_finishing(pc->finishings,
+                             IPP_FINISHINGS_PUNCH_QUAD_TOP,
+                             "RIPunch", "Upper4");
     }
 
     if ((ppd_option = ppdFindOption(ppd, "BindEdge")) != NULL)
     {
-     /*
-      * Add bind finishings...
-      */
+      //
+      // Add bind finishings...
+      //
 
       if (ppdFindChoice(ppd_option, "Left"))
-        ppd_pwg_add_finishing(pc->finishings, IPP_FINISHINGS_BIND_LEFT, "BindEdge", "Left");
+        ppd_pwg_add_finishing(pc->finishings, IPP_FINISHINGS_BIND_LEFT,
+                             "BindEdge", "Left");
       if (ppdFindChoice(ppd_option, "Right"))
         ppd_pwg_add_finishing(pc->finishings, IPP_FINISHINGS_BIND_RIGHT, "BindEdge", "Right");
       if (ppdFindChoice(ppd_option, "Top"))
@@ -1955,34 +2061,42 @@ ppdCacheCreateWithPPD(ppd_file_t *ppd)  /* I - PPD file */
 
     if ((ppd_option = ppdFindOption(ppd, "FoldType")) != NULL)
     {
-     /*
-      * Add (Adobe) fold finishings...
-      */
+      //
+      // Add (Adobe) fold finishings...
+      //
 
       if (ppdFindChoice(ppd_option, "ZFold"))
-        ppd_pwg_add_finishing(pc->finishings, IPP_FINISHINGS_FOLD_Z, "FoldType", "ZFold");
+        ppd_pwg_add_finishing(pc->finishings, IPP_FINISHINGS_FOLD_Z,
+                             "FoldType", "ZFold");
       if (ppdFindChoice(ppd_option, "Saddle"))
-        ppd_pwg_add_finishing(pc->finishings, IPP_FINISHINGS_FOLD_HALF, "FoldType", "Saddle");
+        ppd_pwg_add_finishing(pc->finishings, IPP_FINISHINGS_FOLD_HALF,
+                             "FoldType", "Saddle");
       if (ppdFindChoice(ppd_option, "DoubleGate"))
-        ppd_pwg_add_finishing(pc->finishings, IPP_FINISHINGS_FOLD_DOUBLE_GATE, "FoldType", "DoubleGate");
+        ppd_pwg_add_finishing(pc->finishings, IPP_FINISHINGS_FOLD_DOUBLE_GATE,
+                             "FoldType", "DoubleGate");
       if (ppdFindChoice(ppd_option, "LeftGate"))
-        ppd_pwg_add_finishing(pc->finishings, IPP_FINISHINGS_FOLD_LEFT_GATE, "FoldType", "LeftGate");
+        ppd_pwg_add_finishing(pc->finishings, IPP_FINISHINGS_FOLD_LEFT_GATE,
+                             "FoldType", "LeftGate");
       if (ppdFindChoice(ppd_option, "RightGate"))
-        ppd_pwg_add_finishing(pc->finishings, IPP_FINISHINGS_FOLD_RIGHT_GATE, "FoldType", "RightGate");
+        ppd_pwg_add_finishing(pc->finishings, IPP_FINISHINGS_FOLD_RIGHT_GATE,
+                             "FoldType", "RightGate");
       if (ppdFindChoice(ppd_option, "Letter"))
-        ppd_pwg_add_finishing(pc->finishings, IPP_FINISHINGS_FOLD_LETTER, "FoldType", "Letter");
+        ppd_pwg_add_finishing(pc->finishings, IPP_FINISHINGS_FOLD_LETTER,
+                             "FoldType", "Letter");
       if (ppdFindChoice(ppd_option, "XFold"))
-        ppd_pwg_add_finishing(pc->finishings, IPP_FINISHINGS_FOLD_POSTER, "FoldType", "XFold");
+        ppd_pwg_add_finishing(pc->finishings, IPP_FINISHINGS_FOLD_POSTER,
+                             "FoldType", "XFold");
     }
 
     if ((ppd_option = ppdFindOption(ppd, "RIFoldType")) != NULL)
     {
-     /*
-      * Add (Ricoh) fold finishings...
-      */
+      //
+      // Add (Ricoh) fold finishings...
+      //
 
       if (ppdFindChoice(ppd_option, "OutsideTwoFold"))
-        ppd_pwg_add_finishing(pc->finishings, IPP_FINISHINGS_FOLD_LETTER, "RIFoldType", "OutsideTwoFold");
+        ppd_pwg_add_finishing(pc->finishings, IPP_FINISHINGS_FOLD_LETTER,
+                             "RIFoldType", "OutsideTwoFold");
     }
 
     if (cupsArrayCount(pc->finishings) == 0)
@@ -1994,24 +2108,28 @@ ppdCacheCreateWithPPD(ppd_file_t *ppd)  /* I - PPD file */
 
   if ((ppd_option = ppdFindOption(ppd, "cupsFinishingTemplate")) != NULL)
   {
-    pc->templates = cupsArrayNew3((cups_array_func_t)strcmp, NULL, NULL, 0, (cups_acopy_func_t)strdup, (cups_afree_func_t)free);
+    pc->templates = cupsArrayNew3((cups_array_func_t)strcmp,
+                                 NULL, NULL, 0,
+                                 (cups_acopy_func_t)strdup,
+                                 (cups_afree_func_t)free);
 
-    for (choice = ppd_option->choices, i = ppd_option->num_choices; i > 0; choice ++, i --)
+    for (choice = ppd_option->choices, i = ppd_option->num_choices; i > 0;
+        choice ++, i --)
     {
       cupsArrayAdd(pc->templates, (void *)choice->choice);
 
-     /*
-      * Add localized text for PWG keyword to message catalog...
-      */
+      //
+      // Add localized text for PWG keyword to message catalog...
+      //
 
       snprintf(msg_id, sizeof(msg_id), "finishing-template.%s", choice->choice);
       ppd_pwg_add_message(pc->strings, msg_id, choice->text);
     }
   }
 
- /*
-  * Max copies...
-  */
+  //
+  // Max copies...
+  //
 
   if ((ppd_attr = ppdFindAttr(ppd, "cupsMaxCopies", NULL)) != NULL)
     pc->max_copies = atoi(ppd_attr->value);
@@ -2020,10 +2138,10 @@ ppdCacheCreateWithPPD(ppd_file_t *ppd)  /* I - PPD file */
   else
     pc->max_copies = 9999;
 
- /*
-  * cupsChargeInfoURI, cupsJobAccountId, cupsJobAccountingUserId,
-  * cupsJobPassword, and cupsMandatory.
-  */
+  //
+  // cupsChargeInfoURI, cupsJobAccountId, cupsJobAccountingUserId,
+  // cupsJobPassword, and cupsMandatory.
+  //
 
   if ((ppd_attr = ppdFindAttr(ppd, "cupsChargeInfoURI", NULL)) != NULL)
     pc->charge_info_uri = strdup(ppd_attr->value);
@@ -2040,11 +2158,13 @@ ppdCacheCreateWithPPD(ppd_file_t *ppd)  /* I - PPD file */
   if ((ppd_attr = ppdFindAttr(ppd, "cupsMandatory", NULL)) != NULL)
     pc->mandatory = _ppdArrayNewStrings(ppd_attr->value, ' ');
 
- /*
-  * Support files...
-  */
+  //
+  // Support files...
+  //
 
-  pc->support_files = cupsArrayNew3(NULL, NULL, NULL, 0, (cups_acopy_func_t)strdup, (cups_afree_func_t)free);
+  pc->support_files = cupsArrayNew3(NULL, NULL, NULL, 0,
+                                   (cups_acopy_func_t)strdup,
+                                   (cups_afree_func_t)free);
 
   for (ppd_attr = ppdFindAttr(ppd, "cupsICCProfile", NULL);
        ppd_attr;
@@ -2054,15 +2174,15 @@ ppdCacheCreateWithPPD(ppd_file_t *ppd)  /* I - PPD file */
   if ((ppd_attr = ppdFindAttr(ppd, "APPrinterIconPath", NULL)) != NULL)
     cupsArrayAdd(pc->support_files, ppd_attr->value);
 
- /*
-  * Return the cache data...
-  */
+  //
+  // Return the cache data...
+  //
 
   return (pc);
 
- /*
-  * If we get here we need to destroy the PWG mapping data and return NULL...
-  */
+  //
+  // If we get here we need to destroy the PWG mapping data and return NULL...
+  //
 
   create_error:
 
@@ -2073,14 +2193,15 @@ ppdCacheCreateWithPPD(ppd_file_t *ppd)  /* I - PPD file */
 }
 
 
-/*
- * 'ppdCacheAssignPresets()' - Go through all the options and choices in
- *                             the PPD to find out which influence
- *                             color/bw, print quality, and content
- *                             optimizations to assign them to the prsets
- *                             so that jobs can easily be controlled with
- *                             standard IPP attributes
- */
+//
+// 'ppdCacheAssignPresets()' - Go through all the options and choices
+//                             in the PPD to find out which influence
+//                             on color/bw, print quality, and content
+//                             optimization they have to assign them
+//                             to the presets so that jobs can easily
+//                             be controlled with standard IPP
+//                             attributes
+//
 
 void
 ppdCacheAssignPresets(ppd_file_t *ppd,
@@ -2118,10 +2239,10 @@ ppdCacheAssignPresets(ppd_file_t *ppd,
   int                    name_factor = 10; // print quality
   int                    color_factor = 1000;
 
-  /* Do we have a color printer ? */
+  // Do we have a color printer ?
   is_color = (ppd->color_device ? 1 : 0);
 
-  /* what is the base/default resolution for this PPD? */
+  // what is the base/default resolution for this PPD?
   ppdMarkDefaults(ppd);
   ppdRasterInterpretPPD(&header, ppd, 0, NULL, NULL);
   if (header.HWResolution[0] != 100 || header.HWResolution[1] != 100)
@@ -2136,12 +2257,12 @@ ppdCacheAssignPresets(ppd_file_t *ppd,
       base_res_y = base_res_x;
   }
 
-  /* Go through all options of the PPD file */
+  // Go through all options of the PPD file
   for (i = ppd->num_groups, group = ppd->groups;
        i > 0;
        i --, group ++)
   {
-    /* Skip the "Installable Options" group */
+    // Skip the "Installable Options" group
     if (strncasecmp(group->name, "Installable", 11) == 0)
       continue;
 
@@ -2180,8 +2301,8 @@ ppdCacheAssignPresets(ppd_file_t *ppd,
 
       o = option->keyword;
 
-      /* Skip options which do not change color mode and quality or
-         generally do not make sense in presets */
+      // Skip options which do not change color mode and quality or
+      // generally do not make sense in presets
       if (strcasecmp(o, "PageSize") == 0 ||
          strcasecmp(o, "PageRegion") == 0 ||
          strcasecmp(o, "InputSlot") == 0 ||
@@ -2197,20 +2318,22 @@ ppdCacheAssignPresets(ppd_file_t *ppd,
          strcasecmp(o, "Collate") == 0)
        continue;
 
-      /* Set members options of composite options in Foomatic to stay
-         controlled by the composite option */
-
-      /* Composite options in Foomaticar options which set a number of
-        other options, so each choice of them is the same as a preset
-        in CUPS.  In addition, some PPDs in Foomatic have a composite
-        option named "PrintoutMode" with 6 choices, exactly the 6 of
-        the grid of CUPS presets, color/mono in draft, mediaum, and
-        high quality. The composite options are created by hand, so
-        they surely do for what they are intended for and so they are
-        safer as this preset auto-generation algorithm. Therefore we
-        only let the composite option be set in our presets and set
-        the members options to leave the control at the composite
-        option */
+      //
+      // Set member options of composite options in Foomatic to stay
+      // controlled by the composite option
+      //
+      // Composite options in Foomatic are options which set a number
+      // of other options, so each choice of them is the same as a
+      // preset in CUPS. In addition, some PPDs in Foomatic have a
+      // composite option named "PrintoutMode" with 6 choices, exactly
+      // the 6 of the grid of CUPS presets, color/mono in draft,
+      // medium, and high quality. The composite options are created
+      // by hand, so they surely do for what they are intended for and
+      // so they are safer as this preset auto-generation
+      // algorithm. Therefore we only let the composite option be set
+      // in our presets and set the member options to leave the
+      // control at the composite option
+      //
 
       if (strstr(ppd->nickname, "Foomatic") &&
          !strncmp(option->choices[0].choice, "From", 4) &&
@@ -2234,12 +2357,12 @@ ppdCacheAssignPresets(ppd_file_t *ppd,
        continue;
       }
 
-      /* Array for properties of the choices */
+      // Array for properties of the choices
       choice_properties = cupsArrayNew(NULL, NULL);
 
-      /*
-       * Gather the data for each choice
-       */
+      //
+      // Gather the data for each choice
+      //
 
       for (k = 0; k < option->num_choices; k ++)
       {
@@ -2248,20 +2371,20 @@ ppdCacheAssignPresets(ppd_file_t *ppd,
 
        c = option->choices[k].choice;
 
-       /* Is this the default choice? (preferred for "normal" quality,
-          used for color if no choice name suggests being color */
+       // Is this the default choice? (preferred for "normal" quality,
+       // used for color if no choice name suggests being color)
        if (strcmp(c, option->defchoice) == 0)
        {
          properties->is_default = 1;
          default_ch = k;
        }
 
-       /*
-       * Color/Monochrome - print-color-mode
-       */
+       //
+       // Color/Monochrome - print-color-mode
+       //
 
-       /* If we have a color device, check whether this option sets mono or
-          color printing */
+       // If we have a color device, check whether this option sets mono or
+       // color printing
        if (is_color)
        {
          if (strcasecmp(o, "CNIJSGrayScale") == 0)
@@ -2271,8 +2394,8 @@ ppdCacheAssignPresets(ppd_file_t *ppd,
            else
              properties->sets_color = 1;
          }
-         else if (strcasecmp(o, "HPColorAsGray") == 0 ||  /* HP PostScript */
-                  strcasecmp(o, "HPPJLColorAsGray") == 0) /* HP PostScript */
+         else if (strcasecmp(o, "HPColorAsGray") == 0 ||  // HP PostScript
+                  strcasecmp(o, "HPPJLColorAsGray") == 0) // HP PostScript
          {
            if (strcasecmp(c, "True") == 0 ||
                strcasecmp(c, "yes") == 0)
@@ -2284,12 +2407,12 @@ ppdCacheAssignPresets(ppd_file_t *ppd,
                   strcasestr(o, "ColorMode") ||
                   strcasecmp(o, "OutputMode") == 0 ||
                   strcasecmp(o, "PrintoutMode") == 0 ||
-                  strcasecmp(o, "ARCMode") == 0 || /* Sharp */
+                  strcasecmp(o, "ARCMode") == 0 || // Sharp
                   strcasestr(o, "ColorMode") ||
-                  strcasecmp(o, "ColorResType") == 0 || /* Toshiba */
-                  strcasestr(o, "MonoColor")) /* Brother */
+                  strcasecmp(o, "ColorResType") == 0 || // Toshiba
+                  strcasestr(o, "MonoColor")) // Brother
          {
-           /* Monochrome/grayscale printing */
+           // Monochrome/grayscale printing
            if (strcasestr(c, "Mono") ||
                strcasecmp(c, "Black") == 0 ||
                ((p = strcasestr(c, "Black")) && strcasestr(p, "White")) ||
@@ -2297,12 +2420,12 @@ ppdCacheAssignPresets(ppd_file_t *ppd,
              properties->sets_mono = 2;
            else if (strcasestr(c, "Gray") ||
                     strcasestr(c, "Grey") ||
-                    strcasecmp(c, "BlackOnly") == 0) /* Lexmark */
+                    strcasecmp(c, "BlackOnly") == 0) // Lexmark
              properties->sets_mono = 3;
 
-           /* Color printing */
+           // Color printing
            if (((p = strcasestr(c, "CMY")) && !strcasestr(p, "Gray")) ||
-               strcasecmp(c, "ColorOnly") == 0 || /* Lexmark */
+               strcasecmp(c, "ColorOnly") == 0 || // Lexmark
                ((p = strcasestr(c, "Adobe")) && strcasestr(p, "RGB")))
              properties->sets_color = 2;
            else if (strcasestr(c, "sRGB"))
@@ -2312,37 +2435,37 @@ ppdCacheAssignPresets(ppd_file_t *ppd,
              properties->sets_color = 3;
          }
 
-         /* This option actually sets color mode */
+         // This option actually sets color mode
          if (properties->sets_mono || properties->sets_color)
            sets_color_mode = 1;
        }
 
-       /*
-       * Output Quality - print-quality
-       */
+       //
+       // Output Quality - print-quality
+       //
 
-       /* check whether this option affects print quality or content
-          optimization */
+       // check whether this option affects print quality or content
+       // optimization
 
-       /* Determine influence of the options and choices on the print
-          quality by their names */
+       // Determine influence of the options and choices on the print
+       // quality by their names
 
-       /* Vendor-specific option and choice names */
-       if (strcasecmp(o, "ARCPPriority") == 0) /* Sharp */
+       // Vendor-specific option and choice names
+       if (strcasecmp(o, "ARCPPriority") == 0) // Sharp
        {
          if (strcasecmp(c, "Quality") == 0)
            properties->sets_high = 10;
          else if (strcasecmp(c, "Speed") == 0)
            properties->sets_draft = 10;
        }
-       else if (strcasecmp(o, "BRJpeg") == 0) /* Brother */
+       else if (strcasecmp(o, "BRJpeg") == 0) // Brother
        {
          if (strcasecmp(c, "QualityPrior") == 0)
            properties->sets_high = 10;
          else if (strcasecmp(c, "SpeedPrior") == 0)
            properties->sets_draft = 10;
        }
-       else if (strcasecmp(o, "FXOutputMode") == 0) /* Fuji Xerox */
+       else if (strcasecmp(o, "FXOutputMode") == 0) // Fuji Xerox
        {
          if (strcasecmp(c, "Quality2") == 0)
            properties->sets_high = 10;
@@ -2351,7 +2474,7 @@ ppdCacheAssignPresets(ppd_file_t *ppd,
          else if (strcasecmp(c, "Standard") == 0)
            properties->sets_normal = 10;
        }
-       else if (strcasecmp(o, "RIPrintMode") == 0) /* Ricoh & OEM */
+       else if (strcasecmp(o, "RIPrintMode") == 0) // Ricoh & OEM
        {
          if (strcasecmp(c, "1rhit") == 0)
            properties->sets_high = 7;
@@ -2364,8 +2487,8 @@ ppdCacheAssignPresets(ppd_file_t *ppd,
          else if (strcasecmp(c, "0rhit") == 0)
            properties->sets_normal = 10;
        }
-       else if (strcasecmp(o, "EconoMode") == 0 || /* Foomatic */
-                strcasecmp(o, "EconoFast") == 0)   /* Foomatic (HP PPA) */
+       else if (strcasecmp(o, "EconoMode") == 0 || // Foomatic
+                strcasecmp(o, "EconoFast") == 0)   // Foomatic (HP PPA)
        {
          if (strcasecmp(c, "Off") == 0 ||
              strcasecmp(c, "False") == 0)
@@ -2377,25 +2500,25 @@ ppdCacheAssignPresets(ppd_file_t *ppd,
          else if (strcasecmp(c, "High") == 0)
            properties->sets_draft = 11;
        }
-       else if (strcasestr(o, "ColorPrecision")) /* Gutenprint */
+       else if (strcasestr(o, "ColorPrecision")) // Gutenprint
        {
          if (strcasecmp(c, "best") == 0)
            properties->sets_high = 10;
        }
-       /* Generic boolean options which enhance quality if true */
+       // Generic boolean options which enhance quality if true
        else if (((p = strcasestr(o, "slow")) && strcasestr(p, "dry")) ||
                 ((p = strcasestr(o, "color")) && strcasestr(p, "enhance")) ||
                 ((p = strcasestr(o, "resolution")) &&
                  !strcasestr(p, "enhance")) ||
                 strcasecmp(o, "RET") == 0 ||
-                strcasecmp(o, "Smoothing") == 0 || /* HPLIP */
+                strcasecmp(o, "Smoothing") == 0 || // HPLIP
                 ((p = strcasestr(o, "uni")) && strcasestr(p, "direction")))
        {
          if (strcasecmp(c, "True") == 0 ||
              strcasecmp(c, "On") == 0 ||
              strcasecmp(c, "Yes") == 0 ||
              strcasecmp(c, "1") == 0 ||
-             strcasecmp(c, "Medium") == 0) /* Resolution Enhancement/RET (HP)*/
+             strcasecmp(c, "Medium") == 0) // Resolution Enhancement/RET (HP)
            properties->sets_high = 3;
          else if (strcasecmp(c, "False") == 0 ||
                   strcasecmp(c, "Off") == 0 ||
@@ -2403,13 +2526,13 @@ ppdCacheAssignPresets(ppd_file_t *ppd,
                   strcasecmp(c, "0") == 0)
            properties->sets_draft = 3;
        }
-       /* Generic boolean options which reduce quality if true */
+       // Generic boolean options which reduce quality if true
        else if (strcasestr(o, "draft") ||
                 strcasestr(o, "economy") ||
                 ((p = strcasestr(o, "eco")) && strcasestr(p, "mode")) ||
                 ((p = strcasestr(o, "toner")) && strcasestr(p, "sav")) ||
                 ((p = strcasestr(o, "bi")) && strcasestr(p, "direction")) ||
-                strcasecmp(o, "EcoBlack") == 0 || /* Foomatic (Alps) */
+                strcasecmp(o, "EcoBlack") == 0 || // Foomatic (Alps)
                 strcasecmp(o, "bidi") == 0 ||
                 strcasecmp(o, "bi-di") == 0)
        {
@@ -2417,7 +2540,7 @@ ppdCacheAssignPresets(ppd_file_t *ppd,
              strcasecmp(c, "On") == 0 ||
              strcasecmp(c, "Yes") == 0 ||
              strcasecmp(c, "1") == 0 ||
-             strcasecmp(c, "Medium") == 0) /* EconomyMode (Brother) */
+             strcasecmp(c, "Medium") == 0) // EconomyMode (Brother)
            properties->sets_draft = 3;
          else if (strcasecmp(c, "False") == 0 ||
                   strcasecmp(c, "Off") == 0 ||
@@ -2425,58 +2548,58 @@ ppdCacheAssignPresets(ppd_file_t *ppd,
                   strcasecmp(c, "0") == 0)
            properties->sets_high = 3;
        }
-       /* Generic enumerated choice option and choice names */
+       // Generic enumerated choice option and choice names
        else if (strcasecmp(o, "ColorModel") == 0 ||
                 strcasestr(o, "ColorMode") ||
-                strcasecmp(o, "OutputMode") == 0 || /* HPLIP hpcups */
-                strcasecmp(o, "PrintoutMode") == 0 || /* Foomatic */
+                strcasecmp(o, "OutputMode") == 0 || // HPLIP hpcups
+                strcasecmp(o, "PrintoutMode") == 0 || // Foomatic
                 strcasecmp(o, "PrintQuality") == 0 ||
                 strcasecmp(o, "PrintMode") == 0 ||
                 strcasestr(o, "ColorMode") ||
-                strcasestr(o, "HalfTone") || /* HPLIP */
-                strcasecmp(o, "ColorResType") == 0 || /* Toshiba */
-                strcasestr(o, "MonoColor") || /* Brother */
+                strcasestr(o, "HalfTone") || // HPLIP
+                strcasecmp(o, "ColorResType") == 0 || // Toshiba
+                strcasestr(o, "MonoColor") || // Brother
                 strcasestr(o, "Quality") ||
                 strcasestr(o, "Resolution") ||
-                strcasestr(o, "Precision") || /* ex. stpColorPrecision
-                                                 in Gutenprint */
-                strcasestr(o, "PrintingDirection")) /* Gutenprint */
+                strcasestr(o, "Precision") || // ex. stpColorPrecision
+                                              // in Gutenprint
+                strcasestr(o, "PrintingDirection")) // Gutenprint
        {
-         /* High quality */
+         // High quality
          if (strcasecmp(c, "Quality") == 0 ||
              strcasecmp(c, "5") == 0)
            properties->sets_high = 1;
          else if (strcasestr(c, "Photo") ||
                   strcasestr(c, "Enhance") ||
                   strcasestr(c, "slow") ||
-                  strncasecmp(c, "ProRes", 6) == 0 || /* HPLIP */
-                  strncasecmp(c, "ImageREt", 8) == 0 || /* HPLIP */
+                  strncasecmp(c, "ProRes", 6) == 0 || // HPLIP
+                  strncasecmp(c, "ImageREt", 8) == 0 || // HPLIP
                   ((p = strcasestr(c, "low")) && strcasestr(p, "speed")))
            properties->sets_high = 2;
          else if (strcasestr(c, "fine") ||
                   strcasestr(c, "deep") ||
                   ((p = strcasestr(c, "high")) && !strcasestr(p, "speed")) ||
                   strcasestr(c, "HQ") ||
-                  strcasecmp(c, "ProRes600") == 0 || /* HPLIP */
-                  strcasecmp(c, "ImageREt1200") == 0 || /* HPLIP */
+                  strcasecmp(c, "ProRes600") == 0 || // HPLIP
+                  strcasecmp(c, "ImageREt1200") == 0 || // HPLIP
                   strcasecmp(c, "Enhanced") == 0)
            properties->sets_high = 3;
          else if (strcasestr(c, "best") ||
                   strcasecmp(c, "high") == 0 ||
                   strcasecmp(c, "fine") == 0 ||
                   strcasecmp(c, "HQ") == 0 ||
-                  strcasecmp(c, "CMYGray") == 0 || /* HPLIP */
-                  strcasecmp(c, "ProRes1200") == 0 || /* HPLIP */
-                  strcasecmp(c, "ImageREt2400") == 0 || /* HPLIP */
+                  strcasecmp(c, "CMYGray") == 0 || // HPLIP
+                  strcasecmp(c, "ProRes1200") == 0 || // HPLIP
+                  strcasecmp(c, "ImageREt2400") == 0 || // HPLIP
                   strcasestr(c, "unidir"))
            properties->sets_high = 4;
          else if (strcasecmp(c, "best") == 0 ||
-                  strcasecmp(c, "ProRes2400") == 0 || /* HPLIP */
-                  strcasecmp(c, "monolowdetail") == 0) /* Toshiba */
+                  strcasecmp(c, "ProRes2400") == 0 || // HPLIP
+                  strcasecmp(c, "monolowdetail") == 0) // Toshiba
            properties->sets_high = 5;
 
-         /* Low/Draft quality */
-         if (strcasecmp(c, "monolowdetail") == 0 || /* Toshiba */
+         // Low/Draft quality
+         if (strcasecmp(c, "monolowdetail") == 0 || // Toshiba
              strcasecmp(c, "3") == 0)
            properties->sets_draft = 1;
          else if (((p = strcasestr(c, "fast")) && strcasestr(p, "draft")) ||
@@ -2486,7 +2609,7 @@ ppdCacheAssignPresets(ppd_file_t *ppd,
          else if (strcasestr(c, "quick") ||
                   (strcasestr(c, "fast") &&
                    !(strncasecmp(c, "FastRes", 7) == 0 && isdigit(*(c + 7)))))
-           /* HPLIP has FastRes600, FastRes1200, ... which are not draft */
+           // HPLIP has FastRes600, FastRes1200, ... which are not draft
            properties->sets_draft = 3;
          else if (strcasecmp(c, "quick") == 0 ||
                   strcasecmp(c, "fast") == 0 ||
@@ -2500,7 +2623,7 @@ ppdCacheAssignPresets(ppd_file_t *ppd,
                   strcasestr(c, "bidir"))
            properties->sets_draft = 5;
 
-         /* Use high or low quality but not the extremes */
+         // Use high or low quality but not the extremes
          if (strcasestr(c, "ultra") ||
              strcasestr(c, "very") ||
              strcasestr(c, "super"))
@@ -2511,16 +2634,16 @@ ppdCacheAssignPresets(ppd_file_t *ppd,
              properties->sets_draft --;
          }
 
-         /* Normal quality */
+         // Normal quality
          if (strcasestr(c, "automatic") ||
              strcasecmp(c, "none") == 0 ||
              strcasecmp(c, "4") == 0 ||
-             strcasecmp(c, "FastRes1200") == 0) /* HPLIP */
+             strcasecmp(c, "FastRes1200") == 0) // HPLIP
            properties->sets_normal = 1;
          else if (strcasestr(c, "normal") ||
                   strcasestr(c, "standard") ||
                   strcasestr(c, "default") ||
-                  strcasecmp(c, "FastRes600") == 0) /* HPLIP */
+                  strcasecmp(c, "FastRes600") == 0) // HPLIP
            properties->sets_normal = 2;
          else if (strcasecmp(c, "normal") == 0 ||
                   strcasecmp(c, "standard") == 0 ||
@@ -2528,21 +2651,21 @@ ppdCacheAssignPresets(ppd_file_t *ppd,
            properties->sets_normal = 4;
        }
 
-       /* Apply the weight factor for option/choice-name-related scores */
+       // Apply the weight factor for option/choice-name-related scores
        properties->sets_high *= name_factor;
        properties->sets_draft *= name_factor;
        properties->sets_normal *= name_factor;
 
-       /* Determine influence of the options and choices on the print
-          quality by how they change the output resolution compared to
-          the base/default resolution */
+       // Determine influence of the options and choices on the print
+       // quality by how they change the output resolution compared to
+       // the base/default resolution
        if (base_res_x && base_res_y)
        {
-         /* First, analyse the code snippet (PostScript, PJL) assigned
-            to each choice of the option whether it sets resolution */
+         // First, analyse the code snippet (PostScript, PJL) assigned
+         // to each choice of the option whether it sets resolution
          if (option->choices[k].code && option->choices[k].code[0])
          {
-           /* Assume code to be PostScript (also used for CUPS Raster) */
+           // Assume code to be PostScript (also used for CUPS Raster)
            preferred_bits = 0;
            optheader = header;
            if (ppdRasterExecPS(&optheader, &preferred_bits,
@@ -2552,10 +2675,10 @@ ppdCacheAssignPresets(ppd_file_t *ppd,
              properties->res_y = optheader.HWResolution[1];
            }
            else
-             properties->res_x = properties->res_y = 0; /* invalid */
+             properties->res_x = properties->res_y = 0; // invalid
            if (properties->res_x == 0 || properties->res_y == 0)
            {
-             /* Now try PJL */
+             // Now try PJL
              if ((p = strstr(option->choices[k].code, "SET")) &&
                  isspace(*(p + 3)) && (p = strstr(p + 4, "RESOLUTION=")))
              {
@@ -2566,15 +2689,15 @@ ppdCacheAssignPresets(ppd_file_t *ppd,
              }
            }
            if (properties->res_x == 100 && properties->res_y == 100)
-             properties->res_x = properties->res_y = 0; /* Code does not
-                                                           set resolution */
+             properties->res_x = properties->res_y = 0; // Code does not
+                                                        // set resolution
          }
          else
-           properties->res_x = properties->res_y = 0; /* invalid */
+           properties->res_x = properties->res_y = 0; // invalid
 
-         /* Then parse the choice name whether it contains a
-            resolution value (Must have "dpi", as otherwise can be
-            something else, like a page size */
+         // Then parse the choice name whether it contains a
+         // resolution value (Must have "dpi", as otherwise can be
+         // something else, like a page size)
          if ((properties->res_x == 0 || properties->res_y == 0) &&
              (p = strcasestr(c, "dpi")) != NULL)
          {
@@ -2640,18 +2763,18 @@ ppdCacheAssignPresets(ppd_file_t *ppd,
          }
        }
 
-       /* This option actually sets print quality */
+       // This option actually sets print quality
        if (properties->sets_draft || properties->sets_high)
          sets_quality = 1;
 
-       /* Add the properties of this choice */
+       // Add the properties of this choice
        cupsArrayAdd(choice_properties, properties);
       }
 
-     /*
-      * Find the best choice for each field of the color/quality preset
-      * grid
-      */
+      //
+      // Find the best choice for each field of the color/quality preset
+      // grid
+      //
 
       for (pass = 0; pass < 3; pass ++)
       {
@@ -2659,7 +2782,7 @@ ppdCacheAssignPresets(ppd_file_t *ppd,
         {
          properties = cupsArrayIndex(choice_properties, k);
 
-         /* presets[0][0]: Mono/Draft */
+         // presets[0][0]: Mono/Draft
          if (best_mono_draft >= 0 &&
              !properties->sets_color &&
              (!properties->sets_high || pass > 0))
@@ -2673,7 +2796,7 @@ ppdCacheAssignPresets(ppd_file_t *ppd,
            }
          }
 
-         /* presets[0][1]: Mono/Normal */
+         // presets[0][1]: Mono/Normal
          if (best_mono_normal >= 0 &&
              !properties->sets_color &&
              (!properties->sets_draft || pass > 1) &&
@@ -2688,7 +2811,7 @@ ppdCacheAssignPresets(ppd_file_t *ppd,
            }
          }
 
-         /* presets[0][2]: Mono/High */
+         // presets[0][2]: Mono/High
          if (best_mono_high >= 0 &&
              !properties->sets_color &&
              (!properties->sets_draft || pass > 0))
@@ -2702,7 +2825,7 @@ ppdCacheAssignPresets(ppd_file_t *ppd,
            }
          }
 
-         /* presets[1][0]: Color/Draft */
+         // presets[1][0]: Color/Draft
          if (best_color_draft >= 0 &&
              !properties->sets_mono &&
              (!properties->sets_high || pass > 0))
@@ -2716,7 +2839,7 @@ ppdCacheAssignPresets(ppd_file_t *ppd,
            }
          }
 
-         /* presets[1][1]: Color/Normal */
+         // presets[1][1]: Color/Normal
          if (best_color_normal >= 0 &&
              !properties->sets_mono &&
              (!properties->sets_draft || pass > 1) &&
@@ -2731,7 +2854,7 @@ ppdCacheAssignPresets(ppd_file_t *ppd,
            }
          }
 
-         /* presets[1][2]: Color/High */
+         // presets[1][2]: Color/High
          if (best_color_high >= 0 &&
              !properties->sets_mono &&
              (!properties->sets_draft || pass > 0))
@@ -2745,7 +2868,7 @@ ppdCacheAssignPresets(ppd_file_t *ppd,
            }
          }
        }
-       /* Block next passes for the presets where we are done */
+       // Block next passes for the presets where we are done
        if (best_mono_draft_ch >= 0)
          best_mono_draft = -1;
        if (best_mono_normal_ch >= 0)
@@ -2760,17 +2883,17 @@ ppdCacheAssignPresets(ppd_file_t *ppd,
          best_color_high = -1;
       }
 
-     /*
-      * Content Optimization - print-content-optimize
-      */
+      //
+      // Content Optimization - print-content-optimize
+      //
 
       for (k = 0; k < option->num_choices; k ++)
       {
        properties = cupsArrayIndex(choice_properties, k);
        c = option->choices[k].choice;
 
-       /* Vendor-specific options */
-       if (strcasecmp(o, "ARCOType") == 0) /* Sharp */
+       // Vendor-specific options
+       if (strcasecmp(o, "ARCOType") == 0) // Sharp
        {
          if (strcasecmp(c, "COTDrawing") == 0)
          {
@@ -2786,7 +2909,7 @@ ppdCacheAssignPresets(ppd_file_t *ppd,
          else if (strcasecmp(c, "COTPhoto") == 0)
            properties->for_photo = 3;
        }
-       else if (strcasecmp(o, "HPRGBEmulation") == 0) /* HP */
+       else if (strcasecmp(o, "HPRGBEmulation") == 0) // HP
        {
          if (strcasecmp(c, "DefaultSRGB") == 0)
            properties->for_text = 3;
@@ -2799,7 +2922,7 @@ ppdCacheAssignPresets(ppd_file_t *ppd,
            properties->for_photo = 3;
        }
        else
-       /* Generic choice names */
+       // Generic choice names
        {
          if (strcasestr(c, "photo"))
            properties->for_photo = 6;
@@ -2876,8 +2999,8 @@ ppdCacheAssignPresets(ppd_file_t *ppd,
          }
        }
 
-       /* We apply these optimizations only in high quality mode
-          therefore we prefer settings for high quality */
+       // We apply these optimizations only in high quality mode
+       // therefore we prefer settings for high quality
        if (properties->sets_high && !properties->sets_draft)
        {
          if (properties->for_photo)
@@ -2890,49 +3013,49 @@ ppdCacheAssignPresets(ppd_file_t *ppd,
            properties->for_tg += 10;
        }
 
-       /*
-       * Find the best choice for each field of the content optimize presets
-       */
+       //
+       // Find the best choice for each field of the content optimize presets
+       //
 
-       /* Find best choice for each task */
-       /* optimize_presets[1]: Photo */
+       // Find best choice for each task
+       // optimize_presets[1]: Photo
        if (properties->for_photo > best_photo)
        {
          best_photo = properties->for_photo;
          best_photo_ch = k;
        }
-       /* optimize_presets[2]: Graphics */
+       // optimize_presets[2]: Graphics
        if (properties->for_graphics > best_graphics)
        {
          best_graphics = properties->for_graphics;
          best_graphics_ch = k;
        }
-       /* optimize_presets[3]: Text */
+       // optimize_presets[3]: Text
        if (properties->for_text > best_text)
        {
          best_text = properties->for_text;
          best_text_ch = k;
        }
-       /* optimize_presets[4]: Text and Graphics */
+       // optimize_presets[4]: Text and Graphics
        if (properties->for_tg > best_tg)
        {
          best_tg = properties->for_tg;
          best_tg_ch = k;
        }
 
-       /* This option actually does content optimization */
+       // This option actually does content optimization
        if (properties->for_text || properties->for_graphics ||
            properties->for_tg || properties->for_photo)
          sets_optimization = 1;
       }
 
-     /*
-      * Fill in the presets
-      */
+      //
+      // Fill in the presets
+      //
 
       if (sets_color_mode || sets_quality)
       {
-       /* presets[0][0]: Mono/Draft */
+       // presets[0][0]: Mono/Draft
        if (best_mono_draft_ch < 0)
          best_mono_draft_ch = default_ch;
        if (best_mono_draft_ch >= 0)
@@ -2944,7 +3067,7 @@ ppdCacheAssignPresets(ppd_file_t *ppd,
                          &(pc->presets[PPD_PWG_PRINT_COLOR_MODE_MONOCHROME]
                                       [PPD_PWG_PRINT_QUALITY_DRAFT]));
 
-       /* presets[0][1]: Mono/Normal */
+       // presets[0][1]: Mono/Normal
        if (best_mono_normal_ch < 0)
          best_mono_normal_ch = default_ch;
        if (best_mono_normal_ch >= 0)
@@ -2956,7 +3079,7 @@ ppdCacheAssignPresets(ppd_file_t *ppd,
                          &(pc->presets[PPD_PWG_PRINT_COLOR_MODE_MONOCHROME]
                                       [PPD_PWG_PRINT_QUALITY_NORMAL]));
 
-       /* presets[0][2]: Mono/High */
+       // presets[0][2]: Mono/High
        if (best_mono_high_ch < 0)
          best_mono_high_ch = default_ch;
        if (best_mono_high_ch >= 0)
@@ -2968,7 +3091,7 @@ ppdCacheAssignPresets(ppd_file_t *ppd,
                          &(pc->presets[PPD_PWG_PRINT_COLOR_MODE_MONOCHROME]
                                       [PPD_PWG_PRINT_QUALITY_HIGH]));
 
-       /* presets[1][0]: Color/Draft */
+       // presets[1][0]: Color/Draft
        if (best_color_draft_ch < 0)
          best_color_draft_ch = default_ch;
        if (best_color_draft_ch >= 0)
@@ -2980,7 +3103,7 @@ ppdCacheAssignPresets(ppd_file_t *ppd,
                          &(pc->presets[PPD_PWG_PRINT_COLOR_MODE_COLOR]
                                       [PPD_PWG_PRINT_QUALITY_DRAFT]));
 
-       /* presets[1][1]: Color/Normal */
+       // presets[1][1]: Color/Normal
        if (best_color_normal_ch < 0)
          best_color_normal_ch = default_ch;
        if (best_color_normal_ch >= 0)
@@ -2992,7 +3115,7 @@ ppdCacheAssignPresets(ppd_file_t *ppd,
                          &(pc->presets[PPD_PWG_PRINT_COLOR_MODE_COLOR]
                                       [PPD_PWG_PRINT_QUALITY_NORMAL]));
 
-       /* presets[1][2]: Color/High */
+       // presets[1][2]: Color/High
        if (best_color_high_ch < 0)
          best_color_high_ch = default_ch;
        if (best_color_high_ch >= 0)
@@ -3009,7 +3132,7 @@ ppdCacheAssignPresets(ppd_file_t *ppd,
       if (sets_optimization)
       {
 
-       /* optimize_presets[1]: Photo */
+       // optimize_presets[1]: Photo
        if (best_photo_ch >= 0)
          pc->num_optimize_presets[PPD_PWG_PRINT_CONTENT_OPTIMIZE_PHOTO] =
            cupsAddOption
@@ -3017,7 +3140,7 @@ ppdCacheAssignPresets(ppd_file_t *ppd,
               pc->num_optimize_presets[PPD_PWG_PRINT_CONTENT_OPTIMIZE_PHOTO],
               &(pc->optimize_presets[PPD_PWG_PRINT_CONTENT_OPTIMIZE_PHOTO]));
 
-       /* optimize_presets[2]: Graphics */
+       // optimize_presets[2]: Graphics
        if (best_graphics_ch >= 0)
          pc->num_optimize_presets[PPD_PWG_PRINT_CONTENT_OPTIMIZE_GRAPHICS] =
            cupsAddOption
@@ -3027,7 +3150,7 @@ ppdCacheAssignPresets(ppd_file_t *ppd,
               &(pc->optimize_presets
                 [PPD_PWG_PRINT_CONTENT_OPTIMIZE_GRAPHICS]));
 
-       /* optimize_presets[1]: Text */
+       // optimize_presets[1]: Text
        if (best_text_ch >= 0)
          pc->num_optimize_presets[PPD_PWG_PRINT_CONTENT_OPTIMIZE_TEXT] =
            cupsAddOption
@@ -3035,7 +3158,7 @@ ppdCacheAssignPresets(ppd_file_t *ppd,
               pc->num_optimize_presets[PPD_PWG_PRINT_CONTENT_OPTIMIZE_TEXT],
               &(pc->optimize_presets[PPD_PWG_PRINT_CONTENT_OPTIMIZE_TEXT]));
 
-       /* optimize_presets[1]: Text and Graphics */
+       // optimize_presets[1]: Text and Graphics
        if (best_tg_ch >= 0)
          pc->num_optimize_presets
            [PPD_PWG_PRINT_CONTENT_OPTIMIZE_TEXT_AND_GRAPHICS] =
@@ -3055,28 +3178,29 @@ ppdCacheAssignPresets(ppd_file_t *ppd,
   }
 }
 
-/*
- * 'ppdCacheDestroy()' - Free all memory used for PWG mapping data.
- */
+
+//
+// 'ppdCacheDestroy()' - Free all memory used for PWG mapping data.
+//
 
 void
-ppdCacheDestroy(ppd_cache_t *pc)       /* I - PPD cache and mapping data */
+ppdCacheDestroy(ppd_cache_t *pc)       // I - PPD cache and mapping data
 {
-  int          i, j;                   /* Looping vars */
-  pwg_map_t    *map;                   /* Current map */
-  pwg_size_t   *size;                  /* Current size */
+  int          i, j;                   // Looping vars
+  pwg_map_t    *map;                   // Current map
+  pwg_size_t   *size;                  // Current size
 
 
- /*
-  * Range check input...
-  */
+  //
+  // Range check input...
+  //
 
   if (!pc)
     return;
 
- /*
-  * Free memory as needed...
-  */
+  //
+  // Free memory as needed...
+  //
 
   if (pc->bins)
   {
@@ -3141,12 +3265,14 @@ ppdCacheDestroy(ppd_cache_t *pc)        /* I - PPD cache and mapping data */
 
   cupsArrayDelete(pc->strings);
 
-  for (i = PPD_PWG_PRINT_COLOR_MODE_MONOCHROME; i < PPD_PWG_PRINT_COLOR_MODE_MAX; i ++)
+  for (i = PPD_PWG_PRINT_COLOR_MODE_MONOCHROME;
+       i < PPD_PWG_PRINT_COLOR_MODE_MAX; i ++)
     for (j = PPD_PWG_PRINT_QUALITY_DRAFT; j < PPD_PWG_PRINT_QUALITY_MAX; j ++)
       if (pc->num_presets[i][j])
        cupsFreeOptions(pc->num_presets[i][j], pc->presets[i][j]);
 
-  for (i = PPD_PWG_PRINT_CONTENT_OPTIMIZE_AUTO; i < PPD_PWG_PRINT_CONTENT_OPTIMIZE_MAX; i ++)
+  for (i = PPD_PWG_PRINT_CONTENT_OPTIMIZE_AUTO;
+       i < PPD_PWG_PRINT_CONTENT_OPTIMIZE_MAX; i ++)
     if (pc->num_optimize_presets[i])
       cupsFreeOptions(pc->num_optimize_presets[i], pc->optimize_presets[i]);
 
@@ -3154,74 +3280,75 @@ ppdCacheDestroy(ppd_cache_t *pc)        /* I - PPD cache and mapping data */
 }
 
 
-/*
- * 'ppdCacheGetBin()' - Get the PWG output-bin keyword associated with a PPD
- *                  OutputBin.
- */
+//
+// 'ppdCacheGetBin()' - Get the PWG output-bin keyword associated with a PPD
+//                      OutputBin.
+//
 
-const char *                           /* O - output-bin or NULL */
+const char *                           // O - output-bin or NULL
 ppdCacheGetBin(
-    ppd_cache_t *pc,                   /* I - PPD cache and mapping data */
-    const char   *output_bin)          /* I - PPD OutputBin string */
+    ppd_cache_t *pc,                   // I - PPD cache and mapping data
+    const char   *output_bin)          // I - PPD OutputBin string
 {
-  int  i;                              /* Looping var */
+  int  i;                              // Looping var
 
 
- /*
-  * Range check input...
-  */
+  //
+  // Range check input...
 
   if (!pc || !output_bin)
     return (NULL);
 
- /*
-  * Look up the OutputBin string...
-  */
-
+  //
+  // Look up the OutputBin string...
+  //
 
   for (i = 0; i < pc->num_bins; i ++)
-    if (!_ppd_strcasecmp(output_bin, pc->bins[i].ppd) || !_ppd_strcasecmp(output_bin, pc->bins[i].pwg))
+    if (!_ppd_strcasecmp(output_bin, pc->bins[i].ppd) ||
+       !_ppd_strcasecmp(output_bin, pc->bins[i].pwg))
       return (pc->bins[i].pwg);
 
   return (NULL);
 }
 
 
-/*
- * 'ppdCacheGetFinishingOptions()' - Get PPD finishing options for the given
- *                                    IPP finishings value(s).
- */
+//
+// 'ppdCacheGetFinishingOptions()' - Get PPD finishing options for the given
+//                                   IPP finishings value(s).
+//
 
-int                                    /* O  - New number of options */
+int                                    // O  - New number of options
 ppdCacheGetFinishingOptions(
-    ppd_cache_t     *pc,               /* I  - PPD cache and mapping data */
-    ipp_t            *job,             /* I  - Job attributes or NULL */
-    ipp_finishings_t value,            /* I  - IPP finishings value of IPP_FINISHINGS_NONE */
-    int              num_options,      /* I  - Number of options */
-    cups_option_t    **options)                /* IO - Options */
+    ppd_cache_t      *pc,              // I  - PPD cache and mapping data
+    ipp_t            *job,             // I  - Job attributes or NULL
+    ipp_finishings_t value,            // I  - IPP finishings value of
+                                        //      IPP_FINISHINGS_NONE
+    int              num_options,      // I  - Number of options
+    cups_option_t    **options)                // IO - Options
 {
-  int                  i;              /* Looping var */
-  ppd_pwg_finishings_t *f,             /* PWG finishings options */
-                       key;            /* Search key */
-  ipp_attribute_t      *attr;          /* Finishings attribute */
-  cups_option_t                *option;        /* Current finishings option */
+  int                  i;              // Looping var
+  ppd_pwg_finishings_t *f,             // PWG finishings options
+                       key;            // Search key
+  ipp_attribute_t      *attr;          // Finishings attribute
+  cups_option_t                *option;        // Current finishings option
 
 
- /*
-  * Range check input...
-  */
+  //
+  // Range check input...
+  //
 
   if (!pc || cupsArrayCount(pc->finishings) == 0 || !options ||
       (!job && value == IPP_FINISHINGS_NONE))
     return (num_options);
 
- /*
-  * Apply finishing options...
-  */
+  //
+  // Apply finishing options...
+  //
 
   if (job && (attr = ippFindAttribute(job, "finishings", IPP_TAG_ENUM)) != NULL)
   {
-    int        num_values = ippGetCount(attr); /* Number of values */
+    int        num_values = ippGetCount(attr); // Number of values
 
     for (i = 0; i < num_values; i ++)
     {
@@ -3229,7 +3356,7 @@ ppdCacheGetFinishingOptions(
 
       if ((f = cupsArrayFind(pc->finishings, &key)) != NULL)
       {
-        int    j;                      /* Another looping var */
+        int    j;                      // Another looping var
 
         for (j = f->num_options, option = f->options; j > 0; j --, option ++)
           num_options = cupsAddOption(option->name, option->value,
@@ -3243,7 +3370,7 @@ ppdCacheGetFinishingOptions(
 
     if ((f = cupsArrayFind(pc->finishings, &key)) != NULL)
     {
-      int      j;                      /* Another looping var */
+      int      j;                      // Another looping var
 
       for (j = f->num_options, option = f->options; j > 0; j --, option ++)
        num_options = cupsAddOption(option->name, option->value,
@@ -3255,30 +3382,31 @@ ppdCacheGetFinishingOptions(
 }
 
 
-/*
- * 'ppdCacheGetFinishingValues()' - Get IPP finishings value(s) from the given
- *                                   PPD options.
- */
+//
+// 'ppdCacheGetFinishingValues()' - Get IPP finishings value(s) from the given
+//                                   PPD options.
+//
 
-int                                    /* O - Number of finishings values */
+int                                    // O - Number of finishings values
 ppdCacheGetFinishingValues(
-    ppd_file_t    *ppd,                        /* I - Marked PPD file */
-    ppd_cache_t  *pc,                  /* I - PPD cache and mapping data */
-    int           max_values,          /* I - Maximum number of finishings values */
-    int           *values)             /* O - Finishings values */
+    ppd_file_t    *ppd,                        // I - Marked PPD file
+    ppd_cache_t  *pc,                  // I - PPD cache and mapping data
+    int           max_values,          // I - Maximum number of finishings values
+    int           *values)             // O - Finishings values
 {
-  int                  i,              /* Looping var */
-                       num_values = 0; /* Number of values */
-  ppd_pwg_finishings_t *f;             /* Current finishings option */
-  cups_option_t                *option;        /* Current option */
-  ppd_choice_t         *choice;        /* Marked PPD choice */
+  int                  i,              // Looping var
+                       num_values = 0; // Number of values
+  ppd_pwg_finishings_t *f;             // Current finishings option
+  cups_option_t                *option;        // Current option
+  ppd_choice_t         *choice;        // Marked PPD choice
 
 
- /*
-  * Range check input...
-  */
+  //
+  // Range check input...
+  //
 
-  DEBUG_printf(("ppdCacheGetFinishingValues(ppd=%p, pc=%p, max_values=%d, values=%p)", ppd, pc, max_values, values));
+  DEBUG_printf(("ppdCacheGetFinishingValues(ppd=%p, pc=%p, max_values=%d, values=%p)",
+               ppd, pc, max_values, values));
 
   if (!ppd || !pc || max_values < 1 || !values)
   {
@@ -3291,21 +3419,24 @@ ppdCacheGetFinishingValues(
     return (0);
   }
 
- /*
-  * Go through the finishings options and see what is set...
-  */
+  //
+  // Go through the finishings options and see what is set...
+  //
 
   for (f = (ppd_pwg_finishings_t *)cupsArrayFirst(pc->finishings);
        f;
        f = (ppd_pwg_finishings_t *)cupsArrayNext(pc->finishings))
   {
-    DEBUG_printf(("ppdCacheGetFinishingValues: Checking %d (%s)", (int)f->value, ippEnumString("finishings", (int)f->value)));
+    DEBUG_printf(("ppdCacheGetFinishingValues: Checking %d (%s)",
+                 (int)f->value, ippEnumString("finishings", (int)f->value)));
 
     for (i = f->num_options, option = f->options; i > 0; i --, option ++)
     {
-      DEBUG_printf(("ppdCacheGetFinishingValues: %s=%s?", option->name, option->value));
+      DEBUG_printf(("ppdCacheGetFinishingValues: %s=%s?",
+                   option->name, option->value));
 
-      if ((choice = ppdFindMarkedChoice(ppd, option->name)) == NULL || _ppd_strcasecmp(option->value, choice->choice))
+      if ((choice = ppdFindMarkedChoice(ppd, option->name)) == NULL ||
+         _ppd_strcasecmp(option->value, choice->choice))
       {
         DEBUG_puts("ppdCacheGetFinishingValues: NO");
         break;
@@ -3314,7 +3445,8 @@ ppdCacheGetFinishingValues(
 
     if (i == 0)
     {
-      DEBUG_printf(("ppdCacheGetFinishingValues: Adding %d (%s)", (int)f->value, ippEnumString("finishings", (int)f->value)));
+      DEBUG_printf(("ppdCacheGetFinishingValues: Adding %d (%s)",
+                   (int)f->value, ippEnumString("finishings", (int)f->value)));
 
       values[num_values ++] = (int)f->value;
 
@@ -3325,9 +3457,9 @@ ppdCacheGetFinishingValues(
 
   if (num_values == 0)
   {
-   /*
-    * Always have at least "finishings" = 'none'...
-    */
+    //
+    // Always have at least "finishings" = 'none'...
+    //
 
     DEBUG_puts("ppdCacheGetFinishingValues: Adding 3 (none).");
     values[0] = IPP_FINISHINGS_NONE;
@@ -3340,34 +3472,34 @@ ppdCacheGetFinishingValues(
 }
 
 
-/*
- * 'ppdCacheGetInputSlot()' - Get the PPD InputSlot associated with the job
- *                        attributes or a keyword string.
- */
+//
+// 'ppdCacheGetInputSlot()' - Get the PPD InputSlot associated with the job
+//                            attributes or a keyword string.
+//
 
-const char *                           /* O - PPD InputSlot or NULL */
+const char *                           // O - PPD InputSlot or NULL
 ppdCacheGetInputSlot(
-    ppd_cache_t *pc,                   /* I - PPD cache and mapping data */
-    ipp_t        *job,                 /* I - Job attributes or NULL */
-    const char   *keyword)             /* I - Keyword string or NULL */
+    ppd_cache_t *pc,                   // I - PPD cache and mapping data
+    ipp_t        *job,                 // I - Job attributes or NULL
+    const char   *keyword)             // I - Keyword string or NULL
 {
- /*
-  * Range check input...
-  */
+  //
+  // Range check input...
+  //
 
   if (!pc || pc->num_sources == 0 || (!job && !keyword))
     return (NULL);
 
   if (job && !keyword)
   {
-   /*
-    * Lookup the media-col attribute and any media-source found there...
-    */
+    //
+    // Lookup the media-col attribute and any media-source found there...
+    //
 
-    ipp_attribute_t    *media_col,     /* media-col attribute */
-                       *media_source;  /* media-source attribute */
-    pwg_size_t         size;           /* Dimensional size */
-    int                        margins_set;    /* Were the margins set? */
+    ipp_attribute_t    *media_col,     // media-col attribute
+                       *media_source;  // media-source attribute
+    pwg_size_t         size;           // Dimensional size
+    int                        margins_set;    // Were the margins set?
 
     media_col = ippFindAttribute(job, "media-col", IPP_TAG_BEGIN_COLLECTION);
     if (media_col &&
@@ -3375,17 +3507,17 @@ ppdCacheGetInputSlot(
                                          "media-source",
                                         IPP_TAG_KEYWORD)) != NULL)
     {
-     /*
-      * Use the media-source value from media-col...
-      */
+      //
+      // Use the media-source value from media-col...
+      //
 
       keyword = ippGetString(media_source, 0, NULL);
     }
     else if (pwgInitSize(&size, job, &margins_set))
     {
-     /*
-      * For media <= 5x7, look for a photo tray...
-      */
+      //
+      // For media <= 5x7, look for a photo tray...
+      //
 
       if (size.width <= (5 * 2540) && size.length <= (7 * 2540))
         keyword = "photo";
@@ -3394,7 +3526,7 @@ ppdCacheGetInputSlot(
 
   if (keyword)
   {
-    int        i;                              /* Looping var */
+    int        i;                              // Looping var
 
     for (i = 0; i < pc->num_sources; i ++)
       if (!_ppd_strcasecmp(keyword, pc->sources[i].pwg))
@@ -3405,32 +3537,32 @@ ppdCacheGetInputSlot(
 }
 
 
-/*
- * 'ppdCacheGetMediaType()' - Get the PPD MediaType associated with the job
- *                        attributes or a keyword string.
- */
+//
+// 'ppdCacheGetMediaType()' - Get the PPD MediaType associated with the job
+//                            attributes or a keyword string.
+//
 
-const char *                           /* O - PPD MediaType or NULL */
+const char *                           // O - PPD MediaType or NULL
 ppdCacheGetMediaType(
-    ppd_cache_t *pc,                   /* I - PPD cache and mapping data */
-    ipp_t        *job,                 /* I - Job attributes or NULL */
-    const char   *keyword)             /* I - Keyword string or NULL */
+    ppd_cache_t *pc,                   // I - PPD cache and mapping data
+    ipp_t        *job,                 // I - Job attributes or NULL
+    const char   *keyword)             // I - Keyword string or NULL
 {
- /*
-  * Range check input...
-  */
+  //
+  // Range check input...
+  //
 
   if (!pc || pc->num_types == 0 || (!job && !keyword))
     return (NULL);
 
   if (job && !keyword)
   {
-   /*
-    * Lookup the media-col attribute and any media-source found there...
-    */
+    //
+    // Lookup the media-col attribute and any media-source found there...
+    //
 
-    ipp_attribute_t    *media_col,     /* media-col attribute */
-                       *media_type;    /* media-type attribute */
+    ipp_attribute_t    *media_col,     // media-col attribute
+                       *media_type;    // media-type attribute
 
     media_col = ippFindAttribute(job, "media-col", IPP_TAG_BEGIN_COLLECTION);
     if (media_col)
@@ -3448,7 +3580,7 @@ ppdCacheGetMediaType(
 
   if (keyword)
   {
-    int        i;                              /* Looping var */
+    int        i;                              // Looping var
 
     for (i = 0; i < pc->num_types; i ++)
       if (!_ppd_strcasecmp(keyword, pc->types[i].pwg))
@@ -3459,30 +3591,29 @@ ppdCacheGetMediaType(
 }
 
 
-/*
- * 'ppdCacheGetOutputBin()' - Get the PPD OutputBin associated with the keyword
- *                        string.
- */
+//
+// 'ppdCacheGetOutputBin()' - Get the PPD OutputBin associated with the keyword
+//                            string.
+//
 
-const char *                           /* O - PPD OutputBin or NULL */
+const char *                           // O - PPD OutputBin or NULL
 ppdCacheGetOutputBin(
-    ppd_cache_t *pc,                   /* I - PPD cache and mapping data */
-    const char   *output_bin)          /* I - Keyword string */
+    ppd_cache_t *pc,                   // I - PPD cache and mapping data
+    const char   *output_bin)          // I - Keyword string
 {
-  int  i;                              /* Looping var */
+  int  i;                              // Looping var
 
 
- /*
-  * Range check input...
-  */
+  //
+  // Range check input...
+  //
 
   if (!pc || !output_bin)
     return (NULL);
 
- /*
-  * Look up the OutputBin string...
-  */
-
+  //
+  // Look up the OutputBin string...
+  //
 
   for (i = 0; i < pc->num_bins; i ++)
     if (!_ppd_strcasecmp(output_bin, pc->bins[i].pwg))
@@ -3492,41 +3623,41 @@ ppdCacheGetOutputBin(
 }
 
 
-/*
- * 'ppdCacheGetPageSize()' - Get the PPD PageSize associated with the job
- *                       attributes or a keyword string.
- */
+//
+// 'ppdCacheGetPageSize()' - Get the PPD PageSize associated with the job
+//                           attributes or a keyword string.
+//
 
-const char *                           /* O - PPD PageSize or NULL */
+const char *                           // O - PPD PageSize or NULL
 ppdCacheGetPageSize(
-    ppd_cache_t *pc,                   /* I - PPD cache and mapping data */
-    ipp_t        *job,                 /* I - Job attributes or NULL */
-    const char   *keyword,             /* I - Keyword string or NULL */
-    int          *exact)               /* O - 1 if exact match, 0 otherwise */
+    ppd_cache_t  *pc,                  // I - PPD cache and mapping data
+    ipp_t        *job,                 // I - Job attributes or NULL
+    const char   *keyword,             // I - Keyword string or NULL
+    int          *exact)               // O - 1 if exact match, 0 otherwise
 {
-  int          i, j;                   /* Looping vars */
-  pwg_size_t   *size,                  /* Current size */
-               *variant,               /* Page size variant */
-               *closest,               /* Closest size */
-               jobsize;                /* Size data from job */
-  int          margins_set,            /* Were the margins set? */
-               dwidth,                 /* Difference in width */
-               dlength,                /* Difference in length */
-               dleft,                  /* Difference in left margins */
-               dright,                 /* Difference in right margins */
-               dbottom,                /* Difference in bottom margins */
-               dtop,                   /* Difference in top margins */
-               dmin,                   /* Minimum difference */
-               dclosest;               /* Closest difference */
-  const char   *ppd_name;              /* PPD media name */
+  int          i, j;                   // Looping vars
+  pwg_size_t   *size,                  // Current size
+               *variant,               // Page size variant
+               *closest,               // Closest size
+               jobsize;                // Size data from job
+  int          margins_set,            // Were the margins set?
+               dwidth,                 // Difference in width
+               dlength,                // Difference in length
+               dleft,                  // Difference in left margins
+               dright,                 // Difference in right margins
+               dbottom,                // Difference in bottom margins
+               dtop,                   // Difference in top margins
+               dmin,                   // Minimum difference
+               dclosest;               // Closest difference
+  const char   *ppd_name;              // PPD media name
 
 
   DEBUG_printf(("ppdCacheGetPageSize(pc=%p, job=%p, keyword=\"%s\", exact=%p)",
                pc, job, keyword, exact));
 
- /*
-  * Range check input...
-  */
+  //
+  // Range check input...
+  //
 
   if (!pc || (!job && !keyword))
     return (NULL);
@@ -3538,11 +3669,11 @@ ppdCacheGetPageSize(
 
   if (job)
   {
-   /*
-    * Try getting the PPD media name from the job attributes...
-    */
+    //
+    // Try getting the PPD media name from the job attributes...
+    //
 
-    ipp_attribute_t    *attr;          /* Job attribute */
+    ipp_attribute_t    *attr;          // Job attribute
 
     if ((attr = ippFindAttribute(job, "PageSize", IPP_TAG_ZERO)) == NULL)
       if ((attr = ippFindAttribute(job, "PageRegion", IPP_TAG_ZERO)) == NULL)
@@ -3554,7 +3685,7 @@ ppdCacheGetPageSize(
                     ippGetName(attr), ippTagString(ippGetValueTag(attr))));
     else
       DEBUG_puts("1ppdCacheGetPageSize: Did not find media attribute.");
-#endif /* DEBUG */
+#endif // DEBUG
 
     if (attr && (ippGetValueTag(attr) == IPP_TAG_NAME ||
                  ippGetValueTag(attr) == IPP_TAG_KEYWORD))
@@ -3565,9 +3696,9 @@ ppdCacheGetPageSize(
 
   if (ppd_name)
   {
-   /*
-    * Try looking up the named PPD size first...
-    */
+    //
+    // Try looking up the named PPD size first...
+    //
 
     for (i = pc->num_sizes, size = pc->sizes; i > 0; i --, size ++)
     {
@@ -3589,21 +3720,21 @@ ppdCacheGetPageSize(
 
   if (job && !keyword)
   {
-   /*
-    * Get the size using media-col or media, with the preference being
-    * media-col.
-    */
+    //
+    // Get the size using media-col or media, with the preference being
+    // media-col.
+    //
 
     if (!pwgInitSize(&jobsize, job, &margins_set))
       return (NULL);
   }
   else
   {
-   /*
-    * Get the size using a media keyword...
-    */
+    //
+    // Get the size using a media keyword...
+    //
 
-    pwg_media_t        *media;         /* Media definition */
+    pwg_media_t        *media;         // Media definition
 
 
     if ((media = pwgMediaForPWG(keyword)) == NULL)
@@ -3616,10 +3747,10 @@ ppdCacheGetPageSize(
     margins_set    = 0;
   }
 
- /*
-  * Now that we have the dimensions and possibly the margins, look at the
-  * available sizes and find the match...
-  */
+  //
+  // Now that we have the dimensions and possibly the margins, look at the
+  // available sizes and find the match...
+  //
 
   closest  = NULL;
   dclosest = dmin = 999999999;
@@ -3629,10 +3760,10 @@ ppdCacheGetPageSize(
   {
     for (i = pc->num_sizes, size = pc->sizes; i > 0; i --, size ++)
     {
-     /*
-      * Adobe uses a size matching algorithm with an epsilon of 5 points, which
-      * is just about 176/2540ths...
-      */
+      //
+      // Adobe uses a size matching algorithm with an epsilon of 5 points, which
+      // is just about 176/2540ths...
+      //
 
       dwidth  = size->width - jobsize.width;
       dlength = size->length - jobsize.length;
@@ -3642,11 +3773,12 @@ ppdCacheGetPageSize(
 
       if (margins_set)
       {
-       /*
-       * Check not only the base size (like "A4") but also variants (like
-        * "A4.Borderless"). We check only the margins and orientation but do 
-       * not re-check the size.
-       */
+       //
+       // Check not only the base size (like "A4") but also variants (like
+        // "A4.Borderless"). We check only the margins and orientation but do 
+       // not re-check the size.
+       //
+
        for (j = pc->num_sizes, variant = pc->sizes; j > 0; j --, variant ++)
        {
          if (!strcmp(size->map.ppd, variant->map.ppd) ||
@@ -3655,22 +3787,22 @@ ppdCacheGetPageSize(
               (strlen(variant->map.ppd) > strlen(size->map.ppd) + 1) &&
               variant->map.ppd[strlen(size->map.ppd)] == '.'))
          {
-          /*
-           * Found a variant (or the base size)
-           */
+           //
+           // Found a variant (or the base size)
+           //
 
-          /*
-           * First check orientation (we do not want ".Transverse" variants)
-           */
+           //
+           // First check orientation (we do not want ".Transverse" variants)
+           //
 
            if ((size->length - size->width) *
                (variant->length - variant->width) < 0)
              continue;
 
-          /*
-           * Borderless page size variant, use it only if the job requests
-           * borderless
-           */
+           //
+           // Borderless page size variant, use it only if the job requests
+           // borderless
+           //
 
            if (strchr(variant->map.ppd, '.') &&
                variant->left == 0 && variant->right == 0 &&
@@ -3679,9 +3811,9 @@ ppdCacheGetPageSize(
                 jobsize.top != 0 || jobsize.bottom != 0))
              continue;
 
-          /*
-           * Use a tighter epsilon of 1 point (35/2540ths) for margins...
-           */
+           //
+           // Use a tighter epsilon of 1 point (35/2540ths) for margins...
+           //
 
            dleft   = variant->left - jobsize.left;
            dright  = variant->right - jobsize.right;
@@ -3695,8 +3827,8 @@ ppdCacheGetPageSize(
              dright  = dright < 0 ? -dright : dright;
              dbottom = dbottom < 0 ? -dbottom : dbottom;
              dtop    = dtop < 0 ? -dtop : dtop;
-             /* In the sum we do a slight penalization of the variants to
-                prefer the base if it has the same margins) */
+             // In the sum we do a slight penalization of the variants to
+             // prefer the base if it has the same margins)
              dmin    = dleft + dright + dbottom + dtop +
                        (strchr(variant->map.ppd, '.') ? 1 : 0);
 
@@ -3735,21 +3867,22 @@ ppdCacheGetPageSize(
     return (closest->map.ppd);
   }
 
- /*
-  * If we get here we need to check for custom page size support...
-  */
+  //
+  // If we get here we need to check for custom page size support...
+  //
 
   if (jobsize.width >= pc->custom_min_width &&
       jobsize.width <= pc->custom_max_width &&
       jobsize.length >= pc->custom_min_length &&
       jobsize.length <= pc->custom_max_length)
   {
-   /*
-    * In range, format as Custom.WWWWxLLLL (points).
-    */
+    //
+    // In range, format as Custom.WWWWxLLLL (points).
+    //
 
     snprintf(pc->custom_ppd_size, sizeof(pc->custom_ppd_size), "Custom.%dx%d",
-             (int)PWG_TO_POINTS(jobsize.width), (int)PWG_TO_POINTS(jobsize.length));
+             (int)PWG_TO_POINTS(jobsize.width),
+            (int)PWG_TO_POINTS(jobsize.length));
 
     if (margins_set && exact)
     {
@@ -3771,9 +3904,9 @@ ppdCacheGetPageSize(
     return (pc->custom_ppd_size);
   }
 
- /*
-  * No custom page size support or the size is out of range - return NULL.
-  */
+  //
+  // No custom page size support or the size is out of range - return NULL.
+  //
 
   DEBUG_puts("1ppdCacheGetPageSize: Returning NULL");
 
@@ -3781,43 +3914,43 @@ ppdCacheGetPageSize(
 }
 
 
-/*
- * 'ppdCacheGetSize()' - Get the PWG size associated with a PPD PageSize.
- */
+//
+// 'ppdCacheGetSize()' - Get the PWG size associated with a PPD PageSize.
+//
 
-pwg_size_t *                           /* O - PWG size or NULL */
+pwg_size_t *                           // O - PWG size or NULL
 ppdCacheGetSize(
-    ppd_cache_t *pc,                   /* I - PPD cache and mapping data */
-    const char   *page_size)           /* I - PPD PageSize */
+    ppd_cache_t *pc,                   // I - PPD cache and mapping data
+    const char  *page_size)            // I - PPD PageSize
 {
-  int          i;                      /* Looping var */
-  pwg_media_t  *media;                 /* Media */
-  pwg_size_t   *size;                  /* Current size */
+  int          i;                      // Looping var
+  pwg_media_t  *media;                 // Media
+  pwg_size_t   *size;                  // Current size
 
 
- /*
-  * Range check input...
-  */
+  //
+  // Range check input...
+  //
 
   if (!pc || !page_size)
     return (NULL);
 
   if (!_ppd_strncasecmp(page_size, "Custom.", 7))
   {
-   /*
-    * Custom size; size name can be one of the following:
-    *
-    *    Custom.WIDTHxLENGTHin    - Size in inches
-    *    Custom.WIDTHxLENGTHft    - Size in feet
-    *    Custom.WIDTHxLENGTHcm    - Size in centimeters
-    *    Custom.WIDTHxLENGTHmm    - Size in millimeters
-    *    Custom.WIDTHxLENGTHm     - Size in meters
-    *    Custom.WIDTHxLENGTH[pt]  - Size in points
-    */
-
-    double             w, l;           /* Width and length of page */
-    char               *ptr;           /* Pointer into PageSize */
-    struct lconv       *loc;           /* Locale data */
+    //
+    // Custom size; size name can be one of the following:
+    //
+    //    Custom.WIDTHxLENGTHin    - Size in inches
+    //    Custom.WIDTHxLENGTHft    - Size in feet
+    //    Custom.WIDTHxLENGTHcm    - Size in centimeters
+    //    Custom.WIDTHxLENGTHmm    - Size in millimeters
+    //    Custom.WIDTHxLENGTHm     - Size in meters
+    //    Custom.WIDTHxLENGTH[pt]  - Size in points
+    //
+
+    double             w, l;           // Width and length of page
+    char               *ptr;           // Pointer into PageSize
+    struct lconv       *loc;           // Locale data
 
     loc = localeconv();
     w   = (float)_ppdStrScand(page_size + 7, &ptr, loc);
@@ -3865,18 +3998,18 @@ ppdCacheGetSize(
     return (&(pc->custom_size));
   }
 
- /*
-  * Not a custom size - look it up...
-  */
+  //
+  // Not a custom size - look it up...
+  //
 
   for (i = pc->num_sizes, size = pc->sizes; i > 0; i --, size ++)
     if (!_ppd_strcasecmp(page_size, size->map.ppd) ||
         !_ppd_strcasecmp(page_size, size->map.pwg))
       return (size);
 
- /*
-  * Look up standard sizes...
-  */
+  //
+  // Look up standard sizes...
+  //
 
   if ((media = pwgMediaForPPD(page_size)) == NULL)
     if ((media = pwgMediaForLegacy(page_size)) == NULL)
@@ -3894,87 +4027,89 @@ ppdCacheGetSize(
 }
 
 
-/*
- * 'ppdCacheGetSource()' - Get the PWG media-source associated with a PPD
- *                          InputSlot.
- */
+//
+// 'ppdCacheGetSource()' - Get the PWG media-source associated with a PPD
+//                         InputSlot.
+//
 
-const char *                           /* O - PWG media-source keyword */
+const char *                           // O - PWG media-source keyword
 ppdCacheGetSource(
-    ppd_cache_t *pc,                   /* I - PPD cache and mapping data */
-    const char   *input_slot)          /* I - PPD InputSlot */
+    ppd_cache_t *pc,                   // I - PPD cache and mapping data
+    const char  *input_slot)           // I - PPD InputSlot
 {
-  int          i;                      /* Looping var */
-  pwg_map_t    *source;                /* Current source */
+  int          i;                      // Looping var
+  pwg_map_t    *source;                // Current source
 
 
- /*
-  * Range check input...
-  */
+  //
+  // Range check input...
+  //
 
   if (!pc || !input_slot)
     return (NULL);
 
   for (i = pc->num_sources, source = pc->sources; i > 0; i --, source ++)
-    if (!_ppd_strcasecmp(input_slot, source->ppd) || !_ppd_strcasecmp(input_slot, source->pwg))
+    if (!_ppd_strcasecmp(input_slot, source->ppd) ||
+       !_ppd_strcasecmp(input_slot, source->pwg))
       return (source->pwg);
 
   return (NULL);
 }
 
 
-/*
- * 'ppdCacheGetType()' - Get the PWG media-type associated with a PPD
- *                        MediaType.
- */
+//
+// 'ppdCacheGetType()' - Get the PWG media-type associated with a PPD
+//                       MediaType.
+//
 
-const char *                           /* O - PWG media-type keyword */
+const char *                           // O - PWG media-type keyword
 ppdCacheGetType(
-    ppd_cache_t *pc,                   /* I - PPD cache and mapping data */
-    const char   *media_type)          /* I - PPD MediaType */
+    ppd_cache_t *pc,                   // I - PPD cache and mapping data
+    const char  *media_type)           // I - PPD MediaType
 {
-  int          i;                      /* Looping var */
-  pwg_map_t    *type;                  /* Current type */
+  int          i;                      // Looping var
+  pwg_map_t    *type;                  // Current type
 
 
- /*
-  * Range check input...
-  */
+  //
+  // Range check input...
+  //
 
   if (!pc || !media_type)
     return (NULL);
 
   for (i = pc->num_types, type = pc->types; i > 0; i --, type ++)
-    if (!_ppd_strcasecmp(media_type, type->ppd) || !_ppd_strcasecmp(media_type, type->pwg))
+    if (!_ppd_strcasecmp(media_type, type->ppd) ||
+       !_ppd_strcasecmp(media_type, type->pwg))
       return (type->pwg);
 
   return (NULL);
 }
 
 
-/*
- * 'ppdCacheWriteFile()' - Write PWG mapping data to a file.
- */
+//
+// 'ppdCacheWriteFile()' - Write PWG mapping data to a file.
+//
 
-int                                    /* O - 1 on success, 0 on failure */
+int                                    // O - 1 on success, 0 on failure
 ppdCacheWriteFile(
-    ppd_cache_t *pc,                   /* I - PPD cache and mapping data */
-    const char   *filename,            /* I - File to write */
-    ipp_t        *attrs)               /* I - Attributes to write, if any */
+    ppd_cache_t  *pc,                  // I - PPD cache and mapping data
+    const char   *filename,            // I - File to write
+    ipp_t        *attrs)               // I - Attributes to write, if any
 {
-  int                  i, j, k;        /* Looping vars */
-  cups_file_t          *fp;            /* Output file */
-  pwg_size_t           *size;          /* Current size */
-  pwg_map_t            *map;           /* Current map */
-  ppd_pwg_finishings_t *f;             /* Current finishing option */
-  cups_option_t                *option;        /* Current option */
-  const char           *value;         /* String value */
-  char                 newfile[1024];  /* New filename */
+  int                  i, j, k;        // Looping vars
+  cups_file_t          *fp;            // Output file
+  pwg_size_t           *size;          // Current size
+  pwg_map_t            *map;           // Current map
+  ppd_pwg_finishings_t *f;             // Current finishing option
+  cups_option_t                *option;        // Current option
+  const char           *value;         // String value
+  char                 newfile[1024];  // New filename
 
 
- /*
-  * Range check input...
-  */
+  //
+  // Range check input...
+  //
 
   if (!pc || !filename)
   {
@@ -3982,9 +4117,9 @@ ppdCacheWriteFile(
     return (0);
   }
 
- /*
-  * Open the file and write with compression...
-  */
+  //
+  // Open the file and write with compression...
+  //
 
   snprintf(newfile, sizeof(newfile), "%s.N", filename);
   if ((fp = cupsFileOpen(newfile, "w9")) == NULL)
@@ -3993,15 +4128,15 @@ ppdCacheWriteFile(
     return (0);
   }
 
- /*
-  * Standard header...
-  */
+  //
+  // Standard header...
+  //
 
   cupsFilePrintf(fp, "#CUPS-PPD-CACHE-%d\n", PPD_CACHE_VERSION);
 
- /*
-  * Output bins...
-  */
+  //
+  // Output bins...
+  //
 
   if (pc->num_bins > 0)
   {
@@ -4010,9 +4145,9 @@ ppdCacheWriteFile(
       cupsFilePrintf(fp, "Bin %s %s\n", map->pwg, map->ppd);
   }
 
- /*
-  * Media sizes...
-  */
+  //
+  // Media sizes...
+  //
 
   cupsFilePrintf(fp, "NumSizes %d\n", pc->num_sizes);
   for (i = pc->num_sizes, size = pc->sizes; i > 0; i --, size ++)
@@ -4026,9 +4161,9 @@ ppdCacheWriteFile(
                   pc->custom_size.left, pc->custom_size.bottom,
                   pc->custom_size.right, pc->custom_size.top);
 
- /*
-  * Media sources...
-  */
+  //
+  // Media sources...
+  //
 
   if (pc->source_option)
     cupsFilePrintf(fp, "SourceOption %s\n", pc->source_option);
@@ -4040,9 +4175,9 @@ ppdCacheWriteFile(
       cupsFilePrintf(fp, "Source %s %s\n", map->pwg, map->ppd);
   }
 
- /*
-  * Media types...
-  */
+  //
+  // Media types...
+  //
 
   if (pc->num_types > 0)
   {
@@ -4051,11 +4186,12 @@ ppdCacheWriteFile(
       cupsFilePrintf(fp, "Type %s %s\n", map->pwg, map->ppd);
   }
 
- /*
-  * Presets...
-  */
+  //
+  // Presets...
+  //
 
-  for (i = PPD_PWG_PRINT_COLOR_MODE_MONOCHROME; i < PPD_PWG_PRINT_COLOR_MODE_MAX; i ++)
+  for (i = PPD_PWG_PRINT_COLOR_MODE_MONOCHROME;
+       i < PPD_PWG_PRINT_COLOR_MODE_MAX; i ++)
     for (j = PPD_PWG_PRINT_QUALITY_DRAFT; j < PPD_PWG_PRINT_QUALITY_MAX; j ++)
       if (pc->num_presets[i][j])
       {
@@ -4067,11 +4203,12 @@ ppdCacheWriteFile(
        cupsFilePutChar(fp, '\n');
       }
 
- /*
-  * Optimization Presets...
-  */
+  //
+  // Optimization Presets...
+  //
 
-  for (i = PPD_PWG_PRINT_CONTENT_OPTIMIZE_AUTO; i < PPD_PWG_PRINT_CONTENT_OPTIMIZE_MAX; i ++)
+  for (i = PPD_PWG_PRINT_CONTENT_OPTIMIZE_AUTO;
+       i < PPD_PWG_PRINT_CONTENT_OPTIMIZE_MAX; i ++)
     if (pc->num_optimize_presets[i])
     {
       cupsFilePrintf(fp, "OptimizePreset %d", i);
@@ -4082,9 +4219,9 @@ ppdCacheWriteFile(
       cupsFilePutChar(fp, '\n');
     }
 
- /*
-  * Duplex/sides...
-  */
+  //
+  // Duplex/sides...
+  //
 
   if (pc->sides_option)
     cupsFilePrintf(fp, "SidesOption %s\n", pc->sides_option);
@@ -4098,9 +4235,9 @@ ppdCacheWriteFile(
   if (pc->sides_2sided_short)
     cupsFilePrintf(fp, "Sides2SidedShort %s\n", pc->sides_2sided_short);
 
- /*
-  * Product, cupsFilter, cupsFilter2, and cupsPreFilter...
-  */
+  //
+  // Product, cupsFilter, cupsFilter2, and cupsPreFilter...
+  //
 
   if (pc->product)
     cupsFilePutConf(fp, "Product", pc->product);
@@ -4117,9 +4254,9 @@ ppdCacheWriteFile(
 
   cupsFilePrintf(fp, "SingleFile %s\n", pc->single_file ? "true" : "false");
 
- /*
-  * Finishing options...
-  */
+  //
+  // Finishing options...
+  //
 
   for (f = (ppd_pwg_finishings_t *)cupsArrayFirst(pc->finishings);
        f;
@@ -4134,15 +4271,15 @@ ppdCacheWriteFile(
   for (value = (const char *)cupsArrayFirst(pc->templates); value; value = (const char *)cupsArrayNext(pc->templates))
     cupsFilePutConf(fp, "FinishingTemplate", value);
 
- /*
-  * Max copies...
-  */
+  //
+  // Max copies...
+  //
 
   cupsFilePrintf(fp, "MaxCopies %d\n", pc->max_copies);
 
- /*
-  * Accounting/quota/PIN/managed printing values...
-  */
+  //
+  // Accounting/quota/PIN/managed printing values...
+  //
 
   if (pc->charge_info_uri)
     cupsFilePutConf(fp, "ChargeInfoURI", pc->charge_info_uri);
@@ -4159,18 +4296,18 @@ ppdCacheWriteFile(
        value = (char *)cupsArrayNext(pc->mandatory))
     cupsFilePutConf(fp, "Mandatory", value);
 
- /*
-  * Support files...
-  */
+  //
+  // Support files...
+  //
 
   for (value = (char *)cupsArrayFirst(pc->support_files);
        value;
        value = (char *)cupsArrayNext(pc->support_files))
     cupsFilePutConf(fp, "SupportFile", value);
 
- /*
-  * IPP attributes, if any...
-  */
+  //
+  // IPP attributes, if any...
+  //
 
   if (attrs)
   {
@@ -4180,9 +4317,9 @@ ppdCacheWriteFile(
     ippWriteIO(fp, (ipp_iocb_t)cupsFileWrite, 1, NULL, attrs);
   }
 
- /*
-  * Close and return...
-  */
+  //
+  // Close and return...
+  //
 
   if (cupsFileClose(fp))
   {
@@ -4195,20 +4332,20 @@ ppdCacheWriteFile(
 }
 
 
-/*
- * 'ppdPwgInputSlotForSource()' - Get the InputSlot name for the given PWG
- *                              media-source.
- */
+//
+// 'ppdPwgInputSlotForSource()' - Get the InputSlot name for the given PWG
+//                                media-source.
+//
 
-const char *                           /* O - InputSlot name */
+const char *                           // O - InputSlot name
 ppdPwgInputSlotForSource(
-    const char *media_source,          /* I - PWG media-source */
-    char       *name,                  /* I - Name buffer */
-    size_t     namesize)               /* I - Size of name buffer */
+    const char *media_source,          // I - PWG media-source
+    char       *name,                  // I - Name buffer
+    size_t     namesize)               // I - Size of name buffer
 {
- /*
-  * Range check input...
-  */
+  //
+  // Range check input...
+  //
 
   if (!media_source || !name || namesize < PPD_MAX_NAME)
     return (NULL);
@@ -4242,20 +4379,20 @@ ppdPwgInputSlotForSource(
 }
 
 
-/*
- * 'ppdPwgMediaTypeForType()' - Get the MediaType name for the given PWG
- *                            media-type.
- */
+//
+// 'ppdPwgMediaTypeForType()' - Get the MediaType name for the given PWG
+//                              media-type.
+//
 
-const char *                           /* O - MediaType name */
+const char *                           // O - MediaType name
 ppdPwgMediaTypeForType(
-    const char *media_type,            /* I - PWG media-type */
-    char       *name,                  /* I - Name buffer */
-    size_t     namesize)               /* I - Size of name buffer */
+    const char *media_type,            // I - PWG media-type
+    char       *name,                  // I - Name buffer
+    size_t     namesize)               // I - Size of name buffer
 {
- /*
-  * Range check input...
-  */
+  //
+  // Range check input...
+  //
 
   if (!media_type || !name || namesize < PPD_MAX_NAME)
     return (NULL);
@@ -4291,36 +4428,36 @@ ppdPwgMediaTypeForType(
 }
 
 
-/*
- * 'ppdPwgPageSizeForMedia()' - Get the PageSize name for the given media.
- */
+//
+// 'ppdPwgPageSizeForMedia()' - Get the PageSize name for the given media.
+//
 
-const char *                           /* O - PageSize name */
+const char *                           // O - PageSize name
 ppdPwgPageSizeForMedia(
-    pwg_media_t *media,                        /* I - Media */
-    char        *name,                 /* I - PageSize name buffer */
-    size_t      namesize)              /* I - Size of name buffer */
+    pwg_media_t *media,                        // I - Media
+    char        *name,                 // I - PageSize name buffer
+    size_t      namesize)              // I - Size of name buffer
 {
-  const char   *sizeptr,               /* Pointer to size in PWG name */
-               *dimptr;                /* Pointer to dimensions in PWG name */
+  const char   *sizeptr,               // Pointer to size in PWG name
+               *dimptr;                // Pointer to dimensions in PWG name
 
 
- /*
-  * Range check input...
-  */
+  //
+  // Range check input...
+  //
 
   if (!media || !name || namesize < PPD_MAX_NAME)
     return (NULL);
 
- /*
-  * Copy or generate a PageSize name...
-  */
+  //
+  // Copy or generate a PageSize name...
+  //
 
   if (media->ppd)
   {
-   /*
-    * Use a standard Adobe name...
-    */
+    //
+    // Use a standard Adobe name...
+    //
 
     strlcpy(name, media->ppd, namesize);
   }
@@ -4329,18 +4466,18 @@ ppdPwgPageSizeForMedia(
           (dimptr = strchr(sizeptr + 1, '_')) == NULL ||
           (size_t)(dimptr - sizeptr) > namesize)
   {
-   /*
-    * Use a name of the form "wNNNhNNN"...
-    */
+    //
+    // Use a name of the form "wNNNhNNN"...
+    //
 
     snprintf(name, namesize, "w%dh%d", (int)PWG_TO_POINTS(media->width),
              (int)PWG_TO_POINTS(media->length));
   }
   else
   {
-   /*
-    * Copy the size name from class_sizename_dimensions...
-    */
+    //
+    // Copy the size name from class_sizename_dimensions...
+    //
 
     memcpy(name, sizeptr + 1, (size_t)(dimptr - sizeptr - 1));
     name[dimptr - sizeptr - 1] = '\0';
@@ -4350,21 +4487,22 @@ ppdPwgPageSizeForMedia(
 }
 
 
-/*
- * 'ppd_pwg_add_finishing()' - Add a finishings value.
- */
+//
+// 'ppd_pwg_add_finishing()' - Add a finishings value.
+//
 
 static void
 ppd_pwg_add_finishing(
-    cups_array_t     *finishings,      /* I - Finishings array */
-    ipp_finishings_t template,         /* I - Finishing template */
-    const char       *name,            /* I - PPD option */
-    const char       *value)           /* I - PPD choice */
+    cups_array_t     *finishings,      // I - Finishings array
+    ipp_finishings_t template,         // I - Finishing template
+    const char       *name,            // I - PPD option
+    const char       *value)           // I - PPD choice
 {
-  ppd_pwg_finishings_t *f;             /* New finishings value */
+  ppd_pwg_finishings_t *f;             // New finishings value
 
 
-  if ((f = (ppd_pwg_finishings_t *)calloc(1, sizeof(ppd_pwg_finishings_t))) != NULL)
+  if ((f = (ppd_pwg_finishings_t *)calloc(1, sizeof(ppd_pwg_finishings_t))) !=
+      NULL)
   {
     f->value       = template;
     f->num_options = cupsAddOption(name, value, 0, &f->options);
@@ -4374,16 +4512,16 @@ ppd_pwg_add_finishing(
 }
 
 
-/*
- * 'ppd_pwg_add_message()' - Add a message to the PPD cached strings.
- */
+//
+// 'ppd_pwg_add_message()' - Add a message to the PPD cached strings.
+//
 
 static void
-ppd_pwg_add_message(cups_array_t *a,   /* I - Message catalog */
-                const char   *msg,     /* I - Message identifier */
-                const char   *str)     /* I - Localized string */
+ppd_pwg_add_message(cups_array_t *a,   // I - Message catalog
+                const char   *msg,     // I - Message identifier
+                const char   *str)     // I - Localized string
 {
-  _ppd_message_t       *m;             /* New message */
+  _ppd_message_t       *m;             // New message
 
 
   if ((m = calloc(1, sizeof(_ppd_message_t))) != NULL)
@@ -4395,43 +4533,43 @@ ppd_pwg_add_message(cups_array_t *a,    /* I - Message catalog */
 }
 
 
-/*
- * 'ppd_pwg_compare_finishings()' - Compare two finishings values.
- */
+//
+// 'ppd_pwg_compare_finishings()' - Compare two finishings values.
+//
 
-static int                             /* O - Result of comparison */
+static int                             // O - Result of comparison
 ppd_pwg_compare_finishings(
-    ppd_pwg_finishings_t *a,           /* I - First finishings value */
-    ppd_pwg_finishings_t *b)           /* I - Second finishings value */
+    ppd_pwg_finishings_t *a,           // I - First finishings value
+    ppd_pwg_finishings_t *b)           // I - Second finishings value
 {
   return ((int)b->value - (int)a->value);
 }
 
 
-/*
- * 'ppd_pwg_free_finishings()' - Free a finishings value.
- */
+//
+// 'ppd_pwg_free_finishings()' - Free a finishings value.
+//
 
 static void
 ppd_pwg_free_finishings(
-    ppd_pwg_finishings_t *f)           /* I - Finishings value */
+    ppd_pwg_finishings_t *f)           // I - Finishings value
 {
   cupsFreeOptions(f->num_options, f->options);
   free(f);
 }
 
 
-/*
- * 'ppdPwgPpdizeName()' - Convert an IPP keyword to a PPD keyword.
- */
+//
+// 'ppdPwgPpdizeName()' - Convert an IPP keyword to a PPD keyword.
+//
 
 void
-ppdPwgPpdizeName(const char *ipp,      /* I - IPP keyword */
-                char       *name,      /* I - Name buffer */
-                size_t     namesize)   /* I - Size of name buffer */
+ppdPwgPpdizeName(const char *ipp,      // I - IPP keyword
+                char       *name,      // I - Name buffer
+                size_t     namesize)   // I - Size of name buffer
 {
-  char *ptr,                           /* Pointer into name buffer */
-       *end;                           /* End of name buffer */
+  char *ptr,                           // Pointer into name buffer
+       *end;                           // End of name buffer
 
 
   if (!ipp)
@@ -4457,20 +4595,20 @@ ppdPwgPpdizeName(const char *ipp,       /* I - IPP keyword */
 }
 
 
-/*
- * 'ppdPwgPpdizeResolution()' - Convert PWG resolution values to PPD values.
- */
+//
+// 'ppdPwgPpdizeResolution()' - Convert PWG resolution values to PPD values.
+//
 
 void
 ppdPwgPpdizeResolution(
-    ipp_attribute_t *attr,             /* I - Attribute to convert */
-    int             element,           /* I - Element to convert */
-    int             *xres,             /* O - X resolution in DPI */
-    int             *yres,             /* O - Y resolution in DPI */
-    char            *name,             /* I - Name buffer */
-    size_t          namesize)          /* I - Size of name buffer */
+    ipp_attribute_t *attr,             // I - Attribute to convert
+    int             element,           // I - Element to convert
+    int             *xres,             // O - X resolution in DPI
+    int             *yres,             // O - Y resolution in DPI
+    char            *name,             // I - Name buffer
+    size_t          namesize)          // I - Size of name buffer
 {
-  ipp_res_t units;                     /* Units for resolution */
+  ipp_res_t units;                     // Units for resolution
 
 
   *xres = ippGetResolution(attr, element, yres, &units);
@@ -4491,32 +4629,32 @@ ppdPwgPpdizeResolution(
 }
 
 
-/*
- * 'ppdPwgUnppdizeName()' - Convert a PPD keyword to a lowercase IPP keyword.
- */
+//
+// 'ppdPwgUnppdizeName()' - Convert a PPD keyword to a lowercase IPP keyword.
+//
 
 void
-ppdPwgUnppdizeName(const char *ppd,     /* I - PPD keyword */
-                  char       *name,     /* I - Name buffer */
-                  size_t     namesize,  /* I - Size of name buffer */
-                  const char *dashchars)/* I - Characters to be replaced by
-                                               dashes or NULL to replace all
-                                               non-alphanumeric characters */
+ppdPwgUnppdizeName(const char *ppd,     // I - PPD keyword
+                  char       *name,     // I - Name buffer
+                  size_t     namesize,  // I - Size of name buffer
+                  const char *dashchars)// I - Characters to be replaced by
+                                        //     dashes or NULL to replace all
+                                        //     non-alphanumeric characters
 {
-  char *ptr,                           /* Pointer into name buffer */
-       *end;                           /* End of name buffer */
-  int   nodash = 1;                     /* Next char in IPP name cannot be a
-                                           dash (first char or after a dash) */
+  char *ptr,                           // Pointer into name buffer
+       *end;                           // End of name buffer
+  int   nodash = 1;                     // Next char in IPP name cannot be a
+                                       // dash (first char or after a dash)
   int   firstchar = 1;
 
 
   if (_ppd_islower(*ppd))
   {
-   /*
-    * Already lowercase name, use as-is?
-    */
+    //
+    // Already lowercase name, use as-is?
+    //
 
-    const char *ppdptr;                        /* Pointer into PPD keyword */
+    const char *ppdptr;                        // Pointer into PPD keyword
 
     for (ppdptr = ppd + 1; *ppdptr; ppdptr ++)
       if (_ppd_isupper(*ppdptr) ||
@@ -4575,7 +4713,7 @@ ppdPwgUnppdizeName(const char *ppd,        /* I - PPD keyword */
     firstchar = 0;
   }
 
-  /* Remove trailing dashes */
+  // Remove trailing dashes
   while (ptr > name && *(ptr - 1) == '-')
     ptr --;
 
index 966c604db98631644f6a3c0f95d60531781e9887..f8ee32eaeecb90f7e1fcbdd292038bf0150d382e 100644 (file)
@@ -1,20 +1,20 @@
-/*
- * PPD collection support for cups-filters
- *
- * This program handles listing and installing static PPD files, PPD files
- * created from driver information files, and dynamically generated PPD files
- * using driver helper programs.
- *
- * Copyright © 2007-2019 by Apple Inc.
- * Copyright © 1997-2007 by Easy Software Products.
- *
- * Licensed under Apache License v2.0.  See the file "LICENSE" for more
- * information.
- */
-
-/*
- * Include necessary headers...
- */
+//
+// PPD collection support for libppd.
+//
+// This program handles listing and installing static PPD files, PPD files
+// created from driver information files, and dynamically generated PPD files
+// using driver helper programs.
+//
+// Copyright © 2007-2019 by Apple Inc.
+// Copyright © 1997-2007 by Easy Software Products.
+//
+// Licensed under Apache License v2.0.  See the file "LICENSE" for more
+// information.
+//
+
+//
+// Include necessary headers...
+//
 
 #include <cups/dir.h>
 #include <cups/transcode.h>
 #include <sys/wait.h>
 
 
-/*
- * Constants...
- */
+//
+// Constants...
+//
 
-#define TAR_BLOCK      512             /* Number of bytes in a block */
-#define TAR_BLOCKS     10              /* Blocking factor */
+#define TAR_BLOCK      512             // Number of bytes in a block
+#define TAR_BLOCKS     10              // Blocking factor
 
-#define TAR_MAGIC      "ustar"         /* 5 chars and a null */
-#define TAR_VERSION    "00"            /* POSIX tar version */
+#define TAR_MAGIC      "ustar"         // 5 chars and a null
+#define TAR_VERSION    "00"            // POSIX tar version
 #define TAR_OLDGNU_MAGIC "ustar  "
 
-#define TAR_OLDNORMAL  '\0'            /* Normal disk file, Unix compat */
-#define TAR_NORMAL     '0'             /* Normal disk file */
-#define TAR_LINK       '1'             /* Link to previously dumped file */
-#define TAR_SYMLINK    '2'             /* Symbolic link */
-#define TAR_CHR                '3'             /* Character special file */
-#define TAR_BLK                '4'             /* Block special file */
-#define TAR_DIR                '5'             /* Directory */
-#define TAR_FIFO       '6'             /* FIFO special file */
-#define TAR_CONTIG     '7'             /* Contiguous file */
+#define TAR_OLDNORMAL  '\0'            // Normal disk file, Unix compat
+#define TAR_NORMAL     '0'             // Normal disk file
+#define TAR_LINK       '1'             // Link to previously dumped file
+#define TAR_SYMLINK    '2'             // Symbolic link
+#define TAR_CHR                '3'             // Character special file
+#define TAR_BLK                '4'             // Block special file
+#define TAR_DIR                '5'             // Directory
+#define TAR_FIFO       '6'             // FIFO special file
+#define TAR_CONTIG     '7'             // Contiguous file
 
 
-/*
- * PPD information structures...
- */
+//
+// PPD information structures...
+//
 
-typedef union                          /**** TAR record format ****/
+typedef union                          // **** TAR record format ****
 {
-  unsigned char        all[TAR_BLOCK];         /* Raw data block */
+  unsigned char        all[TAR_BLOCK];         // Raw data block
   struct
   {
-    char       pathname[100],          /* Destination path */
-               mode[8],                /* Octal file permissions */
-               uid[8],                 /* Octal user ID */
-               gid[8],                 /* Octal group ID */
-               size[12],               /* Octal size in bytes */
-               mtime[12],              /* Octal modification time */
-               chksum[8],              /* Octal checksum value */
-               linkflag,               /* File type */
-               linkname[100],          /* Source path for link */
-               magic[6],               /* Magic string */
-               version[2],             /* Format version */
-               uname[32],              /* User name */
-               gname[32],              /* Group name */
-               devmajor[8],            /* Octal device major number */
-               devminor[8],            /* Octal device minor number */
-               prefix[155];            /* Prefix for long filenames */
+    char       pathname[100],          // Destination path
+               mode[8],                // Octal file permissions
+               uid[8],                 // Octal user ID
+               gid[8],                 // Octal group ID
+               size[12],               // Octal size in bytes
+               mtime[12],              // Octal modification time
+               chksum[8],              // Octal checksum value
+               linkflag,               // File type
+               linkname[100],          // Source path for link
+               magic[6],               // Magic string
+               version[2],             // Format version
+               uname[32],              // User name
+               gname[32],              // Group name
+               devmajor[8],            // Octal device major number
+               devminor[8],            // Octal device minor number
+               prefix[155];            // Prefix for long filenames
   }    header;
 } tar_rec_t;
 
 typedef struct
 {
-  cups_array_t *Inodes;        /* Inodes of directories we've visited*/
+  cups_array_t *Inodes;        // Inodes of directories we've visited
   cups_array_t *PPDsByName,
-                               /* PPD files sorted by filename and name */
+                               // PPD files sorted by filename and name
                *PPDsByMakeModel;
-                               /* PPD files sorted by make and model */
-  int          ChangedPPD;     /* Did we change the PPD database? */
+                               // PPD files sorted by make and model
+  int          ChangedPPD;     // Did we change the PPD database?
 } ppd_list_t;
 
 //typedef int (*cupsd_compare_func_t)(const void *, const void *);
 
 
-/*
- * Globals...
- */
+//
+// Globals...
+//
 
-static const char * const PPDTypes[] = /* ppd-type values */
+static const char * const PPDTypes[] = // ppd-type values
                        {
                          "postscript",
                          "pdf",
@@ -108,9 +108,9 @@ static const char * const PPDTypes[] =      /* ppd-type values */
                        };
 
 
-/*
- * Local functions...
- */
+//
+// Local functions...
+//
 
 static ppd_info_t      *add_ppd(const char *filename, const char *name,
                                 const char *language, const char *make,
@@ -175,56 +175,56 @@ static int                ClosePipeCommand(cups_file_t *fp, int cpid, int epid,
                                         cf_logfunc_t log, void *ld);
 
 
-/*
- * 'ppdCollectionListPPDs()' - List PPD files.
- */
+//
+// 'ppdCollectionListPPDs()' - List PPD files.
+//
 
-cups_array_t *                         /* O - List of PPD files */
+cups_array_t *                         // O - List of PPD files
 ppdCollectionListPPDs(
-       cups_array_t  *ppd_collections, /* I - Directories to search for PPDs
-                                              in */
-       int           limit,            /* I - Limit */
-       int           num_options,      /* I - Number of options */
-       cups_option_t *options,         /* I - Options */
-       cf_logfunc_t log,               /* I - Log function */
-       void *ld)                       /* I - Aux. data for log function */
+       cups_array_t  *ppd_collections, // I - Directories to search for PPDs
+                                       //     in
+       int           limit,            // I - Limit
+       int           num_options,      // I - Number of options
+       cups_option_t *options,         // I - Options
+       cf_logfunc_t log,               // I - Log function
+       void *ld)                       // I - Aux. data for log function
 {
-  int          i;                      /* Looping var */
-  ppd_collection_t *col;               /* Pointer to PPD collection */
-  int          count;                  /* Number of PPDs to list */
-  ppd_info_t   *ppd,                   /* Current PPD file */
-               *newppd;                /* Copy of current PPD */
-  cups_file_t  *fp;                    /* ppds.dat file */
-  cups_array_t *include,               /* PPD schemes to include */
-               *exclude;               /* PPD schemes to exclude */
-  const char    *cachename,            /* Cache file name */
-               *only_makes,            /* Do we only want a list of makes? */
-               *device_id,             /* ppd-device-id option */
-               *language,              /* ppd-natural-language option */
-               *make,                  /* ppd-make option */
-               *make_and_model,        /* ppd-make-and-model option */
-               *model_number_str,      /* ppd-model-number option */
-               *product,               /* ppd-product option */
-               *psversion,             /* ppd-psversion option */
-               *type_str;              /* ppd-type option */
-  int          model_number,           /* ppd-model-number value */
-               type;                   /* ppd-type value */
-  size_t       make_and_model_len,     /* Length of ppd-make-and-model */
-               product_len;            /* Length of ppd-product */
-  regex_t      *device_id_re,          /* Regular expression for matching
-                                          device ID */
-               *make_and_model_re;     /* Regular expression for matching make
-                                          and model */
-  regmatch_t   re_matches[6];          /* Regular expression matches */
-  cups_array_t *matches,               /* Matching PPDs */
-               *result;                /* Resulting PPD list */
-  ppd_list_t   ppdlist;                /* Lists of all available PPDs */
+  int          i;                      // Looping var
+  ppd_collection_t *col;               // Pointer to PPD collection
+  int          count;                  // Number of PPDs to list
+  ppd_info_t   *ppd,                   // Current PPD file
+               *newppd;                // Copy of current PPD
+  cups_file_t  *fp;                    // ppds.dat file
+  cups_array_t *include,               // PPD schemes to include
+               *exclude;               // PPD schemes to exclude
+  const char    *cachename,            // Cache file name
+               *only_makes,            // Do we only want a list of makes?
+               *device_id,             // ppd-device-id option
+               *language,              // ppd-natural-language option
+               *make,                  // ppd-make option
+               *make_and_model,        // ppd-make-and-model option
+               *model_number_str,      // ppd-model-number option
+               *product,               // ppd-product option
+               *psversion,             // ppd-psversion option
+               *type_str;              // ppd-type option
+  int          model_number,           // ppd-model-number value
+               type;                   // ppd-type value
+  size_t       make_and_model_len,     // Length of ppd-make-and-model
+               product_len;            // Length of ppd-product
+  regex_t      *device_id_re,          // Regular expression for matching
+                                       // device ID
+               *make_and_model_re;     // Regular expression for matching make
+                                       // and model
+  regmatch_t   re_matches[6];          // Regular expression matches
+  cups_array_t *matches,               // Matching PPDs
+               *result;                // Resulting PPD list
+  ppd_list_t   ppdlist;                // Lists of all available PPDs
   int          matches_array_created = 0;
 
 
- /*
-  * Initialize PPD list...
-  */
+  //
+  // Initialize PPD list...
+  //
 
   ppdlist.PPDsByName      = cupsArrayNew((cups_array_func_t)compare_names,
                                          NULL);
@@ -233,20 +233,21 @@ ppdCollectionListPPDs(
   ppdlist.ChangedPPD      = 0;
 
 
- /*
-  * See if we have a PPD database file...
-  */
+  //
+  // See if we have a PPD database file...
+  //
 
   cachename = cupsGetOption("ppd-cache", num_options, options);
   if (cachename && cachename[0] &&
-      load_ppds_dat(cachename, 1, &ppdlist, log, ld)) {
+      load_ppds_dat(cachename, 1, &ppdlist, log, ld))
+  {
     free_ppdlist(&ppdlist);
     return(NULL);
   }
 
- /*
-  * Load all PPDs in the specified directories and below...
-  */
+  //
+  // Load all PPDs in the specified directories and below...
+  //
 
   ppdlist.Inodes = cupsArrayNew((cups_array_func_t)compare_inodes, NULL);
 
@@ -258,18 +259,18 @@ ppdCollectionListPPDs(
 
   if (cachename && cachename[0])
   {
-   /*
-    * Cull PPD files that are no longer present...
-    */
+    //
+    // Cull PPD files that are no longer present...
+    //
 
     for (ppd = (ppd_info_t *)cupsArrayFirst(ppdlist.PPDsByName), i = 0;
         ppd;
         ppd = (ppd_info_t *)cupsArrayNext(ppdlist.PPDsByName), i ++)
       if (!ppd->found)
       {
-       /*
-       * Remove this PPD file from the list...
-       */
+       //
+       // Remove this PPD file from the list...
+       //
 
        cupsArrayRemove(ppdlist.PPDsByName, ppd);
        cupsArrayRemove(ppdlist.PPDsByMakeModel, ppd);
@@ -278,9 +279,9 @@ ppdCollectionListPPDs(
        ppdlist.ChangedPPD = 1;
       }
 
-   /*
-    * Write the new ppds.dat file...
-    */
+    //
+    // Write the new ppds.dat file...
+    //
 
     if (log) log(ld, CF_LOGLEVEL_DEBUG,
                 "libppd: [PPD Collections] ChangedPPD=%d",
@@ -288,13 +289,13 @@ ppdCollectionListPPDs(
 
     if (ppdlist.ChangedPPD)
     {
-      char     newname[1024];          /* New filename */
+      char     newname[1024];          // New filename
 
       snprintf(newname, sizeof(newname), "%s.%d", cachename, (int)getpid());
 
       if ((fp = cupsFileOpen(newname, "w")) != NULL)
       {
-       unsigned ppdsync = PPD_SYNC;    /* Sync word */
+       unsigned ppdsync = PPD_SYNC;    // Sync word
 
        cupsFileWrite(fp, (char *)&ppdsync, sizeof(ppdsync));
 
@@ -326,18 +327,18 @@ ppdCollectionListPPDs(
                   "libppd: [PPD Collections] No new or changed PPDs...");
   }
 
- /*
-  * Lists for inclusion and exclusion of certain PPD sources...
-  */
+  //
+  // Lists for inclusion and exclusion of certain PPD sources...
+  //
 
   exclude     = CreateStringsArray(cupsGetOption("exclude-schemes",
                                                 num_options, options));
   include     = CreateStringsArray(cupsGetOption("include-schemes",
                                                 num_options, options));
 
- /*
-  * Read further options...
-  */
+  //
+  // Read further options...
+  //
 
   only_makes       = cupsGetOption("only-makes", num_options, options);
   device_id        = cupsGetOption("device-id", num_options, options);
@@ -413,14 +414,14 @@ ppdCollectionListPPDs(
         ppd;
         ppd = (ppd_info_t *)cupsArrayNext(ppdlist.PPDsByMakeModel))
     {
-     /*
-      * Filter PPDs based on make, model, product, language, model number,
-      * and/or device ID using the "matches" score value.  An exact match
-      * for product, make-and-model, or device-id adds 3 to the score.
-      * Partial matches for make-and-model yield 1 or 2 points, and matches
-      * for the make and language add a single point.  Results are then sorted
-      * by score, highest score first.
-      */
+      //
+      // Filter PPDs based on make, model, product, language, model number,
+      // and/or device ID using the "matches" score value.  An exact match
+      // for product, make-and-model, or device-id adds 3 to the score.
+      // Partial matches for make-and-model yield 1 or 2 points, and matches
+      // for the make and language add a single point.  Results are then sorted
+      // by score, highest score first.
+      //
 
       if (ppd->record.type < PPD_TYPE_POSTSCRIPT ||
          ppd->record.type >= PPD_TYPE_DRV)
@@ -437,10 +438,10 @@ ppdCollectionListPPDs(
                    (size_t)(sizeof(re_matches) / sizeof(re_matches[0])),
                   re_matches, 0))
       {
-       /*
-        * Add the number of matching values from the device ID - it will be
-       * at least 2 (manufacturer and model), and as much as 3 (command set).
-       */
+       //
+        // Add the number of matching values from the device ID - it will be
+       // at least 2 (manufacturer and model), and as much as 3 (command set).
+       //
 
         for (i = 1; i < (int)(sizeof(re_matches) / sizeof(re_matches[0])); i ++)
          if (re_matches[i].rm_so >= 0)
@@ -493,7 +494,7 @@ ppdCollectionListPPDs(
            break;
          }
          else if (!_ppd_strncasecmp(ppd->record.products[i], product,
-                                     product_len))
+                                    product_len))
          {
            ppd->matches += 2;
            break;
@@ -537,9 +538,9 @@ ppdCollectionListPPDs(
         ppd;
         ppd = (ppd_info_t *)cupsArrayNext(ppdlist.PPDsByMakeModel))
     {
-     /*
-      * Filter PPDs based on the include/exclude lists.
-      */
+      //
+      // Filter PPDs based on the include/exclude lists.
+      //
 
       if (ppd->record.type < PPD_TYPE_POSTSCRIPT ||
          ppd->record.type >= PPD_TYPE_DRV)
@@ -561,17 +562,17 @@ ppdCollectionListPPDs(
        count > 0 && ppd;
        ppd = (ppd_info_t *)cupsArrayNext(ppdlist.PPDsByMakeModel), i ++)
   {
-   /*
-    * Skip invalid PPDs...
-    */
+    //
+    // Skip invalid PPDs...
+    //
 
     if (ppd->record.type < PPD_TYPE_POSTSCRIPT ||
         ppd->record.type >= PPD_TYPE_DRV)
       continue;
 
-   /*
-    * Output this PPD...
-    */
+    //
+    // Output this PPD...
+    //
 
     if (log) log(ld, CF_LOGLEVEL_DEBUG,
                 "libppd: [PPD Collections] Sending %s (%s)...",
@@ -588,14 +589,14 @@ ppdCollectionListPPDs(
       cupsArrayAdd(result, newppd);
     }
 
-   /*
-    * If we have only requested the make, then skip
-    * the remaining PPDs with this make...
-    */
+    //
+    // If we have only requested the make, then skip
+    // the remaining PPDs with this make...
+    //
 
     if (only_makes)
     {
-      const char       *this_make;     /* This ppd-make */
+      const char       *this_make;     // This ppd-make
 
 
       for (this_make = ppd->record.make,
@@ -617,37 +618,37 @@ ppdCollectionListPPDs(
 }
 
 
-/*
- * 'ppdCollectionGetPPD()' - Copy a PPD file to stdout.
- */
+//
+// 'ppdCollectionGetPPD()' - Copy a PPD file to stdout.
+//
 
 cups_file_t *
 ppdCollectionGetPPD(
-       const char *name,               /* I - PPD URI of the desired PPD */
-       cups_array_t *ppd_collections,  /* I - Directories to search for PPDs
-                                              in */
-       cf_logfunc_t log,               /* I - Log function */
-       void *ld)                       /* I - Aux. data for log function */
+       const char *name,               // I - PPD URI of the desired PPD
+       cups_array_t *ppd_collections,  // I - Directories to search for PPDs
+                                       //     in
+       cf_logfunc_t log,               // I - Log function
+       void *ld)                       // I - Aux. data for log function
 {
-  ppd_collection_t *col;               /* Pointer to PPD collection */
-  cups_file_t  *fp;                    /* Archive file pointer */
+  ppd_collection_t *col;               // Pointer to PPD collection
+  cups_file_t  *fp;                    // Archive file pointer
   int          fd;
-  int          cpid;                   /* Process ID for driver program */
-  int          epid;                   /* Process ID for logging process */
+  int          cpid;                   // Process ID for driver program
+  int          epid;                   // Process ID for logging process
   int          bytes;
   int           is_archive = 0;
   int           is_drv = 0;
-  char         realname[1024],         /* Scheme from PPD name */
-               buffer[8192],           /* Copy buffer */
-               tempname[1024],         /* Temp file name */
-               *ptr,                   /* Pointer into string */
+  char         realname[1024],         // Scheme from PPD name
+               buffer[8192],           // Copy buffer
+               tempname[1024],         // Temp file name
+               *ptr,                   // Pointer into string
                *ppdname,
-               ppduri[1024];           /* PPD URI */
+               ppduri[1024];           // PPD URI
 
 
- /*
-  * Figure out if this is a static or dynamic PPD file...
-  */
+  //
+  // Figure out if this is a static or dynamic PPD file...
+  //
 
   if (strstr(name, "../"))
   {
@@ -732,11 +733,11 @@ ppdCollectionGetPPD(
     return(cat_static(realname, log, ld));
   else
   {
-   /*
-    * Dynamic PPD, see if we have a driver program to support it...
-    */
+    //
+    // Dynamic PPD, see if we have a driver program to support it...
+    //
 
-    char       *argv[4];               /* Arguments for program */
+    char       *argv[4];               // Arguments for program
 
     ptr = strrchr(realname, '/');
     if (ptr == NULL)
@@ -746,9 +747,9 @@ ppdCollectionGetPPD(
     ptr = ppduri + (ptr - realname);
     if (access(realname, X_OK))
     {
-     /*
-      * File does not exist or is not executable...
-      */
+      //
+      // File does not exist or is not executable...
+      //
 
       if (log) log(ld, CF_LOGLEVEL_ERROR,
                   "libppd: [PPD Collections] Unable to access \"%s\" - %s",
@@ -757,9 +758,10 @@ ppdCollectionGetPPD(
       return(NULL);
     }
 
-   /*
-    * Yes, let it cat the PPD file...
-    */
+    //
+    // Yes, let it cat the PPD file...
+    //
+
     if (log) log(ld, CF_LOGLEVEL_DEBUG,
                 "libppd: [PPD Collections] Grabbing PPD via command: \"%s cat %s\"",
                 realname, ptr);
@@ -795,31 +797,31 @@ ppdCollectionGetPPD(
     }
   }
 
- /*
-  * Exit with no errors...
-  */
+  //
+  // Exit with no errors...
+  //
 
   return(fp);
 }
 
 
-/*
- * 'ppdCollectionDumpCache()' - Dump the contents of the ppds.dat file.
- */
+//
+// 'ppdCollectionDumpCache()' - Dump the contents of the ppds.dat file.
+//
 
 int
-ppdCollectionDumpCache(const char *filename,   /* I - Filename */
-                      cf_logfunc_t log,        /* I - Log function */
-                      void *ld)                /* I - Aux. data for log
-                                                      function */
+ppdCollectionDumpCache(const char *filename,   // I - Filename
+                      cf_logfunc_t log,        // I - Log function
+                      void *ld)                // I - Aux. data for log
+                                               //     function
 {
-  ppd_info_t   *ppd;                   /* Current PPD */
-  ppd_list_t   ppdlist;                /* Lists of all available PPDs */
+  ppd_info_t   *ppd;                   // Current PPD
+  ppd_list_t   ppdlist;                // Lists of all available PPDs
 
 
- /*
-  * Initialize PPD list...
-  */
+  //
+  // Initialize PPD list...
+  //
 
   ppdlist.Inodes = NULL;
   ppdlist.PPDsByName      = cupsArrayNew((cups_array_func_t)compare_names,
@@ -829,9 +831,9 @@ ppdCollectionDumpCache(const char *filename,        /* I - Filename */
   ppdlist.ChangedPPD      = 0;
 
 
- /*
-  * See if we a PPD database file...
-  */
+  //
+  // See if we a PPD database file...
+  //
 
   if (load_ppds_dat(filename, 0, &ppdlist, log, ld)) {
     free_ppdlist(&ppdlist);
@@ -857,34 +859,34 @@ ppdCollectionDumpCache(const char *filename,      /* I - Filename */
 }
 
 
-/*
- * 'add_ppd()' - Add a PPD file.
- */
-
-static ppd_info_t *                    /* O - PPD */
-add_ppd(const char *filename,          /* I - PPD filename */
-        const char *name,              /* I - PPD name */
-        const char *language,          /* I - LanguageVersion */
-        const char *make,              /* I - Manufacturer */
-       const char *make_and_model,     /* I - NickName/ModelName */
-       const char *device_id,          /* I - 1284DeviceID */
-       const char *product,            /* I - Product */
-       const char *psversion,          /* I - PSVersion */
-        time_t     mtime,              /* I - Modification time */
-       size_t     size,                /* I - File size */
-       int        model_number,        /* I - Model number */
-       int        type,                /* I - Driver type */
-       const char *scheme,             /* I - PPD scheme */
+//
+// 'add_ppd()' - Add a PPD file.
+//
+
+static ppd_info_t *                    // O - PPD
+add_ppd(const char *filename,          // I - PPD filename
+        const char *name,              // I - PPD name
+        const char *language,          // I - LanguageVersion
+        const char *make,              // I - Manufacturer
+       const char *make_and_model,     // I - NickName/ModelName
+       const char *device_id,          // I - 1284DeviceID
+       const char *product,            // I - Product
+       const char *psversion,          // I - PSVersion
+        time_t     mtime,              // I - Modification time
+       size_t     size,                // I - File size
+       int        model_number,        // I - Model number
+       int        type,                // I - Driver type
+       const char *scheme,             // I - PPD scheme
        ppd_list_t *ppdlist,
-       cf_logfunc_t log,               /* I - Log function */
-       void *ld)                       /* I - Aux. data for log function */
+       cf_logfunc_t log,               // I - Log function
+       void *ld)                       // I - Aux. data for log function
 {
-  ppd_info_t   *ppd;                   /* PPD */
+  ppd_info_t   *ppd;                   // PPD
 
 
- /*
-  * Add a new PPD file...
-  */
+  //
+  // Add a new PPD file...
+  //
 
   if ((ppd = (ppd_info_t *)calloc(1, sizeof(ppd_info_t))) == NULL)
   {
@@ -895,9 +897,9 @@ add_ppd(const char *filename,               /* I - PPD filename */
     return (NULL);
   }
 
- /*
-  * Zero-out the PPD data and copy the values over...
-  */
+  //
+  // Zero-out the PPD data and copy the values over...
+  //
 
   ppd->found               = 1;
   ppd->record.mtime        = mtime;
@@ -918,30 +920,30 @@ add_ppd(const char *filename,             /* I - PPD filename */
   strlcpy(ppd->record.device_id, device_id, sizeof(ppd->record.device_id));
   strlcpy(ppd->record.scheme, scheme, sizeof(ppd->record.scheme));
 
- /*
-  * Add the PPD to the PPD arrays...
-  */
+  //
+  // Add the PPD to the PPD arrays...
+  //
 
   cupsArrayAdd(ppdlist->PPDsByName, ppd);
   cupsArrayAdd(ppdlist->PPDsByMakeModel, ppd);
 
- /*
-  * Return the new PPD pointer...
-  */
+  //
+  // Return the new PPD pointer...
+  //
 
   return (ppd);
 }
 
 
-/*
- * 'cat_drv()' - Generate a PPD from a driver info file.
- */
+//
+// 'cat_drv()' - Generate a PPD from a driver info file.
+//
 
-static cups_file_t *                   /* O - Pointer to PPD file */
-cat_drv(const char *filename,          /* I - *.drv file name */
-       char *ppdname,                  /* I - PPD name in the *.drv file */
-       cf_logfunc_t log,               /* I - Log function */
-       void *ld)                       /* I - Aux. data for log function */
+static cups_file_t *                   // O - Pointer to PPD file
+cat_drv(const char *filename,          // I - *.drv file name
+       char *ppdname,                  // I - PPD name in the *.drv file
+       cf_logfunc_t log,               // I - Log function
+       void *ld)                       // I - Aux. data for log function
 {
   cups_file_t  *fp;                    // File pointer
   int          fd;
@@ -960,8 +962,8 @@ cat_drv(const char *filename,               /* I - *.drv file name */
     return (NULL);
   }
 
-  /* Eliminate any output to stderr, to get rid of the error messages of
-     the *.drv file parser */
+  // Eliminate any output to stderr, to get rid of the error messages of
+  // the *.drv file parser
   fd1 = dup(2);
   fd2 = open("/dev/null", O_WRONLY);
   dup2(fd2, 2);
@@ -1024,7 +1026,7 @@ cat_drv(const char *filename,             /* I - *.drv file name */
   src->release();
   cupsFileClose(fp);
 
-  /* Re-activate stderr output */
+  // Re-activate stderr output
   dup2(fd1, 2);
   close(fd1);
 
@@ -1032,14 +1034,14 @@ cat_drv(const char *filename,           /* I - *.drv file name */
 }
 
 
-/*
- * 'cat_static()' - Return pointer to static PPD file
- */
+//
+// 'cat_static()' - Return pointer to static PPD file
+//
 
-static cups_file_t *                   /* O - Pointer to PPD file */
-cat_static(const char *name,           /* I - PPD name */
-          cf_logfunc_t log,    /* I - Log function */
-          void *ld)                    /* I - Aux. data for log function */
+static cups_file_t *                   // O - Pointer to PPD file
+cat_static(const char *name,           // I - PPD name
+          cf_logfunc_t log,            // I - Log function
+          void *ld)                    // I - Aux. data for log function
 {
   cups_file_t  *fp;
 
@@ -1056,30 +1058,30 @@ cat_static(const char *name,            /* I - PPD name */
 }
 
 
-/*
- * 'cat_tar()' - Copy an archived PPD file to temp file.
- */
+//
+// 'cat_tar()' - Copy an archived PPD file to temp file.
+//
 
-static cups_file_t *                   /* O - Pointer to PPD file */
-cat_tar(const char *filename,          /* I - Archive name */
-       char *ppdname,                  /* I - PPD name in the archive */
-       cf_logfunc_t log,               /* I - Log function */
-       void *ld)                       /* I - Aux. data for log function */
+static cups_file_t *                   // O - Pointer to PPD file
+cat_tar(const char *filename,          // I - Archive name
+       char *ppdname,                  // I - PPD name in the archive
+       cf_logfunc_t log,               // I - Log function
+       void *ld)                       // I - Aux. data for log function
 {
-  cups_file_t  *fp;                    /* Archive file pointer */
+  cups_file_t  *fp;                    // Archive file pointer
   int          fd;
-  char         tempname[1024],         /* Name for the temporary file */
-               curname[256],           /* Current name in archive */
-               buffer[8192];           /* Copy buffer */
-  struct stat  curinfo;                /* Current file info in archive */
-  off_t                total,                  /* Total bytes copied */
-               next;                   /* Offset for next record in archive */
-  ssize_t      bytes;                  /* Bytes read */
+  char         tempname[1024],         // Name for the temporary file
+               curname[256],           // Current name in archive
+               buffer[8192];           // Copy buffer
+  struct stat  curinfo;                // Current file info in archive
+  off_t                total,                  // Total bytes copied
+               next;                   // Offset for next record in archive
+  ssize_t      bytes;                  // Bytes read
 
 
- /*
-  * Open the archive file...
-  */
+  //
+  // Open the archive file...
+  //
 
   if ((fp = cupsFileOpen(filename, "r")) == NULL)
   {
@@ -1090,9 +1092,9 @@ cat_tar(const char *filename,             /* I - Archive name */
     return (NULL);
   }
 
- /*
-  * Scan the archive for the PPD...
-  */
+  //
+  // Scan the archive for the PPD...
+  //
 
   while (read_tar(fp, curname, sizeof(curname), &curinfo, log, ld))
   {
@@ -1117,9 +1119,7 @@ cat_tar(const char *filename,             /* I - Archive name */
         if ((bytes = cupsFileRead(fp, buffer, (size_t)bytes)) < 0)
         {
           if (errno == EINTR || errno == EAGAIN)
-          {
             bytes = 0;
-          }
           else
           {
            if (log) log(ld, CF_LOGLEVEL_ERROR,
@@ -1164,13 +1164,13 @@ cat_tar(const char *filename,           /* I - Archive name */
 }
 
 
-/*
- * 'compare_inodes()' - Compare two inodes.
- */
+//
+// 'compare_inodes()' - Compare two inodes.
+//
 
-static int                             /* O - Result of comparison */
-compare_inodes(struct stat *a,         /* I - First inode */
-               struct stat *b)         /* I - Second inode */
+static int                             // O - Result of comparison
+compare_inodes(struct stat *a,         // I - First inode
+               struct stat *b)         // I - Second inode
 {
   if (a->st_dev != b->st_dev)
     return (a->st_dev - b->st_dev);
@@ -1179,13 +1179,13 @@ compare_inodes(struct stat *a,          /* I - First inode */
 }
 
 
-/*
- * 'compare_matches()' - Compare PPD match scores for sorting.
- */
+//
+// 'compare_matches()' - Compare PPD match scores for sorting.
+//
 
 static int
-compare_matches(const ppd_info_t *p0,  /* I - First PPD */
-                const ppd_info_t *p1)  /* I - Second PPD */
+compare_matches(const ppd_info_t *p0,  // I - First PPD
+                const ppd_info_t *p1)  // I - Second PPD
 {
   if (p1->matches != p0->matches)
     return (p1->matches - p0->matches);
@@ -1195,15 +1195,15 @@ compare_matches(const ppd_info_t *p0,   /* I - First PPD */
 }
 
 
-/*
- * 'compare_names()' - Compare PPD filenames for sorting.
- */
+//
+// 'compare_names()' - Compare PPD filenames for sorting.
+//
 
-static int                             /* O - Result of comparison */
-compare_names(const ppd_info_t *p0,    /* I - First PPD file */
-              const ppd_info_t *p1)    /* I - Second PPD file */
+static int                             // O - Result of comparison
+compare_names(const ppd_info_t *p0,    // I - First PPD file
+              const ppd_info_t *p1)    // I - Second PPD file
 {
-  int  diff;                           /* Difference between strings */
+  int  diff;                           // Difference between strings
 
 
   if ((diff = strcmp(p0->record.filename, p1->record.filename)) != 0)
@@ -1213,20 +1213,20 @@ compare_names(const ppd_info_t *p0,     /* I - First PPD file */
 }
 
 
-/*
- * 'compare_ppds()' - Compare PPD file make and model names for sorting.
- */
+//
+// 'compare_ppds()' - Compare PPD file make and model names for sorting.
+//
 
-static int                             /* O - Result of comparison */
-compare_ppds(const ppd_info_t *p0,     /* I - First PPD file */
-             const ppd_info_t *p1)     /* I - Second PPD file */
+static int                             // O - Result of comparison
+compare_ppds(const ppd_info_t *p0,     // I - First PPD file
+             const ppd_info_t *p1)     // I - Second PPD file
 {
-  int  diff;                           /* Difference between strings */
+  int  diff;                           // Difference between strings
 
 
- /*
-  * First compare manufacturers...
-  */
+  //
+  // First compare manufacturers...
+  //
 
   if ((diff = _ppd_strcasecmp(p0->record.make, p1->record.make)) != 0)
     return (diff);
@@ -1241,14 +1241,14 @@ compare_ppds(const ppd_info_t *p0,      /* I - First PPD file */
 }
 
 
-/*
- * 'free_array()' - Free an array of strings.
- */
+//
+// 'free_array()' - Free an array of strings.
+//
 
 static void
-free_array(cups_array_t *a)            /* I - Array to free */
+free_array(cups_array_t *a)            // I - Array to free
 {
-  char *ptr;                           /* Pointer to string */
+  char *ptr;                           // Pointer to string
 
 
   for (ptr = (char *)cupsArrayFirst(a);
@@ -1260,15 +1260,15 @@ free_array(cups_array_t *a)             /* I - Array to free */
 }
 
 
-/*
- * 'free_ppdlist()' - Free the PPD list arrays.
- */
+//
+// 'free_ppdlist()' - Free the PPD list arrays.
+//
 
 static void
-free_ppdlist(ppd_list_t *ppdlist)      /* I - PPD list to free */
+free_ppdlist(ppd_list_t *ppdlist)      // I - PPD list to free
 {
-  struct stat  *dinfoptr;              /* Pointer to Inode info */
-  ppd_info_t   *ppd;                   /* Pointer to PPD info */
+  struct stat  *dinfoptr;              // Pointer to Inode info
+  ppd_info_t   *ppd;                   // Pointer to PPD info
 
 
   for (dinfoptr = (struct stat *)cupsArrayFirst(ppdlist->Inodes);
@@ -1286,41 +1286,41 @@ free_ppdlist(ppd_list_t *ppdlist)       /* I - PPD list to free */
 }
 
 
-/*
- * 'load_driver()' - Load driver-generated PPD files.
- */
+//
+// 'load_driver()' - Load driver-generated PPD files.
+//
 
-static int                             /* O - 1 on success, 0 on failure */
-load_driver(const char *filename,      /* I - Driver excutable file name */
-           const char *name,           /* I - Name to the rest of the world */
+static int                             // O - 1 on success, 0 on failure
+load_driver(const char *filename,      // I - Driver excutable file name
+           const char *name,           // I - Name to the rest of the world
            ppd_list_t *ppdlist,
-           cf_logfunc_t log,   /* I - Log function */
-           void *ld)                   /* I - Aux. data for log function */
+           cf_logfunc_t log,           // I - Log function
+           void *ld)                   // I - Aux. data for log function
 {
-  int          i;                      /* Looping var */
-  char         *start,                 /* Start of value */
-               *ptr;                   /* Pointer into string */
-  const char   *scheme = NULL;         /* Scheme for this driver */
-  int          cpid;                   /* Process ID for driver program */
-  int          epid;                   /* Process ID for logging process */
-  cups_file_t  *fp;                    /* Pipe to driver program */
-  char         *argv[3],               /* Arguments for command */
-               line[2048],             /* Line from driver */
-               ppd_name[256],          /* ppd-name */
-               make[128],              /* ppd-make */
-               make_and_model[128],    /* ppd-make-and-model */
-               device_id[256],         /* ppd-device-id */
-               languages[128],         /* ppd-natural-language */
-               product[128],           /* ppd-product */
-               psversion[128],         /* ppd-psversion */
-               type_str[128];          /* ppd-type */
-  int          type;                   /* PPD type */
-  ppd_info_t   *ppd;                   /* Newly added PPD */
-
-
- /*
-  * Run the driver with the "list" argument and collect the output...
-  */
+  int          i;                      // Looping var
+  char         *start,                 // Start of value
+               *ptr;                   // Pointer into string
+  const char   *scheme = NULL;         // Scheme for this driver
+  int          cpid;                   // Process ID for driver program
+  int          epid;                   // Process ID for logging process
+  cups_file_t  *fp;                    // Pipe to driver program
+  char         *argv[3],               // Arguments for command
+               line[2048],             // Line from driver
+               ppd_name[256],          // ppd-name
+               make[128],              // ppd-make
+               make_and_model[128],    // ppd-make-and-model
+               device_id[256],         // ppd-device-id
+               languages[128],         // ppd-natural-language
+               product[128],           // ppd-product
+               psversion[128],         // ppd-psversion
+               type_str[128];          // ppd-type
+  int          type;                   // PPD type
+  ppd_info_t   *ppd;                   // Newly added PPD
+
+
+  //
+  // Run the driver with the "list" argument and collect the output...
+  //
 
   argv[0] = (char *)filename;
   argv[1] = (char *)"list";
@@ -1330,12 +1330,12 @@ load_driver(const char *filename,       /* I - Driver excutable file name */
   {
     while (cupsFileGets(fp, line, sizeof(line)))
     {
-     /*
-      * Each line is of the form:
-      *
-      *   "ppd-name" ppd-natural-language "ppd-make" "ppd-make-and-model" \
-      *       "ppd-device-id" "ppd-product" "ppd-psversion"
-      */
+      //
+      // Each line is of the form:
+      //
+      //   "ppd-name" ppd-natural-language "ppd-make" "ppd-make-and-model"
+      //       "ppd-device-id" "ppd-product" "ppd-psversion"
+      //
 
       device_id[0] = '\0';
       product[0]   = '\0';
@@ -1349,9 +1349,9 @@ load_driver(const char *filename, /* I - Driver excutable file name */
                 ppd_name, languages, make, make_and_model,
                 device_id, product, psversion, type_str) < 4)
       {
-       /*
-       * Bad format; strip trailing newline and write an error message.
-       */
+       //
+       // Bad format; strip trailing newline and write an error message.
+       //
 
        if (line[strlen(line) - 1] == '\n')
          line[strlen(line) - 1] = '\0';
@@ -1363,9 +1363,9 @@ load_driver(const char *filename, /* I - Driver excutable file name */
       }
       else
       {
-       /*
-       * Add the device to the array of available devices...
-       */
+       //
+       // Add the device to the array of available devices...
+       //
 
        if ((start = strchr(languages, ',')) != NULL)
          *start++ = '\0';
@@ -1392,8 +1392,9 @@ load_driver(const char *filename, /* I - Driver excutable file name */
          scheme ++;
          memmove(ppd_name + strlen(name), ptr, strlen(ptr) + 1);
          memmove(ppd_name, name, strlen(name));
-       } else if (strncmp(name, ppd_name, strlen(name)) ||
-                  *(ppd_name + strlen(name)) != ':')
+       }
+       else if (strncmp(name, ppd_name, strlen(name)) ||
+                *(ppd_name + strlen(name)) != ':')
        {
          cupsFileClose(fp);
          return (0);
@@ -1445,19 +1446,19 @@ load_driver(const char *filename,       /* I - Driver excutable file name */
 }
 
 
-/*
- * 'load_drv()' - Load the PPDs from a driver information file.
- */
+//
+// 'load_drv()' - Load the PPDs from a driver information file.
+//
 
-static int                             /* O - 1 on success, 0 on failure */
-load_drv(const char  *filename,                /* I - Actual filename */
-         const char  *name,            /* I - Name to the rest of the world */
-         cups_file_t *fp,              /* I - File to read from */
-        time_t      mtime,             /* I - Mod time of driver info file */
-        off_t       size,              /* I - Size of driver info file */
+static int                             // O - 1 on success, 0 on failure
+load_drv(const char  *filename,                // I - Actual filename
+         const char  *name,            // I - Name to the rest of the world
+         cups_file_t *fp,              // I - File to read from
+        time_t      mtime,             // I - Mod time of driver info file
+        off_t       size,              // I - Size of driver info file
         ppd_list_t  *ppdlist,
-        cf_logfunc_t log,              /* I - Log function */
-        void *ld)                      /* I - Aux. data for log function */
+        cf_logfunc_t log,              // I - Log function
+        void *ld)                      // I - Aux. data for log function
 {
   ppdcSource   *src;                   // Driver information file
   ppdcDriver   *d;                     // Current driver
@@ -1475,19 +1476,19 @@ load_drv(const char  *filename,         /* I - Actual filename */
   int           fd1, fd2;
 
 
- /*
-  * Eliminate any output to stderr, to get rid of the error messages of
-  * the *.drv file parser
-  */
+  //
+  // Eliminate any output to stderr, to get rid of the error messages of
+  // the *.drv file parser
+  //
 
   fd1 = dup(2);
   fd2 = open("/dev/null", O_WRONLY);
   dup2(fd2, 2);
   close(fd2);
 
- /*
-  * Load the driver info file...
-  */
+  //
+  // Load the driver info file...
+  //
 
   src = new ppdcSource(filename, fp);
 
@@ -1497,22 +1498,22 @@ load_drv(const char  *filename,         /* I - Actual filename */
                 "libppd: [PPD Collections] Bad driver information file \"%s\"!\n",
                 filename);
     src->release();
-    /* Re-activate stderr output */
+    // Re-activate stderr output
     dup2(fd1, 2);
     close(fd1);
     return (0);
   }
 
- /*
-  * Add a dummy entry for the file...
-  */
+  //
+  // Add a dummy entry for the file...
+  //
 
   add_ppd(filename, name, "", "", "", "", "", "", mtime, (size_t)size, 0,
          PPD_TYPE_DRV, "drv", ppdlist, log, ld);
 
- /*
-  * Then the drivers in the file...
-  */
+  //
+  // Then the drivers in the file...
+  //
 
   for (d = (ppdcDriver *)src->drivers->first();
        d;
@@ -1558,7 +1559,7 @@ load_drv(const char  *filename,           /* I - Actual filename */
     }
 
     for (product = (ppdcAttr *)d->attrs->first(), products_found = 0,
-             ppd = NULL;
+          ppd = NULL;
          product;
         product = (ppdcAttr *)d->attrs->next())
       if (!strcmp(product->name->value, "Product"))
@@ -1588,9 +1589,9 @@ load_drv(const char  *filename,           /* I - Actual filename */
 
   src->release();
 
- /*
-  * Re-activate stderr output
-  */
+  //
+  // Re-activate stderr output
+  //
 
   dup2(fd1, 2);
   close(fd1);
@@ -1599,47 +1600,47 @@ load_drv(const char  *filename,         /* I - Actual filename */
 }
 
 
-/*
- * 'load_ppd()' - Load a PPD file.
- */
+//
+// 'load_ppd()' - Load a PPD file.
+//
 
 static void
-load_ppd(const char  *filename,                /* I - Real filename */
-         const char  *name,            /* I - Virtual filename */
-         const char  *scheme,          /* I - PPD scheme */
-         struct stat *fileinfo,                /* I - File information */
-         ppd_info_t  *ppd,             /* I - Existing PPD file or NULL */
-         cups_file_t *fp,              /* I - File to read from */
-         off_t       end,              /* I - End of file position or 0 */
+load_ppd(const char  *filename,                // I - Real filename
+         const char  *name,            // I - Virtual filename
+         const char  *scheme,          // I - PPD scheme
+         struct stat *fileinfo,                // I - File information
+         ppd_info_t  *ppd,             // I - Existing PPD file or NULL
+         cups_file_t *fp,              // I - File to read from
+         off_t       end,              // I - End of file position or 0
         ppd_list_t  *ppdlist,
-        cf_logfunc_t log,              /* I - Log function */
-        void *ld)                      /* I - Aux. data for log function */
+        cf_logfunc_t log,              // I - Log function
+        void *ld)                      // I - Aux. data for log function
 {
-  int          i;                      /* Looping var */
-  char         line[256],              /* Line from file */
-               *ptr,                   /* Pointer into line */
-               lang_version[64],       /* PPD LanguageVersion */
-               lang_encoding[64],      /* PPD LanguageEncoding */
-               country[64],            /* Country code */
-               manufacturer[256],      /* Manufacturer */
-               make_model[256],        /* Make and Model */
-               model_name[256],        /* ModelName */
-               nick_name[256],         /* NickName */
-               device_id[256],         /* 1284DeviceID */
-               product[256],           /* Product */
-               psversion[256],         /* PSVersion */
-               temp[512];              /* Temporary make and model */
-  int          install_group,          /* In the installable options group? */
-               model_number,           /* cupsModelNumber */
-               type;                   /* ppd-type */
-  cups_array_t *products,              /* Product array */
-               *psversions,            /* PSVersion array */
-               *cups_languages;        /* cupsLanguages array */
-  int          new_ppd;                /* Is this a new PPD? */
-  struct                               /* LanguageVersion translation table */
+  int          i;                      // Looping var
+  char         line[256],              // Line from file
+               *ptr,                   // Pointer into line
+               lang_version[64],       // PPD LanguageVersion
+               lang_encoding[64],      // PPD LanguageEncoding
+               country[64],            // Country code
+               manufacturer[256],      // Manufacturer
+               make_model[256],        // Make and Model
+               model_name[256],        // ModelName
+               nick_name[256],         // NickName
+               device_id[256],         // 1284DeviceID
+               product[256],           // Product
+               psversion[256],         // PSVersion
+               temp[512];              // Temporary make and model
+  int          install_group,          // In the installable options group?
+               model_number,           // cupsModelNumber
+               type;                   // ppd-type
+  cups_array_t *products,              // Product array
+               *psversions,            // PSVersion array
+               *cups_languages;        // cupsLanguages array
+  int          new_ppd;                // Is this a new PPD?
+  struct                               // LanguageVersion translation table
   {
-    const char *version,               /* LanguageVersion string */
-               *language;              /* Language code */
+    const char *version,               // LanguageVersion string
+               *language;              // Language code
   }            languages[] =
   {
     { "chinese",               "zh" },
@@ -1668,9 +1669,9 @@ load_ppd(const char  *filename,           /* I - Real filename */
   };
 
 
- /*
-  * Now read until we get the required fields...
-  */
+  //
+  // Now read until we get the required fields...
+  //
 
   cups_languages = cupsArrayNew(NULL, NULL);
   products       = cupsArrayNew(NULL, NULL);
@@ -1711,19 +1712,19 @@ load_ppd(const char  *filename,         /* I - Real filename */
     {
       if (sscanf(line, "%*[^\"]\"(%255[^\"]", product) == 1)
       {
-       /*
-       * Make sure the value ends with a right parenthesis - can't stop at
-       * the first right paren since the product name may contain escaped
-       * parenthesis...
-       */
+       //
+       // Make sure the value ends with a right parenthesis - can't stop at
+       // the first right paren since the product name may contain escaped
+       // parenthesis...
+       //
 
        ptr = product + strlen(product) - 1;
        if (ptr > product && *ptr == ')')
        {
-        /*
-         * Yes, ends with a parenthesis, so remove it from the end and
-         * add the product to the list...
-         */
+         //
+         // Yes, ends with a parenthesis, so remove it from the end and
+         // add the product to the list...
+         //
 
          *ptr = '\0';
          cupsArrayAdd(products, strdup(product));
@@ -1737,7 +1738,7 @@ load_ppd(const char  *filename,           /* I - Real filename */
     }
     else if (!strncmp(line, "*cupsLanguages:", 15))
     {
-      char     *start;                 /* Start of language */
+      char     *start;                 // Start of language
 
 
       for (start = line + 15; *start && isspace(*start & 255); start ++);
@@ -1787,10 +1788,10 @@ load_ppd(const char  *filename,         /* I - Real filename */
       install_group = 0;
     else if (!strncmp(line, "*OpenUI", 7))
     {
-     /*
-      * Stop early if we have a NickName or ModelName attributes
-      * before the first non-installable OpenUI...
-      */
+      //
+      // Stop early if we have a NickName or ModelName attributes
+      // before the first non-installable OpenUI...
+      //
 
       if (!install_group && (model_name[0] || nick_name[0]) &&
          cupsArrayCount(products) > 0 && cupsArrayCount(psversions) > 0)
@@ -1798,9 +1799,9 @@ load_ppd(const char  *filename,           /* I - Real filename */
     }
   }
 
- /*
-  * See if we got all of the required info...
-  */
+  //
+  // See if we got all of the required info...
+  //
 
   if (nick_name[0])
     cupsCharsetToUTF8((cups_utf8_t *)make_model, nick_name,
@@ -1814,9 +1815,9 @@ load_ppd(const char  *filename,           /* I - Real filename */
   if (!make_model[0] || cupsArrayCount(products) == 0 ||
       cupsArrayCount(psversions) == 0)
   {
-   /*
-    * We don't have all the info needed, so skip this file...
-    */
+    //
+    // We don't have all the info needed, so skip this file...
+    //
 
     if (!make_model[0])
       if (log) log(ld, CF_LOGLEVEL_WARN,
@@ -1844,9 +1845,9 @@ load_ppd(const char  *filename,           /* I - Real filename */
   if (model_name[0])
     cupsArrayAdd(products, strdup(model_name));
 
- /*
-  * Normalize the make and model string...
-  */
+  //
+  // Normalize the make and model string...
+  //
 
   while (isspace(manufacturer[0] & 255))
     _ppd_strcpy(manufacturer, manufacturer + 1);
@@ -1858,22 +1859,22 @@ load_ppd(const char  *filename,         /* I - Real filename */
 
   ppdNormalizeMakeAndModel(temp, make_model, sizeof(make_model));
 
- /*
-  * See if we got a manufacturer...
-  */
+  //
+  // See if we got a manufacturer...
+  //
 
   if (!manufacturer[0] || !strcmp(manufacturer, "ESP"))
   {
-   /*
-    * Nope, copy the first part of the make and model then...
-    */
+    //
+    // Nope, copy the first part of the make and model then...
+    //
 
     strlcpy(manufacturer, make_model, sizeof(manufacturer));
 
-   /*
-    * Truncate at the first space, dash, or slash, or make the
-    * manufacturer "Other"...
-    */
+    //
+    // Truncate at the first space, dash, or slash, or make the
+    // manufacturer "Other"...
+    //
 
     for (ptr = manufacturer; *ptr; ptr ++)
       if (*ptr == ' ' || *ptr == '-' || *ptr == '/')
@@ -1890,9 +1891,9 @@ load_ppd(const char  *filename,           /* I - Real filename */
   else if (!_ppd_strncasecmp(manufacturer, "Hewlett", 7))
     strlcpy(manufacturer, "HP", sizeof(manufacturer));
 
- /*
-  * Fix the lang_version as needed...
-  */
+  //
+  // Fix the lang_version as needed...
+  //
 
   if ((ptr = strchr(lang_version, '-')) != NULL)
     *ptr++ = '\0';
@@ -1901,18 +1902,18 @@ load_ppd(const char  *filename,         /* I - Real filename */
 
   if (ptr)
   {
-   /*
-    * Setup the country suffix...
-    */
+    //
+    // Setup the country suffix...
+    //
 
     country[0] = '_';
     _ppd_strcpy(country + 1, ptr);
   }
   else
   {
-   /*
-    * No country suffix...
-    */
+    //
+    // No country suffix...
+    //
 
     country[0] = '\0';
   }
@@ -1923,33 +1924,33 @@ load_ppd(const char  *filename,         /* I - Real filename */
 
   if (i < (int)(sizeof(languages) / sizeof(languages[0])))
   {
-   /*
-    * Found a known language...
-    */
+    //
+    // Found a known language...
+    //
 
     snprintf(lang_version, sizeof(lang_version), "%s%s",
             languages[i].language, country);
   }
   else
   {
-   /*
-    * Unknown language; use "xx"...
-    */
+    //
+    // Unknown language; use "xx"...
+    //
 
     strlcpy(lang_version, "xx", sizeof(lang_version));
   }
 
- /*
-  * Record the PPD file...
-  */
+  //
+  // Record the PPD file...
+  //
 
   new_ppd = !ppd;
 
   if (new_ppd)
   {
-   /*
-    * Add new PPD file...
-    */
+    //
+    // Add new PPD file...
+    //
 
     if (log) log(ld, CF_LOGLEVEL_DEBUG,
                 "libppd: [PPD Collections] Adding PPD \"%s\"...", name);
@@ -1965,9 +1966,9 @@ load_ppd(const char  *filename,           /* I - Real filename */
   }
   else
   {
-   /*
-    * Update existing record...
-    */
+    //
+    // Update existing record...
+    //
 
     if (log) log(ld, CF_LOGLEVEL_DEBUG,
                 "libppd: [PPD Collections] Updating ppd \"%s\"...", name);
@@ -1995,9 +1996,9 @@ load_ppd(const char  *filename,           /* I - Real filename */
     strlcpy(ppd->record.scheme, scheme, sizeof(ppd->record.scheme));
   }
 
- /*
-  * Add remaining products, versions, and languages...
-  */
+  //
+  // Add remaining products, versions, and languages...
+  //
 
   for (i = 1;
        i < PPD_MAX_PROD && (ptr = (char *)cupsArrayNext(products)) != NULL;
@@ -2017,9 +2018,9 @@ load_ppd(const char  *filename,           /* I - Real filename */
     strlcpy(ppd->record.languages[i], ptr,
            sizeof(ppd->record.languages[0]));
 
- /*
-  * Free products, versions, and languages...
-  */
+  //
+  // Free products, versions, and languages...
+  //
 
   free_array(cups_languages);
   free_array(products);
@@ -2029,34 +2030,34 @@ load_ppd(const char  *filename,         /* I - Real filename */
 }
 
 
-/*
- * 'load_ppds()' - Load PPD files recursively.
- */
+//
+// 'load_ppds()' - Load PPD files recursively.
+//
 
-static int                             /* O - 1 on success, 0 on failure */
-load_ppds(const char *d,               /* I - Actual directory */
-          const char *p,               /* I - Virtual path in name */
-         int        descend,           /* I - Descend into directories? */
+static int                             // O - 1 on success, 0 on failure
+load_ppds(const char *d,               // I - Actual directory
+          const char *p,               // I - Virtual path in name
+         int        descend,           // I - Descend into directories?
          ppd_list_t *ppdlist,
-         cf_logfunc_t log,             /* I - Log function */
-         void *ld)                     /* I - Aux. data for log function */
+         cf_logfunc_t log,             // I - Log function
+         void *ld)                     // I - Aux. data for log function
 {
-  struct stat  dinfo,                  /* Directory information */
-               *dinfoptr;              /* Pointer to match */
-  cups_file_t  *fp;                    /* Pointer to file */
-  cups_dir_t   *dir;                   /* Directory pointer */
-  cups_dentry_t        *dent;                  /* Directory entry */
-  char         filename[1024],         /* Name of PPD or directory */
-               line[256],              /* Line from file */
-               *ptr,                   /* Pointer into name */
-               name[1024];             /* Name of PPD file */
-  ppd_info_t   *ppd,                   /* New PPD file */
-               key;                    /* Search key */
-
-
- /*
-  * See if we've loaded this directory before...
-  */
+  struct stat  dinfo,                  // Directory information
+               *dinfoptr;              // Pointer to match
+  cups_file_t  *fp;                    // Pointer to file
+  cups_dir_t   *dir;                   // Directory pointer
+  cups_dentry_t        *dent;                  // Directory entry
+  char         filename[1024],         // Name of PPD or directory
+               line[256],              // Line from file
+               *ptr,                   // Pointer into name
+               name[1024];             // Name of PPD file
+  ppd_info_t   *ppd,                   // New PPD file
+               key;                    // Search key
+
+
+  //
+  // See if we've loaded this directory before...
+  //
 
   if (stat(d, &dinfo))
   {
@@ -2075,17 +2076,17 @@ load_ppds(const char *d,                /* I - Actual directory */
     return (1);
   }
 
- /*
-  * Nope, add it to the Inodes array and continue...
-  */
+  //
+  // Nope, add it to the Inodes array and continue...
+  //
 
   dinfoptr = (struct stat *)malloc(sizeof(struct stat));
   memcpy(dinfoptr, &dinfo, sizeof(struct stat));
   cupsArrayAdd(ppdlist->Inodes, dinfoptr);
 
- /*
-  * Check permissions...
-  */
+  //
+  // Check permissions...
+  //
 
   //if (_ppdFileCheck(d, _PPD_FILE_CHECK_DIRECTORY, !geteuid(), log, ld))
   //  return (0);
@@ -2106,16 +2107,16 @@ load_ppds(const char *d,                /* I - Actual directory */
 
   while ((dent = cupsDirRead(dir)) != NULL)
   {
-   /*
-    * Skip files/directories starting with "."...
-    */
+    //
+    // Skip files/directories starting with "."...
+    //
 
     if (dent->filename[0] == '.')
       continue;
 
-   /*
-    * See if this is a file...
-    */
+    //
+    // See if this is a file...
+    //
 
     if (!strcmp(d, "/"))
       snprintf(filename, sizeof(filename), "/%s", dent->filename);
@@ -2131,9 +2132,9 @@ load_ppds(const char *d,          /* I - Actual directory */
 
     if (S_ISDIR(dent->fileinfo.st_mode))
     {
-     /*
-      * Do subdirectory...
-      */
+      //
+      // Do subdirectory...
+      //
 
       if (descend)
       {
@@ -2148,9 +2149,9 @@ load_ppds(const char *d,          /* I - Actual directory */
     }
     else if (strstr(filename, ".plist"))
     {
-     /*
-      * Skip plist files in the PPDs directory...
-      */
+      //
+      // Skip plist files in the PPDs directory...
+      //
 
       continue;
     }
@@ -2158,9 +2159,9 @@ load_ppds(const char *d,          /* I - Actual directory */
     //                    log, ld))
     //   continue;
 
-   /*
-    * See if this file has been scanned before...
-    */
+    //
+    // See if this file has been scanned before...
+    //
 
     strlcpy(key.record.filename, filename, sizeof(key.record.filename));
     strlcpy(key.record.name, name, sizeof(key.record.name));
@@ -2171,16 +2172,16 @@ load_ppds(const char *d,                /* I - Actual directory */
        ppd->record.size == dent->fileinfo.st_size &&
        ppd->record.mtime == dent->fileinfo.st_mtime)
     {
-     /*
-      * Rewind to the first entry for this file...
-      */
+      //
+      // Rewind to the first entry for this file...
+      //
 
       while ((ppd = (ppd_info_t *)cupsArrayPrev(ppdlist->PPDsByName)) != NULL &&
             !strcmp(ppd->record.filename, filename));
 
-     /*
-      * Then mark all of the matches for this file as found...
-      */
+      //
+      // Then mark all of the matches for this file as found...
+      //
 
       while ((ppd = (ppd_info_t *)cupsArrayNext(ppdlist->PPDsByName)) != NULL &&
             !strcmp(ppd->record.filename, filename))
@@ -2189,35 +2190,35 @@ load_ppds(const char *d,                /* I - Actual directory */
       continue;
     }
 
-   /*
-    * No, file is new/changed, so re-scan it...
-    */
+    //
+    // No, file is new/changed, so re-scan it...
+    //
 
     if ((fp = cupsFileOpen(filename, "r")) == NULL)
       continue;
 
-   /*
-    * Now see if this is a PPD file...
-    */
+    //
+    // Now see if this is a PPD file...
+    //
 
     line[0] = '\0';
     cupsFileGets(fp, line, sizeof(line));
 
     if (!strncmp(line, "*PPD-Adobe:", 11))
     {
-     /*
-      * Yes, load it...
-      */
+      //
+      // Yes, load it...
+      //
 
       load_ppd(filename, name, "file", &dent->fileinfo, ppd, fp, 0, ppdlist,
               log, ld);
     }
     else
     {
-     /*
-      * Nope, treat it as a an archive, a PPD-generating executable, or a
-      * driver information file...
-      */
+      //
+      // Nope, treat it as a an archive, a PPD-generating executable, or a
+      // driver information file...
+      //
 
       cupsFileRewind(fp);
 
@@ -2231,15 +2232,15 @@ load_ppds(const char *d,                /* I - Actual directory */
       else if ((dent->fileinfo.st_mode & 0111) &&
               S_ISREG(dent->fileinfo.st_mode))
       {
-       /* File is not a PPD, not an archive, but executable, try whether
-          it generates PPDs... */
+       // File is not a PPD, not an archive, but executable, try whether
+       // it generates PPDs...
        load_driver(filename, name, ppdlist, log, ld);
       }
     }
 
-   /*
-    * Close the file...
-    */
+    //
+    // Close the file...
+    //
 
     cupsFileClose(fp);
   }
@@ -2250,20 +2251,20 @@ load_ppds(const char *d,                /* I - Actual directory */
 }
 
 
-/*
- * 'load_ppds_dat()' - Load the ppds.dat file.
- */
+//
+// 'load_ppds_dat()' - Load the ppds.dat file.
+//
 
 static int
-load_ppds_dat(const char *filename,    /* I - Filename */
-              int        verbose,      /* I - Be verbose? */
+load_ppds_dat(const char *filename,    // I - Filename
+              int        verbose,      // I - Be verbose?
              ppd_list_t *ppdlist,
-             cf_logfunc_t log, /* I - Log function */
-             void *ld)                 /* I - Aux. data for log function */
+             cf_logfunc_t log,         // I - Log function
+             void *ld)                 // I - Aux. data for log function
 {
-  ppd_info_t   *ppd;                   /* Current PPD file */
-  cups_file_t  *fp;                    /* ppds.dat file */
-  struct stat  fileinfo;               /* ppds.dat information */
+  ppd_info_t   *ppd;                   // Current PPD file
+  cups_file_t  *fp;                    // ppds.dat file
+  struct stat  fileinfo;               // ppds.dat information
 
 
   if (filename == NULL || !filename[0])
@@ -2271,12 +2272,12 @@ load_ppds_dat(const char *filename,     /* I - Filename */
 
   if ((fp = cupsFileOpen(filename, "r")) != NULL)
   {
-   /*
-    * See if we have the right sync word...
-    */
+    //
+    // See if we have the right sync word...
+    //
 
-    unsigned ppdsync;                  /* Sync word */
-    int      num_ppds;                 /* Number of PPDs */
+    unsigned ppdsync;                  // Sync word
+    int      num_ppds;                 // Number of PPDs
 
     if ((size_t)cupsFileRead(fp, (char *)&ppdsync,
                             sizeof(ppdsync)) == sizeof(ppdsync) &&
@@ -2287,9 +2288,9 @@ load_ppds_dat(const char *filename,       /* I - Filename */
        (num_ppds = ((size_t)fileinfo.st_size - sizeof(ppdsync)) /
         sizeof(ppd_rec_t)) > 0)
     {
-     /*
-      * We have a ppds.dat file, so read it!
-      */
+      //
+      // We have a ppds.dat file, so read it!
+      //
 
       for (; num_ppds > 0; num_ppds --)
       {
@@ -2327,38 +2328,38 @@ load_ppds_dat(const char *filename,     /* I - Filename */
 }
 
 
-/*
- * 'load_tar()' - Load archived PPD files.
- */
+//
+// 'load_tar()' - Load archived PPD files.
+//
 
-static int                             /* O - 1 on success, 0 on failure */
-load_tar(const char  *filename,                /* I - Actual filename */
-         const char  *name,            /* I - Name to the rest of the world */
-         cups_file_t *fp,              /* I - File to read from */
-        time_t      mtime,             /* I - Mod time of driver info file */
-        off_t       size,              /* I - Size of driver info file */
+static int                             // O - 1 on success, 0 on failure
+load_tar(const char  *filename,                // I - Actual filename
+         const char  *name,            // I - Name to the rest of the world
+         cups_file_t *fp,              // I - File to read from
+        time_t      mtime,             // I - Mod time of driver info file
+        off_t       size,              // I - Size of driver info file
         ppd_list_t  *ppdlist,
-        cf_logfunc_t log,              /* I - Log function */
-        void *ld)                      /* I - Aux. data for log function */
+        cf_logfunc_t log,              // I - Log function
+        void *ld)                      // I - Aux. data for log function
 {
-  char         curname[256],           /* Current archive file name */
-               uri[2048];              /* Virtual file URI */
-  const char   *curext;                /* Extension on file */
-  struct stat  curinfo;                /* Current archive file information */
-  off_t                next;                   /* Position for next header */
+  char         curname[256],           // Current archive file name
+               uri[2048];              // Virtual file URI
+  const char   *curext;                // Extension on file
+  struct stat  curinfo;                // Current archive file information
+  off_t                next;                   // Position for next header
 
 
- /*
-  * Add a dummy entry for the file...
-  */
+  //
+  // Add a dummy entry for the file...
+  //
 
   add_ppd(filename, name, "", "", "", "", "", "", mtime, (size_t)size, 0,
          PPD_TYPE_ARCHIVE, "file", ppdlist, log, ld);
   ppdlist->ChangedPPD = 1;
 
- /*
-  * Scan for PPDs in the archive...
-  */
+  //
+  // Scan for PPDs in the archive...
+  //
 
   while (read_tar(fp, curname, sizeof(curname), &curinfo, log, ld))
   {
@@ -2381,29 +2382,29 @@ load_tar(const char  *filename,         /* I - Actual filename */
 }
 
 
-/*
- * 'read_tar()' - Read a file header from an archive.
- *
- * This function skips all directories and special files.
- */
+//
+// 'read_tar()' - Read a file header from an archive.
+//
+// This function skips all directories and special files.
+//
 
-static int                             /* O - 1 if found, 0 on EOF */
-read_tar(cups_file_t *fp,              /* I - Archive to read */
-         char        *name,            /* I - Filename buffer */
-         size_t      namesize,         /* I - Size of filename buffer */
-         struct stat *info,            /* O - File information */
-        cf_logfunc_t log,              /* I - Log function */
-        void *ld)                      /* I - Aux. data for log function */
+static int                             // O - 1 if found, 0 on EOF
+read_tar(cups_file_t *fp,              // I - Archive to read
+         char        *name,            // I - Filename buffer
+         size_t      namesize,         // I - Size of filename buffer
+         struct stat *info,            // O - File information
+        cf_logfunc_t log,              // I - Log function
+        void *ld)                      // I - Aux. data for log function
 {
-  tar_rec_t    record;                 /* Record from file */
+  tar_rec_t    record;                 // Record from file
 
 
   while ((size_t)cupsFileRead(fp, (char *)&record,
                              sizeof(record)) == sizeof(record))
   {
-   /*
-    * Check for a valid tar header...
-    */
+    //
+    // Check for a valid tar header...
+    //
 
     if ((memcmp(record.header.magic, TAR_MAGIC, 6) ||
         memcmp(record.header.version, TAR_VERSION, 2)) &&
@@ -2416,17 +2417,17 @@ read_tar(cups_file_t *fp,               /* I - Archive to read */
       break;
     }
 
-   /*
-    * Ignore non-files...
-    */
+    //
+    // Ignore non-files...
+    //
 
     if (record.header.linkflag != TAR_OLDNORMAL &&
         record.header.linkflag != TAR_NORMAL)
       continue;
 
-   /*
-    * Grab size and name from tar header and return...
-    */
+    //
+    // Grab size and name from tar header and return...
+    //
 
     if (record.header.prefix[0])
       snprintf(name, namesize, "%s/%s", record.header.prefix,
@@ -2444,32 +2445,32 @@ read_tar(cups_file_t *fp,               /* I - Archive to read */
 }
 
 
-/*
- * 'regex_device_id()' - Compile a regular expression based on the 1284 device
- *                       ID.
- */
+//
+// 'regex_device_id()' - Compile a regular expression based on the 1284 device
+//                       ID.
 
-static regex_t *                       /* O - Regular expression */
-regex_device_id(const char *device_id, /* I - IEEE-1284 device ID */
-               cf_logfunc_t log,       /* I - Log function */
-               void *ld)               /* I - Aux. data for log function */
+
+static regex_t *                       // O - Regular expression
+regex_device_id(const char *device_id, // I - IEEE-1284 device ID
+               cf_logfunc_t log,       // I - Log function
+               void *ld)               // I - Aux. data for log function
 {
-  char         res[2048],              /* Regular expression string */
-               *ptr;                   /* Pointer into string */
-  regex_t      *re;                    /* Regular expression */
-  int          cmd;                    /* Command set string? */
+  char         res[2048],              // Regular expression string
+               *ptr;                   // Pointer into string
+  regex_t      *re;                    // Regular expression
+  int          cmd;                    // Command set string?
 
 
   if (log) log(ld, CF_LOGLEVEL_DEBUG,
               "libppd: [PPD Collections] regex_device_id(\"%s\")",
               device_id);
 
- /*
-  * Scan the device ID string and insert class, command set, manufacturer, and
-  * model attributes to match.  We assume that the device ID in the PPD and the
-  * device ID reported by the device itself use the same attribute names and
-  * order of attributes.
-  */
+  //
+  // Scan the device ID string and insert class, command set, manufacturer, and
+  // model attributes to match.  We assume that the device ID in the PPD and the
+  // device ID reported by the device itself use the same attribute names and
+  // order of attributes.
+  //
 
   ptr = res;
 
@@ -2498,9 +2499,9 @@ regex_device_id(const char *device_id,    /* I - IEEE-1284 device ID */
          *ptr++ = '\\';
         if (*device_id == ':')
        {
-        /*
-         * KEY:.*value
-         */
+         //
+         // KEY:.*value
+         //
 
          *ptr++ = *device_id++;
          *ptr++ = '.';
@@ -2512,9 +2513,9 @@ regex_device_id(const char *device_id,    /* I - IEEE-1284 device ID */
 
       if (*device_id == ';' || !*device_id)
       {
-       /*
-        * KEY:.*value.*;
-       */
+       //
+        // KEY:.*value.*;
+       //
 
        *ptr++ = '.';
        *ptr++ = '*';
@@ -2535,9 +2536,9 @@ regex_device_id(const char *device_id,    /* I - IEEE-1284 device ID */
   if (log) log(ld, CF_LOGLEVEL_DEBUG,
               "libppd: [PPD Collections] regex_device_id: \"%s\"", res);
 
- /*
-  * Compile the regular expression and return...
-  */
+  //
+  // Compile the regular expression and return...
+  //
 
   if (res[0] && (re = (regex_t *)calloc(1, sizeof(regex_t))) != NULL)
   {
@@ -2555,27 +2556,27 @@ regex_device_id(const char *device_id,  /* I - IEEE-1284 device ID */
 }
 
 
-/*
- * 'regex_string()' - Construct a regular expression to compare a simple string.
- */
+//
+// 'regex_string()' - Construct a regular expression to compare a simple string.
+//
 
-static regex_t *                       /* O - Regular expression */
-regex_string(const char *s,            /* I - String to compare */
-            cf_logfunc_t log,  /* I - Log function */
-            void *ld)                  /* I - Aux. data for log function */
+static regex_t *                       // O - Regular expression
+regex_string(const char *s,            // I - String to compare
+            cf_logfunc_t log,          // I - Log function
+            void *ld)                  // I - Aux. data for log function
 {
-  char         res[2048],              /* Regular expression string */
-               *ptr;                   /* Pointer into string */
-  regex_t      *re;                    /* Regular expression */
+  char         res[2048],              // Regular expression string
+               *ptr;                   // Pointer into string
+  regex_t      *re;                    // Regular expression
 
 
   if (log) log(ld, CF_LOGLEVEL_DEBUG,
               "libppd: [PPD Collections] regex_string(\"%s\")", s);
 
- /*
-  * Convert the string to a regular expression, escaping special characters
-  * as needed.
-  */
+  //
+  // Convert the string to a regular expression, escaping special characters
+  // as needed.
+  //
 
   ptr = res;
 
@@ -2592,9 +2593,9 @@ regex_string(const char *s,               /* I - String to compare */
   if (log) log(ld, CF_LOGLEVEL_DEBUG,
               "libppd: [PPD Collections] regex_string: \"%s\"", res);
 
- /*
-  * Create a case-insensitive regular expression...
-  */
+  //
+  // Create a case-insensitive regular expression...
+  //
 
   if (res[0] && (re = (regex_t *)calloc(1, sizeof(regex_t))) != NULL)
   {
@@ -2612,42 +2613,42 @@ regex_string(const char *s,             /* I - String to compare */
 }
 
 
-/*
- * 'CompareNames()' - Compare two names.
- *
- * This function basically does a _ppd_strcasecmp() of the two strings,
- * but is also aware of numbers so that "a2" < "a100".
- */
+//
+// 'CompareNames()' - Compare two names.
+//
+// This function basically does a _ppd_strcasecmp() of the two strings,
+// but is also aware of numbers so that "a2" < "a100".
+//
 
-int                                    /* O - Result of comparison */
-CompareNames(const char *s,            /* I - First string */
-            const char *t)             /* I - Second string */
+int                                    // O - Result of comparison
+CompareNames(const char *s,            // I - First string
+            const char *t)             // I - Second string
 {
-  int          diff,                   /* Difference between digits */
-               digits;                 /* Number of digits */
+  int          diff,                   // Difference between digits
+               digits;                 // Number of digits
 
 
- /*
-  * Loop through both names, returning only when a difference is
-  * seen.  Also, compare whole numbers rather than just characters, too!
-  */
+  //
+  // Loop through both names, returning only when a difference is
+  // seen.  Also, compare whole numbers rather than just characters, too!
+  //
 
   while (*s && *t)
   {
     if (isdigit(*s & 255) && isdigit(*t & 255))
     {
-     /*
-      * Got a number; start by skipping leading 0's...
-      */
+      //
+      // Got a number; start by skipping leading 0's...
+      //
 
       while (*s == '0')
         s ++;
       while (*t == '0')
         t ++;
 
-     /*
-      * Skip equal digits...
-      */
+      //
+      // Skip equal digits...
+      //
 
       while (isdigit(*s & 255) && *s == *t)
       {
@@ -2655,9 +2656,9 @@ CompareNames(const char *s,               /* I - First string */
        t ++;
       }
 
-     /*
-      * Bounce out if *s and *t aren't both digits...
-      */
+      //
+      // Bounce out if *s and *t aren't both digits...
+      //
 
       if (isdigit(*s & 255) && !isdigit(*t & 255))
         return (1);
@@ -2671,9 +2672,9 @@ CompareNames(const char *s,               /* I - First string */
       else
         diff = 1;
 
-     /*
-      * Figure out how many more digits there are...
-      */
+      //
+      // Figure out how many more digits there are...
+      //
 
       digits = 0;
       s ++;
@@ -2691,9 +2692,9 @@ CompareNames(const char *s,               /* I - First string */
        t ++;
       }
 
-     /*
-      * Return if the number or value of the digits is different...
-      */
+      //
+      // Return if the number or value of the digits is different...
+      //
 
       if (digits < 0)
         return (-1);
@@ -2713,9 +2714,9 @@ CompareNames(const char *s,               /* I - First string */
     }
   }
 
- /*
-  * Return the results of the final comparison...
-  */
+  //
+  // Return the results of the final comparison...
+  //
 
   if (*s)
     return (1);
@@ -2726,12 +2727,12 @@ CompareNames(const char *s,             /* I - First string */
 }
 
 
-/*
- * 'CreateStringsArray()' - Create a CUPS array of strings.
- */
+//
+// 'CreateStringsArray()' - Create a CUPS array of strings.
+//
 
-cups_array_t *                         /* O - CUPS array */
-CreateStringsArray(const char *s)      /* I - Comma-delimited strings */
+cups_array_t *                         // O - CUPS array
+CreateStringsArray(const char *s)      // I - Comma-delimited strings
 {
   if (!s || !*s)
     return (NULL);
@@ -2740,37 +2741,37 @@ CreateStringsArray(const char *s)       /* I - Comma-delimited strings */
 }
 
 
-/*
- * 'ExecCommand()' - Run a program with the correct environment.
- *
- * On macOS, we need to update the CFProcessPath environment variable that
- * is passed in the environment so the child can access its bundled resources.
- */
+//
+// 'ExecCommand()' - Run a program with the correct environment.
+//
+// On macOS, we need to update the CFProcessPath environment variable that
+// is passed in the environment so the child can access its bundled resources.
+//
 
-int                                    /* O - exec() status */
-ExecCommand(const char *command,               /* I - Full path to program */
-          char       **argv)           /* I - Command-line arguments */
+int                                    // O - exec() status
+ExecCommand(const char *command,       // I - Full path to program
+           char       **argv)          // I - Command-line arguments
 {
 #ifdef __APPLE__
-  int  i, j;                           /* Looping vars */
-  char *envp[500],                     /* Array of environment variables */
-       cfprocesspath[1024],            /* CFProcessPath environment variable */
-       linkpath[1024];                 /* Link path for symlinks... */
-  int  linkbytes;                      /* Bytes for link path */
+  int  i, j;                           // Looping vars
+  char *envp[500],                     // Array of environment variables
+       cfprocesspath[1024],            // CFProcessPath environment variable
+       linkpath[1024];                 // Link path for symlinks...
+  int  linkbytes;                      // Bytes for link path
 
 
- /*
-  * Some macOS programs are bundled and need the CFProcessPath environment
-  * variable defined.  If the command is a symlink, resolve the link and point
-  * to the resolved location, otherwise, use the command path itself.
-  */
+  //
+  // Some macOS programs are bundled and need the CFProcessPath environment
+  // variable defined.  If the command is a symlink, resolve the link and point
+  // to the resolved location, otherwise, use the command path itself.
+  //
 
   if ((linkbytes = readlink(command, linkpath, sizeof(linkpath) - 1)) > 0)
   {
-   /*
-    * Yes, this is a symlink to the actual program, nul-terminate and
-    * use it...
-    */
+    //
+    // Yes, this is a symlink to the actual program, nul-terminate and
+    // use it...
+    //
 
     linkpath[linkbytes] = '\0';
 
@@ -2786,10 +2787,10 @@ ExecCommand(const char *command,                /* I - Full path to program */
 
   envp[0] = cfprocesspath;
 
- /*
-  * Copy the rest of the environment except for any CFProcessPath that may
-  * already be there...
-  */
+  //
+  // Copy the rest of the environment except for any CFProcessPath that may
+  // already be there...
+  //
 
   for (i = 1, j = 0;
        environ[j] && i < (int)(sizeof(envp) / sizeof(envp[0]) - 1);
@@ -2799,39 +2800,39 @@ ExecCommand(const char *command,                /* I - Full path to program */
 
   envp[i] = NULL;
 
- /*
-  * Use execve() to run the program...
-  */
+  //
+  // Use execve() to run the program...
+  //
 
   return (execve(command, argv, envp));
 
 #else
- /*
-  * On other operating systems, just call execv() to use the same environment
-  * variables as the parent...
-  */
+  //
+  // On other operating systems, just call execv() to use the same environment
+  // variables as the parent...
+  //
 
   return (execv(command, argv));
-#endif /* __APPLE__ */
+#endif // __APPLE__
 }
 
 
-/*
- * 'PipeCommand()' - Read output from a command.
- */
+//
+// 'PipeCommand()' - Read output from a command.
+//
 
-cups_file_t *                          /* O - CUPS file or NULL on error */
-PipeCommand(int        *cpid,          /* O - Process ID or 0 on error */
-           int        *epid,           /* O - Log Process ID or 0 on error */
-           const char *command,        /* I - Command to run */
-           char       **argv,          /* I - Arguments to pass to command */
-           uid_t      user,            /* I - User to run as or 0 for current*/
+cups_file_t *                          // O - CUPS file or NULL on error
+PipeCommand(int        *cpid,          // O - Process ID or 0 on error
+           int        *epid,           // O - Log Process ID or 0 on error
+           const char *command,        // I - Command to run
+           char       **argv,          // I - Arguments to pass to command
+           uid_t      user,            // I - User to run as or 0 for current
            cf_logfunc_t log,
            void       *ld)
 {
-  int        fd,                       /* Temporary file descriptor */
-             cfds[2],                  /* Output Pipe file descriptors */
-             efds[2];                  /* Error/Log Pipe file descriptors */
+  int        fd,                       // Temporary file descriptor
+             cfds[2],                  // Output Pipe file descriptors
+             efds[2];                  // Error/Log Pipe file descriptors
   cups_file_t *outfp, *logfp;
   char        buf[BUFSIZ];
   cf_loglevel_t log_level;
@@ -2841,9 +2842,9 @@ PipeCommand(int        *cpid,             /* O - Process ID or 0 on error */
   *cpid = *epid = 0;
   cfds[0] = cfds[1] = efds[0] = efds[1] = -1;
 
- /*
-  * First create the pipes...
-  */
+  //
+  // First create the pipes...
+  //
 
   if (pipe(cfds))
   {
@@ -2861,9 +2862,9 @@ PipeCommand(int        *cpid,             /* O - Process ID or 0 on error */
       return (NULL);
     }
 
- /*
-  * Set the "close on exec" flag on each end of the pipes...
-  */
+  //
+  // Set the "close on exec" flag on each end of the pipes...
+  //
 
   if (fcntl(cfds[0], F_SETFD, fcntl(cfds[0], F_GETFD) | FD_CLOEXEC))
   {
@@ -2912,15 +2913,15 @@ PipeCommand(int        *cpid,           /* O - Process ID or 0 on error */
     }
   }
 
- /*
-  * Then run the command...
-  */
+  //
+  // Then run the command...
+  //
 
   if ((*cpid = fork()) < 0)
   {
-   /*
-    * Unable to fork!
-    */
+    //
+    // Unable to fork!
+    //
 
     *cpid = 0;
     close(cfds[0]);
@@ -2939,30 +2940,30 @@ PipeCommand(int        *cpid,           /* O - Process ID or 0 on error */
   }
   else if (!*cpid)
   {
-   /*
-    * Child (command) comes here...
-    */
+    //
+    // Child (command) comes here...
+    //
 
-    if (!getuid() && user && setuid(user) < 0) /* Run as restricted user */
+    if (!getuid() && user && setuid(user) < 0) // Run as restricted user
       exit(errno);
 
     if ((fd = open("/dev/null", O_RDONLY)) > 0)
     {
-      dup2(fd, 0);                     /* < /dev/null */
+      dup2(fd, 0);                     // < /dev/null
       close(fd);
     }
 
-    dup2(cfds[1], 1);                  /* > command pipe */
+    dup2(cfds[1], 1);                  // > command pipe
     close(cfds[1]);
 
     if (log)
     {
-      dup2(efds[1], 2);                        /* 2> error pipe */
+      dup2(efds[1], 2);                        // 2> error pipe
       close(efds[1]);
     }
     else if ((fd = open("/dev/null", O_WRONLY)) > 0)
     {
-      dup2(fd, 2);                     /* 2> /dev/null */
+      dup2(fd, 2);                     // 2> /dev/null
       close(fd);
     }
 
@@ -2975,29 +2976,29 @@ PipeCommand(int        *cpid,           /* O - Process ID or 0 on error */
   if (log) log(ld, CF_LOGLEVEL_DEBUG,
               "libppd: [PPD Collections] Started %s (PID %d)", argv[0], cpid);
 
- /*
-  * Parent comes here ...
-  */
+  //
+  // Parent comes here ...
+  //
 
   close(cfds[1]);
 
- /*
-  * Open the input side of the pipe...
-  */
+  //
+  // Open the input side of the pipe...
+  //
 
   outfp = cupsFileOpenFd(cfds[0], "r");
 
- /*
-  * Fork the error logging...
-  */
+  //
+  // Fork the error logging...
+  //
 
   if (log)
   {
     if ((*epid = fork()) < 0)
     {
-     /*
-      * Unable to fork!
-      */
+      //
+      // Unable to fork!
+      //
 
       *epid = 0;
       close(efds[0]);
@@ -3014,9 +3015,9 @@ PipeCommand(int        *cpid,             /* O - Process ID or 0 on error */
     }
     else if (!*epid)
     {
-     /*
-      * Child (logging) comes here...
-      */
+      //
+      // Child (logging) comes here...
+      //
 
       close(cfds[0]);
       close(efds[1]);
@@ -3045,9 +3046,9 @@ PipeCommand(int        *cpid,             /* O - Process ID or 0 on error */
          log(ld, log_level, "libppd: [PPD Collections] %s: %s", argv[0], msg);
        }
       cupsFileClose(logfp);
-      /* No need to close the fd errfds[0], as cupsFileClose(fp) does this
-        already */
-      /* Ignore errors of the logging process */
+      // No need to close the fd errfds[0], as cupsFileClose(fp) does this
+      // already
+      // Ignore errors of the logging process
       exit(0);
     }
 
@@ -3055,9 +3056,9 @@ PipeCommand(int        *cpid,             /* O - Process ID or 0 on error */
        "libppd: [PPD Collections] Started logging for %s (PID %d)",
        argv[0], cpid);
 
-   /*
-    * Parent comes here ...
-    */
+    //
+    // Parent comes here ...
+    //
 
     close(efds[0]);
     close(efds[1]);
@@ -3067,10 +3068,10 @@ PipeCommand(int        *cpid,           /* O - Process ID or 0 on error */
 }
 
 
-/*
- * 'ClosePipeCommand()' - Wait for the command called with PipeCommand() to
- *                        finish and return the status.
- */
+//
+// 'ClosePipeCommand()' - Wait for the command called with PipeCommand() to
+//                        finish and return the status.
+//
 
 static int
 ClosePipeCommand(cups_file_t *fp,
@@ -3084,18 +3085,19 @@ ClosePipeCommand(cups_file_t *fp,
   int           wstatus;
 
 
- /*
-  * close the stream...
-  */
+  //
+  // close the stream...
+  //
 
   cupsFileClose(fp);
 
- /*
-  * Wait for the child process to exit...
-  */
+  //
+  // Wait for the child process to exit...
+  //
 
   while (cpid > 0 || epid > 0) {
-    if ((pid = wait(&wstatus)) < 0) {
+    if ((pid = wait(&wstatus)) < 0)
+    {
       if (errno == EINTR)
        continue;
       else
@@ -3111,24 +3113,30 @@ ClosePipeCommand(cups_file_t *fp,
       }
     }
 
-    /* How did the filter terminate */
-    if (wstatus) {
-      if (WIFEXITED(wstatus)) {
-       /* Via exit() anywhere or return() in the main() function */
+    // How did the filter terminate
+    if (wstatus)
+    {
+      if (WIFEXITED(wstatus))
+      {
+       // Via exit() anywhere or return() in the main() function
        if (log) log(ld, CF_LOGLEVEL_ERROR,
                     "libppd: [PPD Collections] %s (PID %d) stopped with status %d",
                     (pid == cpid ? "Command" : "Logging"), pid,
                     WEXITSTATUS(wstatus));
        status = WEXITSTATUS(wstatus);
-      } else {
-       /* Via signal */
+      }
+      else
+      {
+       // Via signal
        if (log) log(ld, CF_LOGLEVEL_ERROR,
                     "libppd: [PPD Collections] %s (PID %d) crashed on signal %d",
                     (pid == cpid ? "Command" : "Logging"), pid,
                     WTERMSIG(wstatus));
        status = 256 * WTERMSIG(wstatus);
       }
-    } else {
+    }
+    else
+    {
       if (log) log(ld, CF_LOGLEVEL_DEBUG,
                   "libppd: [PPD Collections] %s (PID %d) exited with no errors.",
                   (pid == cpid ? "Command" : "Logging"), pid);
@@ -3140,5 +3148,5 @@ ClosePipeCommand(cups_file_t *fp,
       epid = -1;
   }
 
-  return status;
+  return (status);
 }
index 29c0737a61a342baf69c104fc32fd6cf2031452a..237fd487b328e415e778458fcd5627e70d739d21 100644 (file)
@@ -1,27 +1,27 @@
-/*
- * Option conflict management routines for libppd.
- *
- * Copyright 2007-2018 by Apple Inc.
- * Copyright 1997-2007 by Easy Software Products, all rights reserved.
- *
- * Licensed under Apache License v2.0.  See the file "LICENSE" for more
- * information.
- *
- * PostScript is a trademark of Adobe Systems, Inc.
- */
-
-/*
- * Include necessary headers...
- */
+//
+// Option conflict management routines for libppd.
+//
+// Copyright 2007-2018 by Apple Inc.
+// Copyright 1997-2007 by Easy Software Products, all rights reserved.
+//
+// Licensed under Apache License v2.0.  See the file "LICENSE" for more
+// information.
+//
+// PostScript is a trademark of Adobe Systems, Inc.
+//
+
+//
+// Include necessary headers...
+//
 
 #include "string-private.h"
 #include "ppd.h"
 #include "debug-internal.h"
 
 
-/*
- * Local constants...
- */
+//
+// Local constants...
+//
 
 enum
 {
@@ -31,9 +31,9 @@ enum
 };
 
 
-/*
- * Local functions...
- */
+//
+// Local functions...
+//
 
 static int             ppd_is_installable(ppd_group_t *installable,
                                           const char *option);
@@ -46,39 +46,39 @@ static cups_array_t *ppd_test_constraints(ppd_file_t *ppd,
                                              int which);
 
 
-/*
- * 'ppdGetConflicts()' - Get a list of conflicting options in a marked PPD.
- *
- * This function gets a list of options that would conflict if "option" and
- * "choice" were marked in the PPD.  You would typically call this function
- * after marking the currently selected options in the PPD in order to
- * determine whether a new option selection would cause a conflict.
- *
- * The number of conflicting options are returned with "options" pointing to
- * the conflicting options.  The returned option array must be freed using
- * @link cupsFreeOptions@.
- *
- * @since CUPS 1.4/macOS 10.6@
- */
-
-int                                    /* O - Number of conflicting options */
+//
+// 'ppdGetConflicts()' - Get a list of conflicting options in a marked PPD.
+//
+// This function gets a list of options that would conflict if "option" and
+// "choice" were marked in the PPD.  You would typically call this function
+// after marking the currently selected options in the PPD in order to
+// determine whether a new option selection would cause a conflict.
+//
+// The number of conflicting options are returned with "options" pointing to
+// the conflicting options.  The returned option array must be freed using
+// @link cupsFreeOptions@.
+//
+// @since CUPS 1.4/macOS 10.6@
+//
+
+int                                    // O - Number of conflicting options
 ppdGetConflicts(
-    ppd_file_t    *ppd,                        /* I - PPD file */
-    const char    *option,             /* I - Option to test */
-    const char    *choice,             /* I - Choice to test */
-    cups_option_t **options)           /* O - Conflicting options */
+    ppd_file_t    *ppd,                        // I - PPD file
+    const char    *option,             // I - Option to test
+    const char    *choice,             // I - Choice to test
+    cups_option_t **options)           // O - Conflicting options
 {
-  int                  i,              /* Looping var */
-                       num_options;    /* Number of conflicting options */
-  cups_array_t         *active;        /* Active conflicts */
-  ppd_cups_uiconsts_t  *c;             /* Current constraints */
-  ppd_cups_uiconst_t   *cptr;          /* Current constraint */
-  ppd_choice_t         *marked;        /* Marked choice */
+  int                  i,              // Looping var
+                       num_options;    // Number of conflicting options
+  cups_array_t         *active;        // Active conflicts
+  ppd_cups_uiconsts_t  *c;             // Current constraints
+  ppd_cups_uiconst_t   *cptr;          // Current constraint
+  ppd_choice_t         *marked;        // Marked choice
 
 
- /*
-  * Range check input...
-  */
+  //
+  // Range check input...
+  //
 
   if (options)
     *options = NULL;
@@ -86,16 +86,16 @@ ppdGetConflicts(
   if (!ppd || !option || !choice || !options)
     return (0);
 
- /*
-  * Test for conflicts...
-  */
+  //
+  // Test for conflicts...
+  //
 
   active = ppd_test_constraints(ppd, option, choice, 0, NULL,
                                 _PPD_ALL_CONSTRAINTS);
 
- /*
-  * Loop through all of the UI constraints and add any options that conflict...
-  */
+  //
+  // Loop through all of the UI constraints and add any options that conflict...
+  //
 
   for (num_options = 0, c = (ppd_cups_uiconsts_t *)cupsArrayFirst(active);
        c;
@@ -123,84 +123,87 @@ ppdGetConflicts(
 }
 
 
-/*
- * 'ppdResolveConflicts()' - Resolve conflicts in a marked PPD.
- *
- * This function attempts to resolve any conflicts in a marked PPD, returning
- * a list of option changes that are required to resolve them.  On input,
- * "num_options" and "options" contain any pending option changes that have
- * not yet been marked, while "option" and "choice" contain the most recent
- * selection which may or may not be in "num_options" or "options".
- *
- * On successful return, "num_options" and "options" are updated to contain
- * "option" and "choice" along with any changes required to resolve conflicts
- * specified in the PPD file and 1 is returned.
- *
- * If option conflicts cannot be resolved, "num_options" and "options" are not
- * changed and 0 is returned.
- *
- * When resolving conflicts, @code ppdResolveConflicts@ does not consider
- * changes to the current page size (@code media@, @code PageSize@, and
- * @code PageRegion@) or to the most recent option specified in "option".
- * Thus, if the only way to resolve a conflict is to change the page size
- * or the option the user most recently changed, @code ppdResolveConflicts@
- * will return 0 to indicate it was unable to resolve the conflicts.
- *
- * The @code ppdResolveConflicts@ function uses one of two sources of option
- * constraint information.  The preferred constraint information is defined by
- * @code cupsUIConstraints@ and @code cupsUIResolver@ attributes - in this
- * case, the PPD file provides constraint resolution actions.
- *
- * The backup constraint information is defined by the
- * @code UIConstraints@ and @code NonUIConstraints@ attributes.  These
- * constraints are resolved algorithmically by first selecting the default
- * choice for the conflicting option, then iterating over all possible choices
- * until a non-conflicting option choice is found.
- *
- * @since CUPS 1.4/macOS 10.6@
- */
-
-int                                    /* O  - 1 on success, 0 on failure */
+//
+// 'ppdResolveConflicts()' - Resolve conflicts in a marked PPD.
+//
+// This function attempts to resolve any conflicts in a marked PPD, returning
+// a list of option changes that are required to resolve them.  On input,
+// "num_options" and "options" contain any pending option changes that have
+// not yet been marked, while "option" and "choice" contain the most recent
+// selection which may or may not be in "num_options" or "options".
+//
+// On successful return, "num_options" and "options" are updated to contain
+// "option" and "choice" along with any changes required to resolve conflicts
+// specified in the PPD file and 1 is returned.
+//
+// If option conflicts cannot be resolved, "num_options" and "options" are not
+// changed and 0 is returned.
+//
+// When resolving conflicts, @code ppdResolveConflicts@ does not consider
+// changes to the current page size (@code media@, @code PageSize@, and
+// @code PageRegion@) or to the most recent option specified in "option".
+// Thus, if the only way to resolve a conflict is to change the page size
+// or the option the user most recently changed, @code ppdResolveConflicts@
+// will return 0 to indicate it was unable to resolve the conflicts.
+//
+// The @code ppdResolveConflicts@ function uses one of two sources of option
+// constraint information.  The preferred constraint information is defined by
+// @code cupsUIConstraints@ and @code cupsUIResolver@ attributes - in this
+// case, the PPD file provides constraint resolution actions.
+//
+// The backup constraint information is defined by the
+// @code UIConstraints@ and @code NonUIConstraints@ attributes.  These
+// constraints are resolved algorithmically by first selecting the default
+// choice for the conflicting option, then iterating over all possible choices
+// until a non-conflicting option choice is found.
+//
+// @since CUPS 1.4/macOS 10.6@
+//
+
+int                                    // O  - 1 on success, 0 on failure
 ppdResolveConflicts(
-    ppd_file_t    *ppd,                        /* I  - PPD file */
-    const char    *option,             /* I  - Newly selected option or @code NULL@ for none */
-    const char    *choice,             /* I  - Newly selected choice or @code NULL@ for none */
-    int           *num_options,                /* IO - Number of additional selected options */
-    cups_option_t **options)           /* IO - Additional selected options */
+    ppd_file_t    *ppd,                        // I  - PPD file
+    const char    *option,             // I  - Newly selected option or
+                                       // @code NULL@ for none
+    const char    *choice,             // I  - Newly selected choice or
+                                       // @code NULL@ for none
+    int           *num_options,                // IO - Number of additional selected
+                                       // options
+    cups_option_t **options)           // IO - Additional selected options
 {
-  int                  i,              /* Looping var */
-                       tries,          /* Number of tries */
-                       num_newopts;    /* Number of new options */
-  cups_option_t                *newopts;       /* New options */
-  cups_array_t         *active = NULL, /* Active constraints */
-                       *pass,          /* Resolvers for this pass */
-                       *resolvers,     /* Resolvers we have used */
-                       *test;          /* Test array for conflicts */
-  ppd_cups_uiconsts_t  *consts;        /* Current constraints */
-  ppd_cups_uiconst_t   *constptr;      /* Current constraint */
-  ppd_attr_t           *resolver;      /* Current resolver */
-  const char           *resval;        /* Pointer into resolver value */
+  int                  i,              // Looping var
+                       tries,          // Number of tries
+                       num_newopts;    // Number of new options
+  cups_option_t                *newopts;       // New options
+  cups_array_t         *active = NULL, // Active constraints
+                       *pass,          // Resolvers for this pass
+                       *resolvers,     // Resolvers we have used
+                       *test;          // Test array for conflicts
+  ppd_cups_uiconsts_t  *consts;        // Current constraints
+  ppd_cups_uiconst_t   *constptr;      // Current constraint
+  ppd_attr_t           *resolver;      // Current resolver
+  const char           *resval;        // Pointer into resolver value
   char                 resoption[PPD_MAX_NAME],
-                                       /* Current resolver option */
+                                       // Current resolver option
                        reschoice[PPD_MAX_NAME],
-                                       /* Current resolver choice */
-                       *resptr,        /* Pointer into option/choice */
-                       firstpage[255]; /* AP_FIRSTPAGE_Keyword string */
-  const char           *value;         /* Selected option value */
-  int                  changed;        /* Did we change anything? */
-  ppd_choice_t         *marked;        /* Marked choice */
+                                       // Current resolver choice
+                       *resptr,        // Pointer into option/choice
+                       firstpage[255]; // AP_FIRSTPAGE_Keyword string
+  const char           *value;         // Selected option value
+  int                  changed;        // Did we change anything?
+  ppd_choice_t         *marked;        // Marked choice
 
 
- /*
-  * Range check input...
-  */
+  //
+  // Range check input...
+  //
 
   if (!ppd || !num_options || !options || (option == NULL) != (choice == NULL))
     return (0);
 
- /*
-  * Build a shadow option array...
-  */
+  //
+  // Build a shadow option array...
+  //
 
   num_newopts = 0;
   newopts     = NULL;
@@ -211,9 +214,9 @@ ppdResolveConflicts(
   if (option && _ppd_strcasecmp(option, "Collate"))
     num_newopts = cupsAddOption(option, choice, num_newopts, &newopts);
 
- /*
-  * Loop until we have no conflicts...
-  */
+  //
+  // Loop until we have no conflicts...
+  //
 
   cupsArraySave(ppd->sorted_attrs);
 
@@ -236,18 +239,18 @@ ppdResolveConflicts(
     {
       if (consts->resolver[0])
       {
-       /*
-        * Look up the resolver...
-       */
+       //
+        // Look up the resolver...
+       //
 
         if (cupsArrayFind(pass, consts->resolver))
-         continue;                     /* Already applied this resolver... */
+         continue;                     // Already applied this resolver...
 
         if (cupsArrayFind(resolvers, consts->resolver))
        {
-        /*
-         * Resolver loop!
-         */
+         //
+         // Resolver loop!
+         //
 
          DEBUG_printf(("1ppdResolveConflicts: Resolver loop with %s!",
                        consts->resolver));
@@ -269,9 +272,9 @@ ppdResolveConflicts(
          goto error;
        }
 
-       /*
-        * Add the options from the resolver...
-       */
+       //
+        // Add the options from the resolver...
+       //
 
         cupsArrayAdd(pass, consts->resolver);
        cupsArrayAdd(resolvers, consts->resolver);
@@ -306,9 +309,9 @@ ppdResolveConflicts(
           if (!resoption[0] || !reschoice[0])
            break;
 
-         /*
-         * Is this the option we are changing?
-         */
+         //
+         // Is this the option we are changing?
+         //
 
           snprintf(firstpage, sizeof(firstpage), "AP_FIRSTPAGE_%s", resoption);
 
@@ -329,28 +332,28 @@ ppdResolveConflicts(
                !_ppd_strcasecmp(resoption, "PageRegion"))))
            continue;
 
-        /*
-         * Try this choice...
-         */
+         //
+         // Try this choice...
+         //
 
           if ((test = ppd_test_constraints(ppd, resoption, reschoice,
                                           num_newopts, newopts,
                                           _PPD_ALL_CONSTRAINTS)) == NULL)
          {
-          /*
-           * That worked...
-           */
+           //
+           // That worked...
+           //
 
             changed = 1;
          }
          else
             cupsArrayDelete(test);
 
-        /*
-         * Add the option/choice from the resolver regardless of whether it
-         * worked; this makes sure that we can cascade several changes to
-         * make things resolve...
-         */
+         //
+         // Add the option/choice from the resolver regardless of whether it
+         // worked; this makes sure that we can cascade several changes to
+         // make things resolve...
+         //
 
          num_newopts = cupsAddOption(resoption, reschoice, num_newopts,
                                      &newopts);
@@ -358,30 +361,30 @@ ppdResolveConflicts(
       }
       else
       {
-       /*
-        * Try resolving by choosing the default values for non-installable
-       * options, then by iterating through the possible choices...
-       */
+       //
+        // Try resolving by choosing the default values for non-installable
+       // options, then by iterating through the possible choices...
+       //
 
-        int            j;              /* Looping var */
-       ppd_choice_t    *cptr;          /* Current choice */
-        ppd_size_t     *size;          /* Current page size */
+        int            j;              // Looping var
+       ppd_choice_t    *cptr;          // Current choice
+        ppd_size_t     *size;          // Current page size
 
 
         for (i = consts->num_constraints, constptr = consts->constraints;
             i > 0 && !changed;
             i --, constptr ++)
        {
-        /*
-         * Can't resolve by changing an installable option...
-         */
+         //
+         // Can't resolve by changing an installable option...
+         //
 
          if (constptr->installable)
            continue;
 
-         /*
-         * Is this the option we are changing?
-         */
+         //
+         // Is this the option we are changing?
+         //
 
          if (option &&
              (!_ppd_strcasecmp(constptr->option->keyword, option) ||
@@ -391,9 +394,9 @@ ppdResolveConflicts(
                !_ppd_strcasecmp(constptr->option->keyword, "PageSize"))))
            continue;
 
-         /*
-         * Get the current option choice...
-         */
+         //
+         // Get the current option choice...
+         //
 
           if ((value = cupsGetOption(constptr->option->keyword, num_newopts,
                                     newopts)) == NULL)
@@ -423,9 +426,9 @@ ppdResolveConflicts(
          if (!_ppd_strncasecmp(value, "Custom.", 7))
            value = "Custom";
 
-         /*
-         * Try the default choice...
-         */
+         //
+         // Try the default choice...
+         //
 
           test = NULL;
 
@@ -435,9 +438,9 @@ ppdResolveConflicts(
                                           num_newopts, newopts,
                                           _PPD_OPTION_CONSTRAINTS)) == NULL)
          {
-          /*
-           * That worked...
-           */
+           //
+           // That worked...
+           //
 
            num_newopts = cupsAddOption(constptr->option->keyword,
                                        constptr->option->defchoice,
@@ -446,9 +449,9 @@ ppdResolveConflicts(
          }
          else
          {
-          /*
-           * Try each choice instead...
-           */
+           //
+           // Try each choice instead...
+           //
 
             for (j = constptr->option->num_choices,
                     cptr = constptr->option->choices;
@@ -464,11 +467,12 @@ ppdResolveConflicts(
                  (test = ppd_test_constraints(ppd, constptr->option->keyword,
                                               cptr->choice, num_newopts,
                                               newopts,
-                                              _PPD_OPTION_CONSTRAINTS)) == NULL)
+                                              _PPD_OPTION_CONSTRAINTS)) ==
+                 NULL)
              {
-              /*
-               * This choice works...
-               */
+               //
+               // This choice works...
+               //
 
                num_newopts = cupsAddOption(constptr->option->keyword,
                                            cptr->choice, num_newopts,
@@ -499,26 +503,26 @@ ppdResolveConflicts(
   if (tries >= 100)
     goto error;
 
- /*
-  * Free the caller's option array...
-  */
+  //
+  // Free the caller's option array...
+  //
 
   cupsFreeOptions(*num_options, *options);
 
- /*
-  * If Collate is the option we are testing, add it here.  Otherwise, remove
-  * any Collate option from the resolve list since the filters automatically
-  * handle manual collation...
-  */
+  //
+  // If Collate is the option we are testing, add it here.  Otherwise, remove
+  // any Collate option from the resolve list since the filters automatically
+  // handle manual collation...
+  //
 
   if (option && !_ppd_strcasecmp(option, "Collate"))
     num_newopts = cupsAddOption(option, choice, num_newopts, &newopts);
   else
     num_newopts = cupsRemoveOption("Collate", num_newopts, &newopts);
 
- /*
-  * Return the new list of options to the caller...
-  */
+  //
+  // Return the new list of options to the caller...
+  //
 
   *num_options = num_newopts;
   *options     = newopts;
@@ -533,15 +537,15 @@ ppdResolveConflicts(
   for (i = 0; i < num_newopts; i ++)
     DEBUG_printf(("1ppdResolveConflicts: options[%d]: %s=%s", i,
                   newopts[i].name, newopts[i].value));
-#endif /* DEBUG */
+#endif // DEBUG
 
   return (1);
 
- /*
-  * If we get here, we failed to resolve...
-  */
+  //
+  // If we get here, we failed to resolve...
+  //
 
 error:
+ error:
 
   cupsFreeOptions(num_newopts, newopts);
 
@@ -557,30 +561,30 @@ ppdResolveConflicts(
 }
 
 
-/*
- * 'ppdConflicts()' - Check to see if there are any conflicts among the
- *                    marked option choices.
- *
- * The returned value is the same as returned by @link ppdMarkOption@.
- */
+//
+// 'ppdConflicts()' - Check to see if there are any conflicts among the
+//                    marked option choices.
+//
+// The returned value is the same as returned by @link ppdMarkOption@.
+//
 
-int                                    /* O - Number of conflicts found */
-ppdConflicts(ppd_file_t *ppd)          /* I - PPD to check */
+int                                    // O - Number of conflicts found
+ppdConflicts(ppd_file_t *ppd)          // I - PPD to check
 {
-  int                  i,              /* Looping variable */
-                       conflicts;      /* Number of conflicts */
-  cups_array_t         *active;        /* Active conflicts */
-  ppd_cups_uiconsts_t  *c;             /* Current constraints */
-  ppd_cups_uiconst_t   *cptr;          /* Current constraint */
-  ppd_option_t *o;                     /* Current option */
+  int                  i,              // Looping variable
+                       conflicts;      // Number of conflicts
+  cups_array_t         *active;        // Active conflicts
+  ppd_cups_uiconsts_t  *c;             // Current constraints
+  ppd_cups_uiconst_t   *cptr;          // Current constraint
+  ppd_option_t *o;                     // Current option
 
 
   if (!ppd)
     return (0);
 
- /*
-  * Clear all conflicts...
-  */
+  //
+  // Clear all conflicts...
+  //
 
   cupsArraySave(ppd->options);
 
@@ -589,18 +593,18 @@ ppdConflicts(ppd_file_t *ppd)             /* I - PPD to check */
 
   cupsArrayRestore(ppd->options);
 
- /*
-  * Test for conflicts...
-  */
+  //
+  // Test for conflicts...
+  //
 
   active    = ppd_test_constraints(ppd, NULL, NULL, 0, NULL,
                                    _PPD_ALL_CONSTRAINTS);
   conflicts = cupsArrayCount(active);
 
- /*
-  * Loop through all of the UI constraints and flag any options
-  * that conflict...
-  */
+  //
+  // Loop through all of the UI constraints and flag any options
+  // that conflict...
+  //
 
   for (c = (ppd_cups_uiconsts_t *)cupsArrayFirst(active);
        c;
@@ -614,46 +618,46 @@ ppdConflicts(ppd_file_t *ppd)             /* I - PPD to check */
 
   cupsArrayDelete(active);
 
- /*
-  * Return the number of conflicts found...
-  */
+  //
+  // Return the number of conflicts found...
+  //
 
   return (conflicts);
 }
 
 
-/*
- * 'ppdInstallableConflict()' - Test whether an option choice conflicts with
- *                              an installable option.
- *
- * This function tests whether a particular option choice is available based
- * on constraints against options in the "InstallableOptions" group.
- *
- * @since CUPS 1.4/macOS 10.6@
- */
+//
+// 'ppdInstallableConflict()' - Test whether an option choice conflicts with
+//                              an installable option.
+//
+// This function tests whether a particular option choice is available based
+// on constraints against options in the "InstallableOptions" group.
+//
+// @since CUPS 1.4/macOS 10.6@
+//
 
-int                                    /* O - 1 if conflicting, 0 if not conflicting */
+int                                    // O - 1 if conflicting, 0 if not conflicting
 ppdInstallableConflict(
-    ppd_file_t *ppd,                   /* I - PPD file */
-    const char *option,                        /* I - Option */
-    const char *choice)                        /* I - Choice */
+    ppd_file_t *ppd,                   // I - PPD file
+    const char *option,                        // I - Option
+    const char *choice)                        // I - Choice
 {
-  cups_array_t *active;                /* Active conflicts */
+  cups_array_t *active;                // Active conflicts
 
 
   DEBUG_printf(("2ppdInstallableConflict(ppd=%p, option=\"%s\", choice=\"%s\")",
                 ppd, option, choice));
 
- /*
-  * Range check input...
-  */
+  //
+  // Range check input...
+  //
 
   if (!ppd || !option || !choice)
     return (0);
 
- /*
-  * Test constraints using the new option...
-  */
+  //
+  // Test constraints using the new option...
+  //
 
   active = ppd_test_constraints(ppd, option, choice, 0, NULL,
                                _PPD_INSTALLABLE_CONSTRAINTS);
@@ -664,20 +668,20 @@ ppdInstallableConflict(
 }
 
 
-/*
- * 'ppd_is_installable()' - Determine whether an option is in the
- *                          InstallableOptions group.
- */
+//
+// 'ppd_is_installable()' - Determine whether an option is in the
+//                          InstallableOptions group.
+//
 
-static int                             /* O - 1 if installable, 0 if normal */
+static int                             // O - 1 if installable, 0 if normal
 ppd_is_installable(
-    ppd_group_t *installable,          /* I - InstallableOptions group */
-    const char  *name)                 /* I - Option name */
+    ppd_group_t *installable,          // I - InstallableOptions group
+    const char  *name)                 // I - Option name
 {
   if (installable)
   {
-    int                        i;              /* Looping var */
-    ppd_option_t       *option;        /* Current option */
+    int                        i;              // Looping var
+    ppd_option_t       *option;        // Current option
 
 
     for (i = installable->num_options, option = installable->options;
@@ -691,36 +695,36 @@ ppd_is_installable(
 }
 
 
-/*
- * 'ppd_load_constraints()' - Load constraints from a PPD file.
- */
+//
+// 'ppd_load_constraints()' - Load constraints from a PPD file.
+//
 
 static void
-ppd_load_constraints(ppd_file_t *ppd)  /* I - PPD file */
+ppd_load_constraints(ppd_file_t *ppd)  // I - PPD file
 {
-  int          i;                      /* Looping var */
-  ppd_const_t  *oldconst;              /* Current UIConstraints data */
-  ppd_attr_t   *constattr;             /* Current cupsUIConstraints attribute */
-  ppd_cups_uiconsts_t  *consts;        /* Current cupsUIConstraints data */
-  ppd_cups_uiconst_t   *constptr;      /* Current constraint */
-  ppd_group_t  *installable;           /* Installable options group */
-  const char   *vptr;                  /* Pointer into constraint value */
-  char         option[PPD_MAX_NAME],   /* Option name/MainKeyword */
-               choice[PPD_MAX_NAME],   /* Choice/OptionKeyword */
-               *ptr;                   /* Pointer into option or choice */
+  int          i;                      // Looping var
+  ppd_const_t  *oldconst;              // Current UIConstraints data
+  ppd_attr_t   *constattr;             // Current cupsUIConstraints attribute
+  ppd_cups_uiconsts_t  *consts;        // Current cupsUIConstraints data
+  ppd_cups_uiconst_t   *constptr;      // Current constraint
+  ppd_group_t  *installable;           // Installable options group
+  const char   *vptr;                  // Pointer into constraint value
+  char         option[PPD_MAX_NAME],   // Option name/MainKeyword
+               choice[PPD_MAX_NAME],   // Choice/OptionKeyword
+               *ptr;                   // Pointer into option or choice
 
 
   DEBUG_printf(("7ppd_load_constraints(ppd=%p)", ppd));
 
- /*
-  * Create an array to hold the constraint data...
-  */
+  //
+  // Create an array to hold the constraint data...
+  //
 
   ppd->cups_uiconstraints = cupsArrayNew(NULL, NULL);
 
- /*
-  * Find the installable options group if it exists...
-  */
+  //
+  // Find the installable options group if it exists...
+  //
 
   for (i = ppd->num_groups, installable = ppd->groups;
        i > 0;
@@ -731,16 +735,16 @@ ppd_load_constraints(ppd_file_t *ppd)     /* I - PPD file */
   if (i <= 0)
     installable = NULL;
 
- /*
-  * Load old-style [Non]UIConstraints data...
-  */
+  //
+  // Load old-style [Non]UIConstraints data...
+  //
 
   for (i = ppd->num_consts, oldconst = ppd->consts; i > 0; i --, oldconst ++)
   {
-   /*
-    * Weed out nearby duplicates, since the PPD spec requires that you
-    * define both "*Foo foo *Bar bar" and "*Bar bar *Foo foo"...
-    */
+    //
+    // Weed out nearby duplicates, since the PPD spec requires that you
+    // define both "*Foo foo *Bar bar" and "*Bar bar *Foo foo"...
+    //
 
     if (i > 1 &&
        !_ppd_strcasecmp(oldconst[0].option1, oldconst[1].option2) &&
@@ -749,9 +753,9 @@ ppd_load_constraints(ppd_file_t *ppd)       /* I - PPD file */
        !_ppd_strcasecmp(oldconst[0].choice2, oldconst[1].choice1))
       continue;
 
-   /*
-    * Allocate memory...
-    */
+    //
+    // Allocate memory...
+    //
 
     if ((consts = calloc(1, sizeof(ppd_cups_uiconsts_t))) == NULL)
     {
@@ -768,9 +772,9 @@ ppd_load_constraints(ppd_file_t *ppd)       /* I - PPD file */
       return;
     }
 
-   /*
-    * Fill in the information...
-    */
+    //
+    // Fill in the information...
+    //
 
     consts->num_constraints = 2;
     consts->constraints     = constptr;
@@ -827,16 +831,16 @@ ppd_load_constraints(ppd_file_t *ppd)     /* I - PPD file */
 
     consts->installable = constptr[0].installable || constptr[1].installable;
 
-   /*
-    * Add it to the constraints array...
-    */
+    //
+    // Add it to the constraints array...
+    //
 
     cupsArrayAdd(ppd->cups_uiconstraints, consts);
   }
 
- /*
-  * Then load new-style constraints...
-  */
+  //
+  // Then load new-style constraints...
+  //
 
   for (constattr = ppdFindAttr(ppd, "cupsUIConstraints", NULL);
        constattr;
@@ -882,9 +886,9 @@ ppd_load_constraints(ppd_file_t *ppd)       /* I - PPD file */
         vptr;
         i ++, vptr = strchr(vptr, '*'), constptr ++)
     {
-     /*
-      * Extract "*Option Choice" or just "*Option"...
-      */
+      //
+      // Extract "*Option Choice" or just "*Option"...
+      //
 
       for (vptr ++, ptr = option; *vptr && !_ppd_isspace(*vptr); vptr ++)
        if (ptr < (option + sizeof(option) - 1))
@@ -906,7 +910,8 @@ ppd_load_constraints(ppd_file_t *ppd)       /* I - PPD file */
        *ptr = '\0';
       }
 
-      if (!_ppd_strncasecmp(option, "Custom", 6) && !_ppd_strcasecmp(choice, "True"))
+      if (!_ppd_strncasecmp(option, "Custom", 6) &&
+         !_ppd_strcasecmp(choice, "True"))
       {
        _ppd_strcpy(option, option + 6);
        strlcpy(choice, "Custom", sizeof(choice));
@@ -936,28 +941,28 @@ ppd_load_constraints(ppd_file_t *ppd)     /* I - PPD file */
 }
 
 
-/*
- * 'ppd_test_constraints()' - See if any constraints are active.
- */
+//
+// 'ppd_test_constraints()' - See if any constraints are active.
+//
 
-static cups_array_t *                  /* O - Array of active constraints */
+static cups_array_t *                  // O - Array of active constraints
 ppd_test_constraints(
-    ppd_file_t    *ppd,                        /* I - PPD file */
-    const char    *option,             /* I - Current option */
-    const char    *choice,             /* I - Current choice */
-    int           num_options,         /* I - Number of additional options */
-    cups_option_t *options,            /* I - Additional options */
-    int           which)               /* I - Which constraints to test */
+    ppd_file_t    *ppd,                        // I - PPD file
+    const char    *option,             // I - Current option
+    const char    *choice,             // I - Current choice
+    int           num_options,         // I - Number of additional options
+    cups_option_t *options,            // I - Additional options
+    int           which)               // I - Which constraints to test
 {
-  int                  i;              /* Looping var */
-  ppd_cups_uiconsts_t  *consts;        /* Current constraints */
-  ppd_cups_uiconst_t   *constptr;      /* Current constraint */
-  ppd_choice_t         key,            /* Search key */
-                       *marked;        /* Marked choice */
-  cups_array_t         *active = NULL; /* Active constraints */
-  const char           *value,         /* Current value */
-                       *firstvalue;    /* AP_FIRSTPAGE_Keyword value */
-  char                 firstpage[255]; /* AP_FIRSTPAGE_Keyword string */
+  int                  i;              // Looping var
+  ppd_cups_uiconsts_t  *consts;        // Current constraints
+  ppd_cups_uiconst_t   *constptr;      // Current constraint
+  ppd_choice_t         key,            // Search key
+                       *marked;        // Marked choice
+  cups_array_t         *active = NULL; // Active constraints
+  const char           *value,         // Current value
+                       *firstvalue;    // AP_FIRSTPAGE_Keyword value
+  char                 firstpage[255]; // AP_FIRSTPAGE_Keyword string
 
 
   DEBUG_printf(("7ppd_test_constraints(ppd=%p, option=\"%s\", choice=\"%s\", "
@@ -979,25 +984,27 @@ ppd_test_constraints(
     DEBUG_printf(("9ppd_test_constraints: installable=%d, resolver=\"%s\", "
                   "num_constraints=%d option1=\"%s\", choice1=\"%s\", "
                  "option2=\"%s\", choice2=\"%s\", ...",
-                 consts->installable, consts->resolver, consts->num_constraints,
+                 consts->installable, consts->resolver,
+                 consts->num_constraints,
                  consts->constraints[0].option->keyword,
                  consts->constraints[0].choice ?
-                     consts->constraints[0].choice->choice : "",
+                 consts->constraints[0].choice->choice : "",
                  consts->constraints[1].option->keyword,
                  consts->constraints[1].choice ?
-                     consts->constraints[1].choice->choice : ""));
+                 consts->constraints[1].choice->choice : ""));
 
     if (consts->installable && which < _PPD_INSTALLABLE_CONSTRAINTS)
-      continue;                                /* Skip installable option constraint */
+      continue;                            // Skip installable option constraint
 
     if (!consts->installable && which == _PPD_INSTALLABLE_CONSTRAINTS)
-      continue;                                /* Skip non-installable option constraint */
+      continue;                            // Skip non-installable option constraint
 
-    if ((which == _PPD_OPTION_CONSTRAINTS || which == _PPD_INSTALLABLE_CONSTRAINTS) && option)
+    if ((which == _PPD_OPTION_CONSTRAINTS ||
+        which == _PPD_INSTALLABLE_CONSTRAINTS) && option)
     {
-     /*
-      * Skip constraints that do not involve the current option...
-      */
+      //
+      // Skip constraints that do not involve the current option...
+      //
 
       for (i = consts->num_constraints, constptr = consts->constraints;
           i > 0;
@@ -1028,11 +1035,11 @@ ppd_test_constraints(
           (!_ppd_strcasecmp(constptr->option->keyword, "PageSize") ||
            !_ppd_strcasecmp(constptr->option->keyword, "PageRegion")))
       {
-       /*
-        * PageSize and PageRegion are used depending on the selected input slot
-       * and manual feed mode.  Validate against the selected page size instead
-       * of an individual option...
-       */
+       //
+        // PageSize and PageRegion are used depending on the selected
+       // input slot and manual feed mode.  Validate against the
+       // selected page size instead of an individual option...
+       //
 
         if (option && choice &&
            (!_ppd_strcasecmp(option, "PageSize") ||
@@ -1078,11 +1085,12 @@ ppd_test_constraints(
       }
       else if (constptr->choice)
       {
-       /*
-        * Compare against the constrained choice...
-       */
+       //
+        // Compare against the constrained choice...
+       //
 
-        if (option && choice && !_ppd_strcasecmp(option, constptr->option->keyword))
+        if (option && choice &&
+           !_ppd_strcasecmp(option, constptr->option->keyword))
        {
          if (!_ppd_strncasecmp(choice, "Custom.", 7))
            value = "Custom";
@@ -1100,9 +1108,9 @@ ppd_test_constraints(
        else
          value = NULL;
 
-       /*
-        * Now check AP_FIRSTPAGE_option...
-       */
+       //
+        // Now check AP_FIRSTPAGE_option...
+       //
 
         snprintf(firstpage, sizeof(firstpage), "AP_FIRSTPAGE_%s",
                 constptr->option->keyword);
index 250c03668e084bf3b635d840f86b3352fa4d9ee1..da6cd355ce93b1f1caf5bd6dc717f0e55005b4b7 100644 (file)
@@ -1,35 +1,35 @@
-/*
- * PPD custom option routines for libppd.
- *
- * Copyright 2007-2015 by Apple Inc.
- * Copyright 1997-2006 by Easy Software Products, all rights reserved.
- *
- * Licensed under Apache License v2.0.  See the file "LICENSE" for more
- * information.
- *
- * PostScript is a trademark of Adobe Systems, Inc.
- */
-
-/*
- * Include necessary headers.
- */
+//
+// PPD custom option routines for libppd.
+//
+// Copyright 2007-2015 by Apple Inc.
+// Copyright 1997-2006 by Easy Software Products, all rights reserved.
+//
+// Licensed under Apache License v2.0.  See the file "LICENSE" for more
+// information.
+//
+// PostScript is a trademark of Adobe Systems, Inc.
+//
+
+//
+// Include necessary headers.
+//
 
 #include "string-private.h"
 #include "ppd.h"
 #include "debug-internal.h"
 
 
-/*
- * 'ppdFindCustomOption()' - Find a custom option.
- *
- * @since CUPS 1.2/macOS 10.5@
- */
+//
+// 'ppdFindCustomOption()' - Find a custom option.
+//
+// @since CUPS 1.2/macOS 10.5@
+//
 
-ppd_coption_t *                                /* O - Custom option or NULL */
-ppdFindCustomOption(ppd_file_t *ppd,   /* I - PPD file */
-                    const char *keyword)/* I - Custom option name */
+ppd_coption_t *                                // O - Custom option or NULL
+ppdFindCustomOption(ppd_file_t *ppd,   // I - PPD file
+                    const char *keyword)// I - Custom option name
 {
-  ppd_coption_t        key;                    /* Custom option search key */
+  ppd_coption_t        key;                    // Custom option search key
 
 
   if (!ppd)
@@ -40,17 +40,17 @@ ppdFindCustomOption(ppd_file_t *ppd,        /* I - PPD file */
 }
 
 
-/*
- * 'ppdFindCustomParam()' - Find a parameter for a custom option.
- *
- * @since CUPS 1.2/macOS 10.5@
- */
+//
+// 'ppdFindCustomParam()' - Find a parameter for a custom option.
+//
+// @since CUPS 1.2/macOS 10.5@
+//
 
-ppd_cparam_t *                         /* O - Custom parameter or NULL */
-ppdFindCustomParam(ppd_coption_t *opt, /* I - Custom option */
-                   const char    *name)        /* I - Parameter name */
+ppd_cparam_t *                         // O - Custom parameter or NULL
+ppdFindCustomParam(ppd_coption_t *opt, // I - Custom option
+                   const char    *name)        // I - Parameter name
 {
-  ppd_cparam_t *param;                 /* Current custom parameter */
+  ppd_cparam_t *param;                 // Current custom parameter
 
 
   if (!opt)
@@ -66,14 +66,14 @@ ppdFindCustomParam(ppd_coption_t *opt,      /* I - Custom option */
 }
 
 
-/*
- * 'ppdFirstCustomParam()' - Return the first parameter for a custom option.
- *
- * @since CUPS 1.2/macOS 10.5@
- */
+//
+// 'ppdFirstCustomParam()' - Return the first parameter for a custom option.
+//
+// @since CUPS 1.2/macOS 10.5@
+//
 
-ppd_cparam_t *                         /* O - Custom parameter or NULL */
-ppdFirstCustomParam(ppd_coption_t *opt)        /* I - Custom option */
+ppd_cparam_t *                         // O - Custom parameter or NULL
+ppdFirstCustomParam(ppd_coption_t *opt)        // I - Custom option
 {
   if (!opt)
     return (NULL);
@@ -82,14 +82,14 @@ ppdFirstCustomParam(ppd_coption_t *opt)     /* I - Custom option */
 }
 
 
-/*
- * 'ppdNextCustomParam()' - Return the next parameter for a custom option.
- *
- * @since CUPS 1.2/macOS 10.5@
- */
+//
+// 'ppdNextCustomParam()' - Return the next parameter for a custom option.
+//
+// @since CUPS 1.2/macOS 10.5@
+//
 
-ppd_cparam_t *                         /* O - Custom parameter or NULL */
-ppdNextCustomParam(ppd_coption_t *opt) /* I - Custom option */
+ppd_cparam_t *                         // O - Custom parameter or NULL
+ppdNextCustomParam(ppd_coption_t *opt) // I - Custom option
 {
   if (!opt)
     return (NULL);
index cf9afd632e0fb397107700f92d38a3fc8f6118f4..a3ea6f128688e8b1e29804d53a5312deafa489d4 100644 (file)
@@ -1,18 +1,18 @@
-/*
- * PPD code emission routines for libppd.
- *
- * Copyright 2007-2019 by Apple Inc.
- * Copyright 1997-2007 by Easy Software Products, all rights reserved.
- *
- * Licensed under Apache License v2.0.  See the file "LICENSE" for more
- * information.
- *
- * PostScript is a trademark of Adobe Systems, Inc.
- */
-
-/*
- * Include necessary headers...
- */
+//
+// PPD code emission routines for libppd.
+//
+// Copyright 2007-2019 by Apple Inc.
+// Copyright 1997-2007 by Easy Software Products, all rights reserved.
+//
+// Licensed under Apache License v2.0.  See the file "LICENSE" for more
+// information.
+//
+// PostScript is a trademark of Adobe Systems, Inc.
+//
+
+//
+// Include necessary headers...
+//
 
 #include "string-private.h"
 #include "debug-internal.h"
 #  include <io.h>
 #else
 #  include <unistd.h>
-#endif /* _WIN32 || __EMX__ */
+#endif // _WIN32 || __EMX__
 #include <errno.h>
 #include <ctype.h>
 #include <string.h>
 
 
-/*
- * Local functions...
- */
+//
+// Local functions...
+//
 
 static int     ppd_compare_cparams(ppd_cparam_t *a, ppd_cparam_t *b);
 
 
-/*
- * Local globals...
- */
+//
+// Local globals...
+//
 
 static const char ppd_custom_code[] =
                "pop pop pop\n"
                "<</PageSize[5 -2 roll]/ImagingBBox null>>setpagedevice\n";
 
 
-/*
- * 'ppdCollect()' - Collect all marked options that reside in the specified
- *                  section.
- *
- * The choices array should be freed using @code free@ when you are
- * finished with it.
- */
+//
+// 'ppdCollect()' - Collect all marked options that reside in the specified
+//                  section.
+//
+// The choices array should be freed using @code free@ when you are
+// finished with it.
+//
 
-int                                    /* O - Number of options marked */
-ppdCollect(ppd_file_t    *ppd,         /* I - PPD file data */
-           ppd_section_t section,      /* I - Section to collect */
-           ppd_choice_t  ***choices)   /* O - Pointers to choices */
+int                                    // O - Number of options marked
+ppdCollect(ppd_file_t    *ppd,         // I - PPD file data
+           ppd_section_t section,      // I - Section to collect
+           ppd_choice_t  ***choices)   // O - Pointers to choices
 {
   return (ppdCollect2(ppd, section, 0.0, choices));
 }
 
 
-/*
- * 'ppdCollect2()' - Collect all marked options that reside in the
- *                   specified section and minimum order.
- *
- * The choices array should be freed using @code free@ when you are
- * finished with it.
- *
- * @since CUPS 1.2/macOS 10.5@
- */
-
-int                                    /* O - Number of options marked */
-ppdCollect2(ppd_file_t    *ppd,                /* I - PPD file data */
-            ppd_section_t section,     /* I - Section to collect */
-           float         min_order,    /* I - Minimum OrderDependency value */
-            ppd_choice_t  ***choices)  /* O - Pointers to choices */
+//
+// 'ppdCollect2()' - Collect all marked options that reside in the
+//                   specified section and minimum order.
+//
+// The choices array should be freed using @code free@ when you are
+// finished with it.
+//
+// @since CUPS 1.2/macOS 10.5@
+//
+
+int                                    // O - Number of options marked
+ppdCollect2(ppd_file_t    *ppd,                // I - PPD file data
+            ppd_section_t section,     // I - Section to collect
+           float         min_order,    // I - Minimum OrderDependency value
+            ppd_choice_t  ***choices)  // O - Pointers to choices
 {
-  ppd_choice_t *c;                     /* Current choice */
-  ppd_section_t        csection;               /* Current section */
-  float                corder;                 /* Current OrderDependency value */
-  int          count;                  /* Number of choices collected */
-  ppd_choice_t **collect;              /* Collected choices */
-  float                *orders;                /* Collected order values */
+  ppd_choice_t *c;                     // Current choice
+  ppd_section_t        csection;               // Current section
+  float                corder;                 // Current OrderDependency value
+  int          count;                  // Number of choices collected
+  ppd_choice_t **collect;              // Collected choices
+  float                *orders;                // Collected order values
 
 
   DEBUG_printf(("ppdCollect2(ppd=%p, section=%d, min_order=%f, choices=%p)",
@@ -95,9 +95,9 @@ ppdCollect2(ppd_file_t    *ppd,               /* I - PPD file data */
     return (0);
   }
 
- /*
-  * Allocate memory for up to N selected choices...
-  */
+  //
+  // Allocate memory for up to N selected choices...
+  //
 
   count = 0;
   if ((collect = calloc(sizeof(ppd_choice_t *),
@@ -107,16 +107,17 @@ ppdCollect2(ppd_file_t    *ppd,           /* I - PPD file data */
     return (0);
   }
 
-  if ((orders = calloc(sizeof(float), (size_t)cupsArrayCount(ppd->marked))) == NULL)
+  if ((orders = calloc(sizeof(float),
+                      (size_t)cupsArrayCount(ppd->marked))) == NULL)
   {
     *choices = NULL;
     free(collect);
     return (0);
   }
 
- /*
-  * Loop through all options and add choices as needed...
-  */
+  //
+  // Loop through all options and add choices as needed...
+  //
 
   for (c = (ppd_choice_t *)cupsArrayFirst(ppd->marked);
        c;
@@ -127,12 +128,12 @@ ppdCollect2(ppd_file_t    *ppd,           /* I - PPD file data */
 
     if (!strcmp(c->choice, "Custom"))
     {
-      ppd_attr_t       *attr;          /* NonUIOrderDependency value */
-      float            aorder;         /* Order value */
-      char             asection[17],   /* Section name */
+      ppd_attr_t       *attr;          // NonUIOrderDependency value
+      float            aorder;         // Order value
+      char             asection[17],   // Section name
                        amain[PPD_MAX_NAME + 1],
                        aoption[PPD_MAX_NAME];
-                                       /* *CustomFoo and True */
+                                       // *CustomFoo and True
 
 
       for (attr = ppdFindAttr(ppd, "NonUIOrderDependency", NULL);
@@ -144,9 +145,9 @@ ppdCollect2(ppd_file_t    *ppd,             /* I - PPD file data */
            !strncmp(amain, "*Custom", 7) &&
            !strcmp(amain + 7, c->option->keyword) && !strcmp(aoption, "True"))
        {
-        /*
-         * Use this NonUIOrderDependency...
-         */
+         //
+         // Use this NonUIOrderDependency...
+         //
 
           corder = aorder;
 
@@ -162,7 +163,6 @@ ppdCollect2(ppd_file_t    *ppd,             /* I - PPD file data */
            csection = PPD_ORDER_PROLOG;
          else
            csection = PPD_ORDER_ANY;
-
          break;
        }
     }
@@ -175,13 +175,13 @@ ppdCollect2(ppd_file_t    *ppd,           /* I - PPD file data */
     }
   }
 
- /*
-  * If we have more than 1 marked choice, sort them...
-  */
+  //
+  // If we have more than 1 marked choice, sort them...
+  //
 
   if (count > 1)
   {
-    int i, j;                          /* Looping vars */
+    int i, j;                          // Looping vars
 
     for (i = 0; i < (count - 1); i ++)
       for (j = i + 1; j < count; j ++)
@@ -200,10 +200,10 @@ ppdCollect2(ppd_file_t    *ppd,           /* I - PPD file data */
 
   DEBUG_printf(("2ppdCollect2: %d marked choices...", count));
 
- /*
-  * Return the array and number of choices; if 0, free the array since
-  * it isn't needed.
-  */
+  //
+  // Return the array and number of choices; if 0, free the array since
+  // it isn't needed.
+  //
 
   if (count > 0)
   {
@@ -219,58 +219,59 @@ ppdCollect2(ppd_file_t    *ppd,           /* I - PPD file data */
 }
 
 
-/*
- * 'ppdEmit()' - Emit code for marked options to a file.
- */
+//
+// 'ppdEmit()' - Emit code for marked options to a file.
+//
 
-int                                    /* O - 0 on success, -1 on failure */
-ppdEmit(ppd_file_t    *ppd,            /* I - PPD file record */
-        FILE          *fp,             /* I - File to write to */
-        ppd_section_t section)         /* I - Section to write */
+int                                    // O - 0 on success, -1 on failure
+ppdEmit(ppd_file_t    *ppd,            // I - PPD file record
+        FILE          *fp,             // I - File to write to
+        ppd_section_t section)         // I - Section to write
 {
   return (ppdEmitAfterOrder(ppd, fp, section, 0, 0.0));
 }
 
 
-/*
- * 'ppdEmitAfterOrder()' - Emit a subset of the code for marked options to a file.
- *
- * When "limit" is non-zero, this function only emits options whose
- * OrderDependency value is greater than or equal to "min_order".
- *
- * When "limit" is zero, this function is identical to ppdEmit().
- *
- * @since CUPS 1.2/macOS 10.5@
- */
+//
+// 'ppdEmitAfterOrder()' - Emit a subset of the code for marked options
+//                         to a file.
+//
+// When "limit" is non-zero, this function only emits options whose
+// OrderDependency value is greater than or equal to "min_order".
+//
+// When "limit" is zero, this function is identical to ppdEmit().
+//
+// @since CUPS 1.2/macOS 10.5@
+//
 
-int                                    /* O - 0 on success, -1 on failure */
+int                                    // O - 0 on success, -1 on failure
 ppdEmitAfterOrder(
-    ppd_file_t    *ppd,                        /* I - PPD file record */
-    FILE          *fp,                 /* I - File to write to */
-    ppd_section_t section,             /* I - Section to write */
-    int                  limit,                /* I - Non-zero to use min_order */
-    float         min_order)           /* I - Lowest OrderDependency */
+    ppd_file_t    *ppd,                        // I - PPD file record
+    FILE          *fp,                 // I - File to write to
+    ppd_section_t section,             // I - Section to write
+    int                  limit,                // I - Non-zero to use min_order
+    float         min_order)           // I - Lowest OrderDependency
 {
-  char *buffer;                        /* Option code */
-  int  status;                         /* Return status */
+  char *buffer;                        // Option code
+  int  status;                         // Return status
 
 
- /*
-  * Range check input...
-  */
+  //
+  // Range check input...
+  //
 
   if (!ppd || !fp)
     return (-1);
 
- /*
-  * Get the string...
-  */
+  //
+  // Get the string...
+  //
 
   buffer = ppdEmitString(ppd, section, limit ? min_order : 0.0f);
 
- /*
-  * Write it as needed and return...
-  */
+  //
+  // Write it as needed and return...
+  //
 
   if (buffer)
   {
@@ -285,38 +286,38 @@ ppdEmitAfterOrder(
 }
 
 
-/*
- * 'ppdEmitFd()' - Emit code for marked options to a file.
- */
+//
+// 'ppdEmitFd()' - Emit code for marked options to a file.
+//
 
-int                                    /* O - 0 on success, -1 on failure */
-ppdEmitFd(ppd_file_t    *ppd,          /* I - PPD file record */
-          int           fd,            /* I - File to write to */
-          ppd_section_t section)       /* I - Section to write */
+int                                    // O - 0 on success, -1 on failure
+ppdEmitFd(ppd_file_t    *ppd,          // I - PPD file record
+          int           fd,            // I - File to write to
+          ppd_section_t section)       // I - Section to write
 {
-  char         *buffer,                /* Option code */
-               *bufptr;                /* Pointer into code */
-  size_t       buflength;              /* Length of option code */
-  ssize_t      bytes;                  /* Bytes written */
-  int          status;                 /* Return status */
+  char         *buffer,                // Option code
+               *bufptr;                // Pointer into code
+  size_t       buflength;              // Length of option code
+  ssize_t      bytes;                  // Bytes written
+  int          status;                 // Return status
 
 
- /*
-  * Range check input...
-  */
+  //
+  // Range check input...
+  //
 
   if (!ppd || fd < 0)
     return (-1);
 
- /*
-  * Get the string...
-  */
+  //
+  // Get the string...
+  //
 
   buffer = ppdEmitString(ppd, section, 0.0);
 
- /*
-  * Write it as needed and return...
-  */
+  //
+  // Write it as needed and return...
+  //
 
   if (buffer)
   {
@@ -330,7 +331,7 @@ ppdEmitFd(ppd_file_t    *ppd,               /* I - PPD file record */
       if ((bytes = (ssize_t)write(fd, bufptr, (unsigned)buflength)) < 0)
 #else
       if ((bytes = write(fd, bufptr, buflength)) < 0)
-#endif /* _WIN32 */
+#endif // _WIN32
       {
         if (errno == EAGAIN || errno == EINTR)
          continue;
@@ -353,48 +354,47 @@ ppdEmitFd(ppd_file_t    *ppd,             /* I - PPD file record */
 }
 
 
-/*
- * 'ppdEmitJCL()' - Emit code for JCL options to a file (for PostScript
- *                  output).
- */
+//
+// 'ppdEmitJCL()' - Emit code for JCL options to a file (for PostScript
+//                  output).
+//
 
-int                                    /* O - 0 on success, -1 on failure */
-ppdEmitJCL(ppd_file_t *ppd,            /* I - PPD file record */
-           FILE       *fp,             /* I - File to write to */
-           int        job_id,          /* I - Job ID */
-          const char *user,            /* I - Username */
-          const char *title)           /* I - Title */
+int                                    // O - 0 on success, -1 on failure
+ppdEmitJCL(ppd_file_t *ppd,            // I - PPD file record
+           FILE       *fp,             // I - File to write to
+           int        job_id,          // I - Job ID
+          const char *user,            // I - Username
+          const char *title)           // I - Title
 {
   return ppdEmitJCLPDF(ppd, fp, job_id, user, title, -1, false);
 }
 
 
-/*
- * 'ppdEmitJCLPDF()' - Emit code for JCL options to a file (for PDF output).
- */
-
-int                                    /* O - 0 on success, -1 on failure */
-ppdEmitJCLPDF(ppd_file_t *ppd,         /* I - PPD file record */
-             FILE       *fp,           /* I - File to write to */
-             int        job_id,        /* I - Job ID */
-             const char *user,         /* I - Username */
-             const char *title,        /* I - Title */
-             int hw_copies,            /* I - Number of hardware (device)
-                                              copies, -1: PS mode */
-             bool hw_collate)          /* I - Do we have hardware (device)
-                                              collate? */
+//
+// 'ppdEmitJCLPDF()' - Emit code for JCL options to a file (for PDF output).
+//
+
+int                                    // O - 0 on success, -1 on failure
+ppdEmitJCLPDF(ppd_file_t *ppd,         // I - PPD file record
+             FILE       *fp,           // I - File to write to
+             int        job_id,        // I - Job ID
+             const char *user,         // I - Username
+             const char *title,        // I - Title
+             int hw_copies,            // I - Number of hardware (device)
+                                       //     copies, -1: PS mode
+             bool hw_collate)          // I - Do we have hardware (device)
+                                       //     collate?
 {
-  ppd_attr_t    *attr;                  /* PPD attribute */
+  ppd_attr_t    *attr;                  // PPD attribute
   const char    *jcl_pdf = NULL;
-  char         *ptr;                   /* Pointer into JCL string */
-  char         temp[65],               /* Local title string */
-               displaymsg[33];         /* Local display string */
-
+  char         *ptr;                   // Pointer into JCL string
+  char         temp[65],               // Local title string
+               displaymsg[33];         // Local display string
 
- /*
-  * Range check the input...
-  */
 
+  //
+  // Range check the input...
+  //
 
   if (!ppd || !ppd->jcl_begin)
     return (0);
@@ -410,23 +410,23 @@ ppdEmitJCLPDF(ppd_file_t *ppd,            /* I - PPD file record */
       (!jcl_pdf && hw_copies >= 0))
     return (0);
 
- /*
-  * See if the printer supports HP PJL...
-  */
+  //
+  // See if the printer supports HP PJL...
+  //
 
   if (!strncmp(ppd->jcl_begin, "\033%-12345X@", 10))
   {
-   /*
-    * This printer uses HP PJL commands for output; filter the output
-    * so that we only have a single "@PJL JOB" command in the header...
-    *
-    * To avoid bugs in the PJL implementation of certain vendors' products
-    * (Xerox in particular), we add a dummy "@PJL" command at the beginning
-    * of the PJL commands to initialize PJL processing.
-    */
+    //
+    // This printer uses HP PJL commands for output; filter the output
+    // so that we only have a single "@PJL JOB" command in the header...
+    //
+    // To avoid bugs in the PJL implementation of certain vendors' products
+    // (Xerox in particular), we add a dummy "@PJL" command at the beginning
+    // of the PJL commands to initialize PJL processing.
+    //
 
-    ppd_attr_t *charset;               /* PJL charset */
-    ppd_attr_t *display;               /* PJL display command */
+    ppd_attr_t *charset;               // PJL charset
+    ppd_attr_t *display;               // PJL display command
 
 
     if ((charset = ppdFindAttr(ppd, "cupsPJLCharset", NULL)) != NULL)
@@ -445,9 +445,9 @@ ppdEmitJCLPDF(ppd_file_t *ppd,              /* I - PPD file record */
     for (ptr = ppd->jcl_begin + 9; *ptr;)
       if (!strncmp(ptr, "@PJL JOB", 8))
       {
-       /*
-        * Skip job command...
-       */
+       //
+        // Skip job command...
+       //
 
         for (;*ptr; ptr ++)
          if (*ptr == '\n')
@@ -458,9 +458,9 @@ ppdEmitJCLPDF(ppd_file_t *ppd,              /* I - PPD file record */
       }
       else
       {
-       /*
-        * Copy line...
-       */
+       //
+        // Copy line...
+       //
 
         for (;*ptr; ptr ++)
        {
@@ -473,27 +473,27 @@ ppdEmitJCLPDF(ppd_file_t *ppd,            /* I - PPD file record */
          ptr ++;
       }
 
-   /*
-    * Clean up the job title...
-    */
+    //
+    // Clean up the job title...
+    //
 
     if (!title)
       title = "Unknown";
 
     if ((ptr = strrchr(title, '/')) != NULL)
     {
-     /*
-      * Only show basename of file path...
-      */
+      //
+      // Only show basename of file path...
+      //
 
       title = ptr + 1;
     }
 
     if (!strncmp(title, "smbprn.", 7))
     {
-     /*
-      * Skip leading smbprn.######## from Samba jobs...
-      */
+      //
+      // Skip leading smbprn.######## from Samba jobs...
+      //
 
       for (title += 7; *title && isdigit(*title & 255); title ++);
       while (_ppd_isspace(*title))
@@ -501,18 +501,18 @@ ppdEmitJCLPDF(ppd_file_t *ppd,            /* I - PPD file record */
 
       if ((ptr = strstr(title, " - ")) != NULL)
       {
-       /*
-       * Skip application name in "Some Application - Title of job"...
-       */
+       //
+       // Skip application name in "Some Application - Title of job"...
+       //
 
        title = ptr + 3;
       }
     }
 
-   /*
-    * Replace double quotes with single quotes and UTF-8 characters with
-    * question marks so that the title does not cause a PJL syntax error.
-    */
+    //
+    // Replace double quotes with single quotes and UTF-8 characters with
+    // question marks so that the title does not cause a PJL syntax error.
+    //
 
     strlcpy(temp, title, sizeof(temp));
 
@@ -522,21 +522,22 @@ ppdEmitJCLPDF(ppd_file_t *ppd,            /* I - PPD file record */
       else if (!charset && (*ptr & 128))
         *ptr = '?';
 
-   /*
-    * CUPS STR #3125: Long PJL JOB NAME causes problems with some printers
-    *
-    * Generate the display message, truncating at 32 characters + nul to avoid
-    * issues with some printer's PJL implementations...
-    */
+    //
+    // CUPS STR #3125: Long PJL JOB NAME causes problems with some printers
+    //
+    // Generate the display message, truncating at 32 characters + nul to avoid
+    // issues with some printer's PJL implementations...
+    //
 
     if (!user)
       user = "anonymous";
 
-    snprintf(displaymsg, sizeof(displaymsg), "%d %.8s %.17s", job_id, user, temp);
+    snprintf(displaymsg, sizeof(displaymsg), "%d %.8s %.17s", job_id, user,
+            temp);
 
-   /*
-    * Send PJL JOB and PJL RDYMSG commands before we enter PostScript mode...
-    */
+    //
+    // Send PJL JOB and PJL RDYMSG commands before we enter PostScript mode...
+    //
 
     if (display && strcmp(display->value, "job"))
       fprintf(fp, "@PJL JOB NAME = \"%s\"\n", temp);
@@ -546,10 +547,10 @@ ppdEmitJCLPDF(ppd_file_t *ppd,            /* I - PPD file record */
       fprintf(fp, "@PJL JOB NAME = \"%s\" DISPLAY = \"%s\"\n", temp,
              displaymsg);
 
-   /*
-    * Replace double quotes with single quotes and UTF-8 characters with
-    * question marks so that the user does not cause a PJL syntax error.
-    */
+    //
+    // Replace double quotes with single quotes and UTF-8 characters with
+    // question marks so that the user does not cause a PJL syntax error.
+    //
 
     strlcpy(temp, user, sizeof(temp));
 
@@ -567,23 +568,23 @@ ppdEmitJCLPDF(ppd_file_t *ppd,            /* I - PPD file record */
   ppdEmit(ppd, fp, PPD_ORDER_JCL);
 
   if (hw_copies < 0)
-    /* PostScript output */
+    // PostScript output
     fputs(ppd->jcl_ps, fp);
   else
   {
-    /* PDF output */
+    // PDF output
 
     int hw_copies_done = 0;
 
-    /* There is a "Copies" option in the PPD file, so this option setting
-       always takes care of correct implementation of the copies */
+    // There is a "Copies" option in the PPD file, so this option setting
+    // always takes care of correct implementation of the copies
     if (ppdFindOption(ppd,"Copies") != NULL &&
        hw_copies > 1)
       hw_copies_done = 1;
 
     if (hw_copies > 1 && hw_copies_done == 0 && // HW copies
        strncmp(ppd->jcl_begin, "\033%-12345X@", 10) == 0) // PJL
-      /* Add a PJL command to implement the hardware copies */
+      // Add a PJL command to implement the hardware copies
       fprintf(fp, "@PJL SET %s=%d\n", hw_collate ? "QTY" : "COPIES",
              hw_copies);
 
@@ -594,19 +595,19 @@ ppdEmitJCLPDF(ppd_file_t *ppd,            /* I - PPD file record */
 }
 
 
-/*
- * 'ppdEmitJCLEnd()' - Emit JCLEnd code to a file.
- *
- * @since CUPS 1.2/macOS 10.5@
- */
+//
+// 'ppdEmitJCLEnd()' - Emit JCLEnd code to a file.
+//
+// @since CUPS 1.2/macOS 10.5@
+//
 
-int                                    /* O - 0 on success, -1 on failure */
-ppdEmitJCLEnd(ppd_file_t *ppd,         /* I - PPD file record */
-              FILE       *fp)          /* I - File to write to */
+int                                    // O - 0 on success, -1 on failure
+ppdEmitJCLEnd(ppd_file_t *ppd,         // I - PPD file record
+              FILE       *fp)          // I - File to write to
 {
- /*
-  * Range check the input...
-  */
+  //
+  // Range check the input...
+  //
 
   if (!ppd)
     return (0);
@@ -619,20 +620,20 @@ ppdEmitJCLEnd(ppd_file_t *ppd,            /* I - PPD file record */
     return (0);
   }
 
- /*
-  * See if the printer supports HP PJL...
-  */
+  //
+  // See if the printer supports HP PJL...
+  //
 
   if (!strncmp(ppd->jcl_end, "\033%-12345X@", 10))
   {
-   /*
-    * This printer uses HP PJL commands for output; filter the output
-    * so that we only have a single "@PJL JOB" command in the header...
-    *
-    * To avoid bugs in the PJL implementation of certain vendors' products
-    * (Xerox in particular), we add a dummy "@PJL" command at the beginning
-    * of the PJL commands to initialize PJL processing.
-    */
+    //
+    // This printer uses HP PJL commands for output; filter the output
+    // so that we only have a single "@PJL JOB" command in the header...
+    //
+    // To avoid bugs in the PJL implementation of certain vendors' products
+    // (Xerox in particular), we add a dummy "@PJL" command at the beginning
+    // of the PJL commands to initialize PJL processing.
+    //
 
     fputs("\033%-12345X@PJL\n", fp);
     fputs("@PJL RDYMSG DISPLAY = \"\"\n", fp);
@@ -645,65 +646,65 @@ ppdEmitJCLEnd(ppd_file_t *ppd,            /* I - PPD file record */
 }
 
 
-/*
- * 'ppdEmitString()' - Get a string containing the code for marked options.
- *
- * When "min_order" is greater than zero, this function only includes options
- * whose OrderDependency value is greater than or equal to "min_order".
- * Otherwise, all options in the specified section are included in the
- * returned string.
- *
- * The return string is allocated on the heap and should be freed using
- * @code free@ when you are done with it.
- *
- * @since CUPS 1.2/macOS 10.5@
- */
-
-char *                                 /* O - String containing option code or @code NULL@ if there is no option code */
-ppdEmitString(ppd_file_t    *ppd,      /* I - PPD file record */
-              ppd_section_t section,   /* I - Section to write */
-             float         min_order)  /* I - Lowest OrderDependency */
+//
+// 'ppdEmitString()' - Get a string containing the code for marked options.
+//
+// When "min_order" is greater than zero, this function only includes options
+// whose OrderDependency value is greater than or equal to "min_order".
+// Otherwise, all options in the specified section are included in the
+// returned string.
+//
+// The return string is allocated on the heap and should be freed using
+// @code free@ when you are done with it.
+//
+// @since CUPS 1.2/macOS 10.5@
+//
+
+char *                                 // O - String containing option code or @code NULL@ if there is no option code
+ppdEmitString(ppd_file_t    *ppd,      // I - PPD file record
+              ppd_section_t section,   // I - Section to write
+             float         min_order)  // I - Lowest OrderDependency
 {
-  int          i, j,                   /* Looping vars */
-               count;                  /* Number of choices */
-  ppd_choice_t **choices;              /* Choices */
-  ppd_size_t   *size;                  /* Custom page size */
-  ppd_coption_t        *coption;               /* Custom option */
-  ppd_cparam_t *cparam;                /* Custom parameter */
-  size_t       bufsize;                /* Size of string buffer needed */
-  char         *buffer,                /* String buffer */
-               *bufptr,                /* Pointer into buffer */
-               *bufend;                /* End of buffer */
-  struct lconv *loc;                   /* Locale data */
+  int          i, j,                   // Looping vars
+               count;                  // Number of choices
+  ppd_choice_t **choices;              // Choices
+  ppd_size_t   *size;                  // Custom page size
+  ppd_coption_t        *coption;               // Custom option
+  ppd_cparam_t *cparam;                // Custom parameter
+  size_t       bufsize;                // Size of string buffer needed
+  char         *buffer,                // String buffer
+               *bufptr,                // Pointer into buffer
+               *bufend;                // End of buffer
+  struct lconv *loc;                   // Locale data
 
 
   DEBUG_printf(("ppdEmitString(ppd=%p, section=%d, min_order=%f)",
                 ppd, section, min_order));
 
- /*
-  * Range check input...
-  */
+  //
+  // Range check input...
+  //
 
   if (!ppd)
     return (NULL);
 
- /*
-  * Use PageSize or PageRegion as required...
-  */
+  //
+  // Use PageSize or PageRegion as required...
+  //
 
   ppdHandleMedia(ppd);
 
- /*
-  * Collect the options we need to emit...
-  */
+  //
+  // Collect the options we need to emit...
+  //
 
   if ((count = ppdCollect2(ppd, section, min_order, &choices)) == 0)
     return (NULL);
 
- /*
-  * Count the number of bytes that are required to hold all of the
-  * option code...
-  */
+  //
+  // Count the number of bytes that are required to hold all of the
+  // option code...
+  //
 
   for (i = 0, bufsize = 1; i < count; i ++)
   {
@@ -713,9 +714,9 @@ ppdEmitString(ppd_file_t    *ppd,   /* I - PPD file record */
          (coption = ppdFindCustomOption(ppd, choices[i]->option->keyword))
              != NULL)
       {
-       /*
-        * Add space to account for custom parameter substitution...
-       */
+       //
+        // Add space to account for custom parameter substitution...
+       //
 
         for (cparam = (ppd_cparam_t *)cupsArrayFirst(coption->params);
             cparam;
@@ -746,7 +747,7 @@ ppdEmitString(ppd_file_t    *ppd,   /* I - PPD file record */
     }
     else if (section != PPD_ORDER_EXIT)
     {
-      bufsize += 3;                    /* [{\n */
+      bufsize += 3;                    // [{\n
 
       if ((!_ppd_strcasecmp(choices[i]->option->keyword, "PageSize") ||
            !_ppd_strcasecmp(choices[i]->option->keyword, "PageRegion")) &&
@@ -754,8 +755,8 @@ ppdEmitString(ppd_file_t    *ppd,   /* I - PPD file record */
       {
         DEBUG_puts("2ppdEmitString: Custom size set!");
 
-        bufsize += 37;                 /* %%BeginFeature: *CustomPageSize True\n */
-        bufsize += 50;                 /* Five 9-digit numbers + newline */
+        bufsize += 37;               // %%BeginFeature: *CustomPageSize True\n
+        bufsize += 50;               // Five 9-digit numbers + newline
       }
       else if (!_ppd_strcasecmp(choices[i]->choice, "Custom") &&
                (coption = ppdFindCustomOption(ppd,
@@ -763,7 +764,7 @@ ppdEmitString(ppd_file_t    *ppd,   /* I - PPD file record */
                   != NULL)
       {
         bufsize += 23 + strlen(choices[i]->option->keyword) + 6;
-                                       /* %%BeginFeature: *Customkeyword True\n */
+                                       // %%BeginFeature: *Customkeyword True\n
 
 
         for (cparam = (ppd_cparam_t *)cupsArrayFirst(coption->params);
@@ -796,10 +797,10 @@ ppdEmitString(ppd_file_t    *ppd, /* I - PPD file record */
       else
         bufsize += 17 + strlen(choices[i]->option->keyword) + 1 +
                   strlen(choices[i]->choice) + 1;
-                                       /* %%BeginFeature: *keyword choice\n */
+                                       // %%BeginFeature: *keyword choice\n
 
-      bufsize += 13;                   /* %%EndFeature\n */
-      bufsize += 22;                   /* } stopped cleartomark\n */
+      bufsize += 13;                   // %%EndFeature\n
+      bufsize += 22;                   // } stopped cleartomark\n
     }
 
     if (choices[i]->code)
@@ -808,9 +809,9 @@ ppdEmitString(ppd_file_t    *ppd,   /* I - PPD file record */
       bufsize += strlen(ppd_custom_code);
   }
 
- /*
-  * Allocate memory...
-  */
+  //
+  // Allocate memory...
+  //
 
   DEBUG_printf(("2ppdEmitString: Allocating %d bytes for string...",
                 (int)bufsize));
@@ -824,9 +825,9 @@ ppdEmitString(ppd_file_t    *ppd,   /* I - PPD file record */
   bufend = buffer + bufsize - 1;
   loc    = localeconv();
 
- /*
-  * Copy the option code to the buffer...
-  */
+  //
+  // Copy the option code to the buffer...
+  //
 
   for (i = 0, bufptr = buffer; i < count; i ++, bufptr += strlen(bufptr))
     if (section == PPD_ORDER_JCL)
@@ -836,12 +837,12 @@ ppdEmitString(ppd_file_t    *ppd, /* I - PPD file record */
           (coption = ppdFindCustomOption(ppd, choices[i]->option->keyword))
              != NULL)
       {
-       /*
-        * Handle substitutions in custom JCL options...
-       */
+       //
+        // Handle substitutions in custom JCL options...
+       //
 
-       char    *cptr;                  /* Pointer into code */
-       int     pnum;                   /* Parameter number */
+       char    *cptr;                  // Pointer into code
+       int     pnum;                   // Parameter number
 
 
         for (cptr = choices[i]->code; *cptr && bufptr < bufend;)
@@ -852,9 +853,9 @@ ppdEmitString(ppd_file_t    *ppd,   /* I - PPD file record */
 
            if (isdigit(*cptr & 255))
            {
-            /*
-             * Substitute parameter...
-             */
+             //
+             // Substitute parameter...
+             //
 
               pnum = *cptr++ - '0';
              while (isdigit(*cptr & 255))
@@ -883,7 +884,8 @@ ppdEmitString(ppd_file_t    *ppd,   /* I - PPD file record */
                      break;
 
                  case PPD_CUSTOM_INT :
-                     snprintf(bufptr, (size_t)(bufend - bufptr), "%d", cparam->current.custom_int);
+                     snprintf(bufptr, (size_t)(bufend - bufptr), "%d",
+                              cparam->current.custom_int);
                      bufptr += strlen(bufptr);
                      break;
 
@@ -892,7 +894,8 @@ ppdEmitString(ppd_file_t    *ppd,   /* I - PPD file record */
                  case PPD_CUSTOM_STRING :
                      if (cparam->current.custom_string)
                      {
-                       strlcpy(bufptr, cparam->current.custom_string, (size_t)(bufend - bufptr));
+                       strlcpy(bufptr, cparam->current.custom_string,
+                               (size_t)(bufend - bufptr));
                        bufptr += strlen(bufptr);
                      }
                      break;
@@ -908,9 +911,9 @@ ppdEmitString(ppd_file_t    *ppd,   /* I - PPD file record */
       }
       else if (choices[i]->code)
       {
-       /*
-        * Otherwise just copy the option code directly...
-       */
+       //
+        // Otherwise just copy the option code directly...
+       //
 
         strlcpy(bufptr, choices[i]->code, (size_t)(bufend - bufptr + 1));
         bufptr += strlen(bufptr);
@@ -918,17 +921,17 @@ ppdEmitString(ppd_file_t    *ppd, /* I - PPD file record */
     }
     else if (section != PPD_ORDER_EXIT)
     {
-     /*
-      * Add wrapper commands to prevent printer errors for unsupported
-      * options...
-      */
+      //
+      // Add wrapper commands to prevent printer errors for unsupported
+      // options...
+      //
 
       strlcpy(bufptr, "[{\n", (size_t)(bufend - bufptr + 1));
       bufptr += 3;
 
-     /*
-      * Send DSC comments with option...
-      */
+      //
+      // Send DSC comments with option...
+      //
 
       DEBUG_printf(("2ppdEmitString: Adding code for %s=%s...",
                    choices[i]->option->keyword, choices[i]->choice));
@@ -937,18 +940,19 @@ ppdEmitString(ppd_file_t    *ppd, /* I - PPD file record */
            !_ppd_strcasecmp(choices[i]->option->keyword, "PageRegion")) &&
           !_ppd_strcasecmp(choices[i]->choice, "Custom"))
       {
-       /*
-        * Variable size; write out standard size options, using the
-       * parameter positions defined in the PPD file...
-       */
+       //
+        // Variable size; write out standard size options, using the
+       // parameter positions defined in the PPD file...
+       //
 
-        ppd_attr_t     *attr;          /* PPD attribute */
-       int             pos,            /* Position of custom value */
-                       orientation;    /* Orientation to use */
-       float           values[5];      /* Values for custom command */
+        ppd_attr_t     *attr;          // PPD attribute
+       int             pos,            // Position of custom value
+                       orientation;    // Orientation to use
+       float           values[5];      // Values for custom command
 
 
-        strlcpy(bufptr, "%%BeginFeature: *CustomPageSize True\n", (size_t)(bufend - bufptr + 1));
+        strlcpy(bufptr, "%%BeginFeature: *CustomPageSize True\n",
+               (size_t)(bufend - bufptr + 1));
         bufptr += 37;
 
         size = ppdPageSize(ppd, "Custom");
@@ -979,33 +983,33 @@ ppdEmitString(ppd_file_t    *ppd, /* I - PPD file record */
 
        values[pos] = size->length;
 
-       /*
-        * According to the Adobe PPD specification, an orientation of 1
-       * will produce a print that comes out upside-down with the X
-       * axis perpendicular to the direction of feed, which is exactly
-       * what we want to be consistent with non-PS printers.
-       *
-       * We could also use an orientation of 3 to produce output that
-       * comes out rightside-up (this is the default for many large format
-       * printer PPDs), however for consistency we will stick with the
-       * value 1.
-       *
-       * If we wanted to get fancy, we could use orientations of 0 or
-       * 2 and swap the width and length, however we don't want to get
-       * fancy, we just want it to work consistently.
-       *
-       * The orientation value is range limited by the Orientation
-       * parameter definition, so certain non-PS printer drivers that
-       * only support an Orientation of 0 will get the value 0 as
-       * expected.
-       */
+       //
+        // According to the Adobe PPD specification, an orientation of 1
+       // will produce a print that comes out upside-down with the X
+       // axis perpendicular to the direction of feed, which is exactly
+       // what we want to be consistent with non-PS printers.
+       //
+       // We could also use an orientation of 3 to produce output that
+       // comes out rightside-up (this is the default for many large format
+       // printer PPDs), however for consistency we will stick with the
+       // value 1.
+       //
+       // If we wanted to get fancy, we could use orientations of 0 or
+       // 2 and swap the width and length, however we don't want to get
+       // fancy, we just want it to work consistently.
+       //
+       // The orientation value is range limited by the Orientation
+       // parameter definition, so certain non-PS printer drivers that
+       // only support an Orientation of 0 will get the value 0 as
+       // expected.
+       //
 
         orientation = 1;
 
        if ((attr = ppdFindAttr(ppd, "ParamCustomPageSize",
                                "Orientation")) != NULL)
        {
-         int min_orient, max_orient;   /* Minimum and maximum orientations */
+         int min_orient, max_orient;   // Minimum and maximum orientations
 
 
           if (sscanf(attr->value, "%d%*s%d%d", &pos, &min_orient,
@@ -1037,11 +1041,11 @@ ppdEmitString(ppd_file_t    *ppd,       /* I - PPD file record */
 
        if (!choices[i]->code)
        {
-        /*
-         * This can happen with certain buggy PPD files that don't include
-         * a CustomPageSize command sequence...  We just use a generic
-         * Level 2 command sequence...
-         */
+         //
+         // This can happen with certain buggy PPD files that don't include
+         // a CustomPageSize command sequence...  We just use a generic
+         // Level 2 command sequence...
+         //
 
          strlcpy(bufptr, ppd_custom_code, (size_t)(bufend - bufptr + 1));
           bufptr += strlen(bufptr);
@@ -1051,12 +1055,13 @@ ppdEmitString(ppd_file_t    *ppd,       /* I - PPD file record */
                (coption = ppdFindCustomOption(ppd, choices[i]->option->keyword))
                   != NULL)
       {
-       /*
-        * Custom option...
-       */
+       //
+        // Custom option...
+       //
 
-        const char     *s;             /* Pointer into string value */
-        cups_array_t   *params;        /* Parameters in the correct output order */
+        const char     *s;             // Pointer into string value
+        cups_array_t   *params;        // Parameters in the correct output
+                                       // order
 
 
         params = cupsArrayNew((cups_array_func_t)ppd_compare_cparams, NULL);
@@ -1066,7 +1071,8 @@ ppdEmitString(ppd_file_t    *ppd, /* I - PPD file record */
             cparam = (ppd_cparam_t *)cupsArrayNext(coption->params))
           cupsArrayAdd(params, cparam);
 
-        snprintf(bufptr, (size_t)(bufend - bufptr + 1), "%%%%BeginFeature: *Custom%s True\n", coption->keyword);
+        snprintf(bufptr, (size_t)(bufend - bufptr + 1),
+                "%%%%BeginFeature: *Custom%s True\n", coption->keyword);
         bufptr += strlen(bufptr);
 
         for (cparam = (ppd_cparam_t *)cupsArrayFirst(params);
@@ -1088,7 +1094,8 @@ ppdEmitString(ppd_file_t    *ppd, /* I - PPD file record */
                break;
 
            case PPD_CUSTOM_INT :
-               snprintf(bufptr, (size_t)(bufend - bufptr + 1), "%d\n", cparam->current.custom_int);
+               snprintf(bufptr, (size_t)(bufend - bufptr + 1), "%d\n",
+                        cparam->current.custom_int);
                bufptr += strlen(bufptr);
                break;
 
@@ -1103,7 +1110,8 @@ ppdEmitString(ppd_file_t    *ppd, /* I - PPD file record */
                  {
                    if (*s < ' ' || *s == '(' || *s == ')' || *s >= 127)
                    {
-                     snprintf(bufptr, (size_t)(bufend - bufptr + 1), "\\%03o", *s & 255);
+                     snprintf(bufptr, (size_t)(bufend - bufptr + 1),
+                              "\\%03o", *s & 255);
                      bufptr += strlen(bufptr);
                    }
                    else
@@ -1121,7 +1129,9 @@ ppdEmitString(ppd_file_t    *ppd, /* I - PPD file record */
       }
       else
       {
-        snprintf(bufptr, (size_t)(bufend - bufptr + 1), "%%%%BeginFeature: *%s %s\n", choices[i]->option->keyword, choices[i]->choice);
+        snprintf(bufptr, (size_t)(bufend - bufptr + 1),
+                "%%%%BeginFeature: *%s %s\n",
+                choices[i]->option->keyword, choices[i]->choice);
        bufptr += strlen(bufptr);
       }
 
@@ -1148,9 +1158,9 @@ ppdEmitString(ppd_file_t    *ppd, /* I - PPD file record */
       bufptr += strlen(bufptr);
     }
 
- /*
-  * Nul-terminate, free, and return...
-  */
+  //
+  // Nul-terminate, free, and return...
+  //
 
   *bufptr = '\0';
 
@@ -1160,41 +1170,41 @@ ppdEmitString(ppd_file_t    *ppd,       /* I - PPD file record */
 }
 
 
-/*
- * 'ppdHandleMedia()' - Handle media selection...
- */
+//
+// 'ppdHandleMedia()' - Handle media selection...
+//
 
 void
-ppdHandleMedia(ppd_file_t *ppd)        /* I - PPD file */
+ppdHandleMedia(ppd_file_t *ppd)        // I - PPD file
 {
-  ppd_choice_t *manual_feed,           /* ManualFeed choice, if any */
-               *input_slot;            /* InputSlot choice, if any */
-  ppd_size_t   *size;                  /* Current media size */
-  ppd_attr_t   *rpr;                   /* RequiresPageRegion value */
-
-
- /*
-  * This function determines what page size code to use, if any, for the
-  * current media size, InputSlot, and ManualFeed selections.
-  *
-  * We use the PageSize code if:
-  *
-  * 1. A custom media size is selected.
-  * 2. ManualFeed and InputSlot are not selected (or do not exist).
-  * 3. ManualFeed is selected but is False and InputSlot is not selected or
-  *    the selection has no code - the latter check done to support "auto" or
-  *    "printer default" InputSlot options.
-  *
-  * We use the PageRegion code if:
-  *
-  * 4. RequiresPageRegion does not exist and the PPD contains cupsFilter
-  *    keywords, indicating this is a CUPS-based driver.
-  * 5. RequiresPageRegion exists for the selected InputSlot (or "All" for any
-  *    InputSlot or ManualFeed selection) and is True.
-  *
-  * If none of the 5 conditions are true, no page size code is used and we
-  * unmark any existing PageSize or PageRegion choices.
-  */
+  ppd_choice_t *manual_feed,           // ManualFeed choice, if any
+               *input_slot;            // InputSlot choice, if any
+  ppd_size_t   *size;                  // Current media size
+  ppd_attr_t   *rpr;                   // RequiresPageRegion value
+
+
+  //
+  // This function determines what page size code to use, if any, for the
+  // current media size, InputSlot, and ManualFeed selections.
+  //
+  // We use the PageSize code if:
+  //
+  // 1. A custom media size is selected.
+  // 2. ManualFeed and InputSlot are not selected (or do not exist).
+  // 3. ManualFeed is selected but is False and InputSlot is not selected or
+  //    the selection has no code - the latter check done to support "auto" or
+  //    "printer default" InputSlot options.
+  //
+  // We use the PageRegion code if:
+  //
+  // 4. RequiresPageRegion does not exist and the PPD contains cupsFilter
+  //    keywords, indicating this is a CUPS-based driver.
+  // 5. RequiresPageRegion exists for the selected InputSlot (or "All" for any
+  //    InputSlot or ManualFeed selection) and is True.
+  //
+  // If none of the 5 conditions are true, no page size code is used and we
+  // unmark any existing PageSize or PageRegion choices.
+  //
 
   if ((size = ppdPageSize(ppd, NULL)) == NULL)
     return;
@@ -1216,33 +1226,33 @@ ppdHandleMedia(ppd_file_t *ppd) /* I - PPD file */
        (!input_slot || (input_slot->code && !input_slot->code[0]))) ||
       (!rpr && ppd->num_filters > 0))
   {
-   /*
-    * Use PageSize code...
-    */
+    //
+    // Use PageSize code...
+    //
 
     ppdMarkOption(ppd, "PageSize", size->name);
   }
   else if (rpr && rpr->value && !_ppd_strcasecmp(rpr->value, "True"))
   {
-   /*
-    * Use PageRegion code...
-    */
+    //
+    // Use PageRegion code...
+    //
 
     ppdMarkOption(ppd, "PageRegion", size->name);
   }
   else
   {
-   /*
-    * Do not use PageSize or PageRegion code...
-    */
+    //
+    // Do not use PageSize or PageRegion code...
+    //
 
-    ppd_choice_t       *page;          /* PageSize/Region choice, if any */
+    ppd_choice_t       *page;          // PageSize/Region choice, if any
 
     if ((page = ppdFindMarkedChoice(ppd, "PageSize")) != NULL)
     {
-     /*
-      * Unmark PageSize...
-      */
+      //
+      // Unmark PageSize...
+      //
 
       page->marked = 0;
       cupsArrayRemove(ppd->marked, page);
@@ -1250,9 +1260,9 @@ ppdHandleMedia(ppd_file_t *ppd)   /* I - PPD file */
 
     if ((page = ppdFindMarkedChoice(ppd, "PageRegion")) != NULL)
     {
-     /*
-      * Unmark PageRegion...
-      */
+      //
+      // Unmark PageRegion...
+      //
 
       page->marked = 0;
       cupsArrayRemove(ppd->marked, page);
@@ -1261,13 +1271,13 @@ ppdHandleMedia(ppd_file_t *ppd) /* I - PPD file */
 }
 
 
-/*
- * 'ppd_compare_cparams()' - Compare the order of two custom parameters.
- */
+//
+// 'ppd_compare_cparams()' - Compare the order of two custom parameters.
+//
 
-static int                             /* O - Result of comparison */
-ppd_compare_cparams(ppd_cparam_t *a,   /* I - First parameter */
-                    ppd_cparam_t *b)   /* I - Second parameter */
+static int                             // O - Result of comparison
+ppd_compare_cparams(ppd_cparam_t *a,   // I - First parameter
+                    ppd_cparam_t *b)   // I - Second parameter
 {
   return (a->order - b->order);
 }
index 370e4f720a699ac150da333a7a7e187dce355352..532a5fa4f1ebe8aa1c95621dbec3700212d63fa0 100644 (file)
@@ -1,15 +1,15 @@
-/*
- * Filter functions support for libppd.
- *
- * Copyright © 2020-2022 by Till Kamppeter.
- *
- * Licensed under Apache License v2.0.  See the file "LICENSE" for more
- * information.
- */
-
-/*
- * Include necessary headers...
- */
+//
+// Filter functions support for libppd.
+//
+// Copyright © 2020-2022 by Till Kamppeter.
+//
+// Licensed under Apache License v2.0.  See the file "LICENSE" for more
+// information.
+//
+
+//
+// Include necessary headers...
+//
 
 #include "config.h"
 #include "ppd-filter.h"
 
 extern char **environ;
 
-/*
- * 'ppdFilterCUPSWrapper()' - Wrapper function to use a filter function as
- *                            classic CUPS filter
- */
+//
+// 'ppdFilterCUPSWrapper()' - Wrapper function to use a filter function as
+//                            classic CUPS filter
+//
 
-int                                    /* O - Exit status */
+int                                    // O - Exit status
 ppdFilterCUPSWrapper(
-     int  argc,                                /* I - Number of command-line args */
-     char *argv[],                     /* I - Command-line arguments */
-     cf_filter_function_t filter,       /* I - Filter function */
-     void *parameters,                  /* I - Filter function parameters */
-     int *JobCanceled)                  /* I - Var set to 1 when job canceled */
+     int  argc,                                // I - Number of command-line args
+     char *argv[],                     // I - Command-line arguments
+     cf_filter_function_t filter,       // I - Filter function
+     void *parameters,                  // I - Filter function parameters
+     int *JobCanceled)                  // I - Var set to 1 when job canceled
 {
-  int          inputfd;                /* Print file descriptor*/
-  int           inputseekable;          /* Is the input seekable (actual file
-                                          not stdin)? */
-  int          num_options;            /* Number of print options */
-  cups_option_t        *options;               /* Print options */
+  int          inputfd;                // Print file descriptor
+  int           inputseekable;          // Is the input seekable (actual file
+                                       // not stdin)?
+  int          num_options;            // Number of print options
+  cups_option_t        *options;               // Print options
   cf_filter_data_t filter_data;
   const char    *val;
   char          buf[256];
   int           retval = 0;
 
 
- /*
-  * Make sure status messages are not buffered...
-  */
+  //
+  // Make sure status messages are not buffered...
+  //
 
   setbuf(stderr, NULL);
 
- /*
-  * Ignore broken pipe signals...
-  */
+  //
+  // Ignore broken pipe signals...
+  //
 
   signal(SIGPIPE, SIG_IGN);
 
- /*
-  * Check command-line...
-  */
+  //
+  // Check command-line...
+  //
 
   if (argc < 6 || argc > 7)
   {
@@ -73,21 +73,21 @@ ppdFilterCUPSWrapper(
     return (1);
   }
 
- /*
-  * If we have 7 arguments, print the file named on the command-line.
-  * Otherwise, send stdin instead...
-  */
+  //
+  // If we have 7 arguments, print the file named on the command-line.
+  // Otherwise, send stdin instead...
+  //
 
   if (argc == 6)
   {
-    inputfd = 0; /* stdin */
+    inputfd = 0; // stdin
     inputseekable = 0;
   }
   else
   {
-   /*
-    * Try to open the print file...
-    */
+    //
+    // Try to open the print file...
+    //
 
     if ((inputfd = open(argv[6], O_RDONLY)) < 0)
     {
@@ -104,9 +104,9 @@ ppdFilterCUPSWrapper(
     inputseekable = 1;
   }
 
- /*
-  * Process command-line options...
-  */
+  //
+  // Process command-line options...
+  //
 
   options     = NULL;
   num_options = cupsParseOptions(argv[5], 0, &options);
@@ -119,26 +119,26 @@ ppdFilterCUPSWrapper(
   filter_data.copies = atoi(argv[4]);
   filter_data.content_type = getenv("CONTENT_TYPE");
   filter_data.final_content_type = getenv("FINAL_CONTENT_TYPE");
-  filter_data.job_attrs = NULL;        /* We use command line options */
-  /* The following two will get populated by ppdFilterLoadPPD() */
-  filter_data.printer_attrs = NULL;    /* We use the queue's PPD file */
-  filter_data.header = NULL;           /* CUPS Raster header of queue's PPD */
+  filter_data.job_attrs = NULL;        // We use command line options
+  // The following two will get populated by ppdFilterLoadPPD()
+  filter_data.printer_attrs = NULL;    // We use the queue's PPD file
+  filter_data.header = NULL;           // CUPS Raster header of queue's PPD
   filter_data.num_options = num_options;
-  filter_data.options = options;       /* Command line options from 5th arg */
-  filter_data.back_pipe[0] = 3;        /* CUPS uses file descriptor 3 for */
-  filter_data.back_pipe[1] = 3;        /* the back channel */
-  filter_data.side_pipe[0] = 4;        /* CUPS uses file descriptor 4 for */
-  filter_data.side_pipe[1] = 4;        /* the side channel */
+  filter_data.options = options;       // Command line options from 5th arg
+  filter_data.back_pipe[0] = 3;        // CUPS uses file descriptor 3 for
+  filter_data.back_pipe[1] = 3;        // the back channel
+  filter_data.side_pipe[0] = 4;        // CUPS uses file descriptor 4 for
+  filter_data.side_pipe[1] = 4;        // the side channel
   filter_data.extension = NULL;
-  filter_data.logfunc = cfCUPSLogFunc;  /* Logging scheme of CUPS */
+  filter_data.logfunc = cfCUPSLogFunc;  // Logging scheme of CUPS
   filter_data.logdata = NULL;
-  filter_data.iscanceledfunc = cfCUPSIsCanceledFunc; /* Job-is-canceled
-                                                      function */
+  filter_data.iscanceledfunc = cfCUPSIsCanceledFunc; // Job-is-canceled
+                                                    // function
   filter_data.iscanceleddata = JobCanceled;
 
- /*
-  * CUPS_FONTPATH (Usually /usr/share/cups/fonts)
-  */
+  //
+  // CUPS_FONTPATH (Usually /usr/share/cups/fonts)
+  //
 
   if (cupsGetOption("cups-fontpath",
                    filter_data.num_options, filter_data.options) == NULL)
@@ -155,23 +155,23 @@ ppdFilterCUPSWrapper(
                      filter_data.num_options, &(filter_data.options));
   }
 
- /*
-  * Load and prepare the PPD file, also attach it as extension "libppd"
-  * to the filter_data structure
-  */
+  //
+  // Load and prepare the PPD file, also attach it as extension "libppd"
+  // to the filter_data structure
+  //
 
   retval = ppdFilterLoadPPDFile(&filter_data, getenv("PPD"));
 
- /*
-  * Fire up the filter function (output to stdout, file descriptor 1)
-  */
+  //
+  // Fire up the filter function (output to stdout, file descriptor 1)
+  //
 
   if (!retval)
     retval = filter(inputfd, 1, inputseekable, &filter_data, parameters);
 
- /*
-  * Clean up
-  */
+  //
+  // Clean up
+  //
 
   cupsFreeOptions(filter_data.num_options, filter_data.options);
   ppdFilterFreePPDFile(&filter_data);
@@ -180,29 +180,29 @@ ppdFilterCUPSWrapper(
 }
 
 
-/*
- * 'ppdFilterLoadPPDFile()' - When preparing the filter data structure
- *                            for calling one or more filter
- *                            functions, load the PPD file specified
- *                            by its file name.  If the file name is
- *                            NULL or empty, do nothing. If the PPD
- *                            got successfully loaded add its data to
- *                            the filter data structure as extension
- *                            named "libppd", so that filters
- *                            functions designed for using PPDs can
- *                            access it. Then read out all the
- *                            relevant data with the
- *                            ppdFilterLoadPPD() function.
- */
-
-int                                         /* O   - Error status */
-ppdFilterLoadPPDFile(cf_filter_data_t *data, /* I/O - Job and printer data */
-                    const char *ppdfile)    /* I   - PPD file name */
+//
+// 'ppdFilterLoadPPDFile()' - When preparing the filter data structure
+//                            for calling one or more filter
+//                            functions, load the PPD file specified
+//                            by its file name.  If the file name is
+//                            NULL or empty, do nothing. If the PPD
+//                            got successfully loaded add its data to
+//                            the filter data structure as extension
+//                            named "libppd", so that filters
+//                            functions designed for using PPDs can
+//                            access it. Then read out all the
+//                            relevant data with the
+//                            ppdFilterLoadPPD() function.
+//
+
+int                                         // O   - Error status
+ppdFilterLoadPPDFile(cf_filter_data_t *data, // I/O - Job and printer data
+                    const char *ppdfile)    // I   - PPD file name
 {
-  ppd_filter_data_ext_t *filter_data_ext; /* Record for "libppd" extension */
-  ppd_file_t       *ppd;                  /* PPD data */
-  cf_logfunc_t     log = data->logfunc;   /* Log function */
-  void             *ld = data->logdata;   /* log function data */
+  ppd_filter_data_ext_t *filter_data_ext; // Record for "libppd" extension
+  ppd_file_t       *ppd;                  // PPD data
+  cf_logfunc_t     log = data->logfunc;   // Log function
+  void             *ld = data->logdata;   // log function data
 
   if (!ppdfile || !ppdfile[0])
     return (-1);
@@ -218,40 +218,40 @@ ppdFilterLoadPPDFile(cf_filter_data_t *data, /* I/O - Job and printer data */
   filter_data_ext =
     (ppd_filter_data_ext_t *)calloc(1, sizeof(ppd_filter_data_ext_t));
 
-  filter_data_ext->ppdfile = strdup(ppdfile); /* PPD file name */
-  filter_data_ext->ppd = ppd;                 /* PPD data */
+  filter_data_ext->ppdfile = strdup(ppdfile); // PPD file name
+  filter_data_ext->ppd = ppd;                 // PPD data
   cfFilterDataAddExt(data, PPD_FILTER_DATA_EXT, filter_data_ext);
 
   return ppdFilterLoadPPD(data);
 }
 
 
-/*
- * 'ppdFilterLoadPPD()' - When preparing the filter data structure for
- *                        calling one or more filter functions, and a
- *                        PPD file is attached as "libppd" extension,
- *                        set up the PPD's cache, mark default
- *                        settings and if supplied in the data
- *                        structure, also option settings. Then
- *                        convert the capability and option info in
- *                        the PPD file into printer IPP attributes and
- *                        what cannot be represented in IPP as option
- *                        settings and add these results to the filter
- *                        data structure. This allows to use the (by
- *                        itself not PPD-supporting) filter function
- *                        to do its work for the printer represented
- *                        by the PPD file. Add the CUPS PPD file data
- *                        structure with embedded CUPS PPD cache data
- *                        structure (including PPD option setting
- *                        presets for all possible print-color-mode,
- *                        print-quality, and print-content-optimize
- *                        settings) to the filter data structure for
- *                        use by libppd's PPD-requiring filter
- *                        functions.
- */
-
-int                                     /* O   - Error status */
-ppdFilterLoadPPD(cf_filter_data_t *data) /* I/O - Job and printer data */
+//
+// 'ppdFilterLoadPPD()' - When preparing the filter data structure for
+//                        calling one or more filter functions, and a
+//                        PPD file is attached as "libppd" extension,
+//                        set up the PPD's cache, mark default
+//                        settings and if supplied in the data
+//                        structure, also option settings. Then
+//                        convert the capability and option info in
+//                        the PPD file into printer IPP attributes and
+//                        what cannot be represented in IPP as option
+//                        settings and add these results to the filter
+//                        data structure. This allows to use the (by
+//                        itself not PPD-supporting) filter function
+//                        to do its work for the printer represented
+//                        by the PPD file. Add the CUPS PPD file data
+//                        structure with embedded CUPS PPD cache data
+//                        structure (including PPD option setting
+//                        presets for all possible print-color-mode,
+//                        print-quality, and print-content-optimize
+//                        settings) to the filter data structure for
+//                        use by libppd's PPD-requiring filter
+//                        functions.
+//
+
+int                                     // O   - Error status
+ppdFilterLoadPPD(cf_filter_data_t *data) // I/O - Job and printer data
 {
   int              i;
   ppd_filter_data_ext_t *filter_data_ext =
@@ -274,18 +274,18 @@ ppdFilterLoadPPD(cf_filter_data_t *data) /* I/O - Job and printer data */
   char             buf[1024];
   char             cm_qualifier_tmp[1024];
   const char       *cm_profile_key;
-  char            *resolution,           /* Output resolution */
-                  *media_type;           /* Media type */
-  ppd_profile_t           *profile;              /* Color profile */
-  cf_logfunc_t     log = data->logfunc;   /* Log function */
-  void             *ld = data->logdata;   /* log function data */
+  char            *resolution,           // Output resolution
+                  *media_type;           // Media type
+  ppd_profile_t           *profile;              // Color profile
+  cf_logfunc_t     log = data->logfunc;   // Log function
+  void             *ld = data->logdata;   // log function data
 
   if (!filter_data_ext || !filter_data_ext->ppd)
     return (-1);
 
- /*
-  * Prepare PPD file and mark options
-  */
+  //
+  // Prepare PPD file and mark options
+  //
 
   ppd = filter_data_ext->ppd;
   ppd->cache = ppdCacheCreateWithPPD(ppd);
@@ -300,11 +300,11 @@ ppdFilterLoadPPD(cf_filter_data_t *data) /* I/O - Job and printer data */
   ppdMarkOptions(ppd, data->num_options, data->options);
   ppdHandleMedia(ppd);
 
- /*
-  * Pass on PPD attributes
-  */
+  //
+  // Pass on PPD attributes
+  //
 
-  /* Pass on "PWGRaster" PPD attribute (for PWG Raster output) */
+  // Pass on "PWGRaster" PPD attribute (for PWG Raster output)
   if ((ppd_attr = ppdFindAttr(ppd, "PWGRaster", 0)) != 0 &&
       (!strcasecmp(ppd_attr->value, "true") ||
        !strcasecmp(ppd_attr->value, "on") ||
@@ -312,41 +312,41 @@ ppdFilterLoadPPD(cf_filter_data_t *data) /* I/O - Job and printer data */
     data->num_options = cupsAddOption("media-class", "PwgRaster",
                                      data->num_options, &(data->options));
 
-  /* Pass on "cupsEvenDuplex" PPD attribute */
+  // Pass on "cupsEvenDuplex" PPD attribute
   if ((ppd_attr = ppdFindAttr(ppd, "cupsEvenDuplex", 0)) != NULL)
     data->num_options = cupsAddOption("even-duplex", ppd_attr->value,
                                      data->num_options, &(data->options));
 
-  /* Pass on "cupsBackSide" (or "cupsFlipDuplex") PPD attribute */
+  // Pass on "cupsBackSide" (or "cupsFlipDuplex") PPD attribute
   if ((ppd_attr = ppdFindAttr(ppd, "cupsBackSide", 0)) != NULL)
   {
-    ppd->flip_duplex = 0; /* "cupsBackSide" has priority */
+    ppd->flip_duplex = 0; // "cupsBackSide" has priority
     data->num_options = cupsAddOption("back-side-orientation", ppd_attr->value,
                                      data->num_options, &(data->options));
   }
-  else if (ppd->flip_duplex) /* "cupsFlipDuplex" same as "Rotated" */
+  else if (ppd->flip_duplex) // "cupsFlipDuplex" same as "Rotated"
     data->num_options = cupsAddOption("back-side-orientation", "Rotated",
                                      data->num_options, &(data->options));
 
-  /* Pass on "APDuplexRequiresFlippedMargin" PPD attribute */
+  // Pass on "APDuplexRequiresFlippedMargin" PPD attribute
   if ((ppd_attr = ppdFindAttr(ppd, "APDuplexRequiresFlippedMargin", 0)) != NULL)
     data->num_options = cupsAddOption("duplex-requires-flipped-margin",
                                      ppd_attr->value,
                                      data->num_options, &(data->options));
 
-  /* Pass on "cupsRasterVersion" PPD attribute */
+  // Pass on "cupsRasterVersion" PPD attribute
   if ((ppd_attr = ppdFindAttr(ppd,"cupsRasterVersion", 0)) != NULL)
     data->num_options = cupsAddOption("cups-raster-version",
                                      ppd_attr->value,
                                      data->num_options, &(data->options));
 
-  /* Pass on "DefaultCenterOfPixel" PPD attribute (for Ghostscript) */
+  // Pass on "DefaultCenterOfPixel" PPD attribute (for Ghostscript)
   if ((ppd_attr = ppdFindAttr(ppd,"DefaultCenterOfPixel", 0)) != NULL)
     data->num_options = cupsAddOption("center-of-pixel",
                                      ppd_attr->value,
                                      data->num_options, &(data->options));
 
-  /* Set short-edge Duplex when booklet printing is selected */
+  // Set short-edge Duplex when booklet printing is selected
   if ((val = cupsGetOption("booklet",
                           data->num_options, data->options)) != NULL &&
       (!strcasecmp(val, "on") || !strcasecmp(val, "yes") ||
@@ -357,7 +357,7 @@ ppdFilterLoadPPD(cf_filter_data_t *data) /* I/O - Job and printer data */
     ppdMarkOption(ppd, ppd->cache->sides_option,
                  ppd->cache->sides_2sided_short);
 
-  /* Let the PDF filter do mirrored printing */
+  // Let the PDF filter do mirrored printing
   if ((choice = ppdFindMarkedChoice(ppd, "MirrorPrint")) != NULL)
   {
     choice->marked = 0;
@@ -365,27 +365,27 @@ ppdFilterLoadPPD(cf_filter_data_t *data) /* I/O - Job and printer data */
                                      data->num_options, &(data->options));
   }
 
- /*
-  * Find out whether we can do hardware copies/collate
-  */
+  //
+  // Find out whether we can do hardware copies/collate
+  //
 
   if (data->copies == 1)
   {
-    /* 1 copy, hardware copies/collate do not make difference */
+    // 1 copy, hardware copies/collate do not make difference
     hw_copies = false;
     hw_collate = false;
   }
   else if (!ppd->manual_copies)
   {
-    /* Hardware copy generation available */
+    // Hardware copy generation available
     hw_copies = true;
-    /* Check output format (FINAL_CONTENT_TYPE env variable) whether it is
-       of a driverless IPP printer (PDF, Apple Raster, PWG Raster, PCLm).
-       These printers do always hardware collate if they do hardware copies.
-       https://github.com/apple/cups/issues/5433
-       This also assumes that if a classic PDF printer (non-IPP printer printing
-       with JCL/PJL-controlled PDF) supports hardware copies that it also does
-       hardware collate */
+    // Check output format (FINAL_CONTENT_TYPE env variable) whether it is
+    // of a driverless IPP printer (PDF, Apple Raster, PWG Raster, PCLm).
+    // These printers do always hardware collate if they do hardware copies.
+    // https://github.com/apple/cups/issues/5433
+    // This also assumes that if a classic PDF printer (non-IPP printer printing
+    // with JCL/PJL-controlled PDF) supports hardware copies that it also does
+    // hardware collate
     if (data->final_content_type &&
        (strcasestr(data->final_content_type, "/pdf") ||
         strcasestr(data->final_content_type, "/vnd.cups-pdf") ||
@@ -393,9 +393,9 @@ ppdFilterLoadPPD(cf_filter_data_t *data) /* I/O - Job and printer data */
         strcasestr(data->final_content_type, "/urf") ||
         strcasestr(data->final_content_type, "/PCLm")))
     {
-      /* If PPD has "Collate" option set to not collate, do not set
-        hw_collate, especially important to set correct JCL/PJL on
-        "classic" PDF printers (they will always collate otherwise) */
+      // If PPD has "Collate" option set to not collate, do not set
+      // hw_collate, especially important to set correct JCL/PJL on
+      // "classic" PDF printers (they will always collate otherwise)
       if ((choice = ppdFindMarkedChoice(ppd, "Collate")) != NULL &&
          (!strcasecmp(choice->choice, "off") ||
           !strcasecmp(choice->choice, "no") ||
@@ -406,14 +406,14 @@ ppdFilterLoadPPD(cf_filter_data_t *data) /* I/O - Job and printer data */
     }
     else
     {
-      /* Check whether printer hardware-collates with current PPD settings */
+      // Check whether printer hardware-collates with current PPD settings
       if ((choice = ppdFindMarkedChoice(ppd, "Collate")) != NULL &&
          (!strcasecmp(choice->choice, "on") ||
           !strcasecmp(choice->choice, "yes") ||
           !strcasecmp(choice->choice, "true")))
       {
-       /* Printer can collate, but also for the currently marked PPD
-          features? */
+       // Printer can collate, but also for the currently marked PPD
+       // features?
        ppd_option_t *opt = ppdFindOption(ppd, "Collate");
        hw_collate = (opt && !opt->conflicted);
       }
@@ -423,34 +423,34 @@ ppdFilterLoadPPD(cf_filter_data_t *data) /* I/O - Job and printer data */
   }
   else
   {
-    /* We have "*cupsManualCopies: True" =>
-       Software copies/collate */
+    // We have "*cupsManualCopies: True" =>
+    // Software copies/collate
     hw_copies = false;
     hw_collate = false;
   }
 
   if (!hw_copies)
   {
-    /* Software copies */
-    /* Make sure any hardware copying is disabled */
+    // Software copies
+    // Make sure any hardware copying is disabled
     ppdMarkOption(ppd, "Copies", "1");
     ppdMarkOption(ppd, "JCLCopies", "1");
   }
   else
   {
-    /* Hardware copies */
-    /* If there is a "Copies" option in the PPD file, assure that hardware
-       copies are implemented as described by this option */
+    // Hardware copies
+    // If there is a "Copies" option in the PPD file, assure that hardware
+    // copies are implemented as described by this option
     snprintf(buf, sizeof(buf), "%d", hw_copies);
     ppdMarkOption(ppd, "Copies", buf);
   }
 
-  /* Software collate */
+  // Software collate
   if (!hw_collate)
-    /* Disable any hardware collate (in JCL) */
+    // Disable any hardware collate (in JCL)
     ppdMarkOption(ppd, "Collate", "False");
 
-  /* Add options telling whether we want hardware copies/collate or not */
+  // Add options telling whether we want hardware copies/collate or not
   data->num_options = cupsAddOption("hardware-copies",
                                    (hw_copies ? "true" : "false"),
                                    data->num_options, &(data->options));
@@ -458,11 +458,11 @@ ppdFilterLoadPPD(cf_filter_data_t *data) /* I/O - Job and printer data */
                                    (hw_collate ? "true" : "false"),
                                    data->num_options, &(data->options));
 
- /*
-  * Pass on color management attributes
-  */
+  //
+  // Pass on color management attributes
+  //
 
-  /* Get color space */
+  // Get color space
   if ((ppd_attr = ppdFindAttr (ppd, "cupsICCQualifier1", NULL)) != NULL &&
       ppd_attr->value && ppd_attr->value[0])
     choice = ppdFindMarkedChoice(ppd, ppd_attr->value);
@@ -473,7 +473,7 @@ ppdFilterLoadPPD(cf_filter_data_t *data) /* I/O - Job and printer data */
   else
     q1_choice = "";
 
-  /* Get media type */
+  // Get media type
   if ((ppd_attr = ppdFindAttr(ppd, "cupsICCQualifier2", NULL)) != NULL &&
       ppd_attr->value && ppd_attr->value[0])
     choice = ppdFindMarkedChoice(ppd, ppd_attr->value);
@@ -484,7 +484,7 @@ ppdFilterLoadPPD(cf_filter_data_t *data) /* I/O - Job and printer data */
   else
     q2_choice = "";
 
-  /* Get resolution */
+  // Get resolution
   if ((ppd_attr = ppdFindAttr(ppd, "cupsICCQualifier3", NULL)) != NULL &&
       ppd_attr->value && ppd_attr->value[0])
     choice = ppdFindMarkedChoice(ppd, ppd_attr->value);
@@ -501,18 +501,18 @@ ppdFilterLoadPPD(cf_filter_data_t *data) /* I/O - Job and printer data */
       q3_choice = "";
   }
 
-  /* create a string for the option */
+  // create a string for the option
   snprintf(cm_qualifier_tmp, sizeof(cm_qualifier_tmp),
            "%s.%s.%s", q1_choice, q2_choice, q3_choice);
   if (log) log(ld, CF_LOGLEVEL_DEBUG,
               "ppdFilterLoadPPD: Color profile qualifier determined from job and PPD data '%s'",
               cm_qualifier_tmp);
 
-  /* Supply qualifier as option */
+  // Supply qualifier as option
   data->num_options = cupsAddOption("cm-profile-qualifier", cm_qualifier_tmp,
                                    data->num_options, &(data->options));
 
-  /* get profile attr, falling back to CUPS */
+  // get profile attr, falling back to CUPS
   cm_profile_key = "APTiogaProfile";
   ppd_attr = ppdFindAttr(ppd, cm_profile_key, NULL);
   if (ppd_attr == NULL)
@@ -523,21 +523,21 @@ ppdFilterLoadPPD(cf_filter_data_t *data) /* I/O - Job and printer data */
 
   if (ppd_attr == NULL)
   {
-    /* neither */
+    // neither
     if (log) log(ld, CF_LOGLEVEL_DEBUG,
                "ppdFilterLoadPPD: No ICC profiles specified in PPD");
   }
   else
   {
-    /* Try to find a profile that matches the qualifier exactly */
+    // Try to find a profile that matches the qualifier exactly
     for (;ppd_attr != NULL;
         ppd_attr = ppdFindNextAttr(ppd, cm_profile_key, NULL))
     {
-      /* Invalid entry */
+      // Invalid entry
       if (ppd_attr->spec == NULL || ppd_attr->value == NULL)
        continue;
 
-      /* Matches the qualifier */
+      // Matches the qualifier
       if (strcmp(cm_qualifier_tmp, ppd_attr->spec) == 0)
       {
        if (log) log(ld, CF_LOGLEVEL_DEBUG,
@@ -547,7 +547,7 @@ ppdFilterLoadPPD(cf_filter_data_t *data) /* I/O - Job and printer data */
       }
     }
 
-    /* No match */
+    // No match
     if (ppd_attr == NULL)
     {
       if (log) log(ld, CF_LOGLEVEL_DEBUG,
@@ -556,7 +556,7 @@ ppdFilterLoadPPD(cf_filter_data_t *data) /* I/O - Job and printer data */
     }
     else
     {
-      /* expand to a full path if not already specified */
+      // expand to a full path if not already specified
       if (ppd_attr->value[0] != '/')
       {
        if ((val = getenv("CUPS_DATADIR")) == NULL)
@@ -571,7 +571,7 @@ ppdFilterLoadPPD(cf_filter_data_t *data) /* I/O - Job and printer data */
          buf[1023] = '\0';
       }
 
-      /* check the file exists */
+      // check the file exists
       if (access(buf, 0))
       {
        if (log) log(ld, CF_LOGLEVEL_ERROR,
@@ -580,7 +580,7 @@ ppdFilterLoadPPD(cf_filter_data_t *data) /* I/O - Job and printer data */
       }
       else
       {
-       /* Supply path as fallback profile option */
+       // Supply path as fallback profile option
        if (log) log(ld, CF_LOGLEVEL_DEBUG,
                     "ppdFilterLoadPPD: Using ICC profile %s as fallback if colord does not supply another one",
                     buf);
@@ -591,9 +591,9 @@ ppdFilterLoadPPD(cf_filter_data_t *data) /* I/O - Job and printer data */
     }
   }
 
- /*
-  * Find a color profile matching the current options...
-  */
+  //
+  // Find a color profile matching the current options...
+  //
 
   if (cupsGetOption("profile", data->num_options, data->options) == NULL)
   {
@@ -631,9 +631,9 @@ ppdFilterLoadPPD(cf_filter_data_t *data) /* I/O - Job and printer data */
                     "ppdFilterLoadPPD:    no.");
     }
 
-   /*
-    * If we found a color profile, use it!
-    */
+    //
+    // If we found a color profile, use it!
+    //
 
     if (i >= ppd->num_profiles)
       profile = NULL;
@@ -660,31 +660,31 @@ ppdFilterLoadPPD(cf_filter_data_t *data) /* I/O - Job and printer data */
                                      data->num_options, &(data->options));
   }
 
- /*
-  * Convert the settings and properties in the PPD into printer IPP
-  * attributes
-  */
+  //
+  // Convert the settings and properties in the PPD into printer IPP
+  // attributes
+  //
 
   data->printer_attrs = ppdLoadAttributes(ppd);
 
- /*
-  * Generate a CUPS Raster sample header, some filters can easily take
-  * data from it or make it the base for actual Raster headers. The
-  * header is based on the pseudo-PostScript code at the option
-  * settings in the PPD file, this is usually the more reliable way to
-  * obtain the correct resolution.
-  *
-  * This only works if the PPD file is actually for a CUPS Raster
-  * driver or generated by CUPS for driverless printers via the
-  * "everywhere" pseudo-driver, as other PPD files do not contain all
-  * resolution, page geometry and color space/depth info in
-  * pseudo-PostScript code and the ppdRasterInterpretPPD() function
-  * only parses the pseudo-PostScript code not the names of the
-  * options and choices.
-  *
-  * Therefore we create the sample header only if the PPD is actually
-  * for a CUPS Raster driver or an "everywhere" PPD from CUPS.
-  */
+  //
+  // Generate a CUPS Raster sample header, some filters can easily take
+  // data from it or make it the base for actual Raster headers. The
+  // header is based on the pseudo-PostScript code at the option
+  // settings in the PPD file, this is usually the more reliable way to
+  // obtain the correct resolution.
+  //
+  // This only works if the PPD file is actually for a CUPS Raster
+  // driver or generated by CUPS for driverless printers via the
+  // "everywhere" pseudo-driver, as other PPD files do not contain all
+  // resolution, page geometry and color space/depth info in
+  // pseudo-PostScript code and the ppdRasterInterpretPPD() function
+  // only parses the pseudo-PostScript code not the names of the
+  // options and choices.
+  //
+  // Therefore we create the sample header only if the PPD is actually
+  // for a CUPS Raster driver or an "everywhere" PPD from CUPS.
+  //
 
   data->header = NULL;
   for (i = 0; i < ppd->num_filters; i ++)
@@ -710,23 +710,23 @@ ppdFilterLoadPPD(cf_filter_data_t *data) /* I/O - Job and printer data */
     }
   }
 
- /*
-  * Replace the "PageSize" option by a media-col attribute, as this
-  * one selects the media much more reliably by numeric size
-  * dimensions and margins and not by name.
-  *
-  * PPDs have special page size names for page size variants (A4,
-  * A4.Borderless, A4.Duplex, A4.Transverse) which cannot get mapped
-  * into the printer IPP attributes (media-col-database) and so cannot
-  * get easily selected by the PPD-support-free core filter functions
-  * in libcupsfilters.
-  *
-  * Usually, the media-col attribute does not need to get copied from
-  * printer attributes to job attributes, but having it in the job
-  * attributes tells the filters that the user has requested a page
-  * size, as at least some filters overtake the sizes of the input
-  * pages when the user does not request a page size.
-  */
+  //
+  // Replace the "PageSize" option by a media-col attribute, as this
+  // one selects the media much more reliably by numeric size
+  // dimensions and margins and not by name.
+  //
+  // PPDs have special page size names for page size variants (A4,
+  // A4.Borderless, A4.Duplex, A4.Transverse) which cannot get mapped
+  // into the printer IPP attributes (media-col-database) and so cannot
+  // get easily selected by the PPD-support-free core filter functions
+  // in libcupsfilters.
+  //
+  // Usually, the media-col attribute does not need to get copied from
+  // printer attributes to job attributes, but having it in the job
+  // attributes tells the filters that the user has requested a page
+  // size, as at least some filters overtake the sizes of the input
+  // pages when the user does not request a page size.
+  //
 
   page_size = cupsGetOption("PageSize", data->num_options, data->options);
   media = cupsGetOption("media", data->num_options, data->options);
@@ -734,18 +734,18 @@ ppdFilterLoadPPD(cf_filter_data_t *data) /* I/O - Job and printer data */
       (attr = ippFindAttribute(data->printer_attrs, "media-col-default",
                               IPP_TAG_ZERO)) != NULL)
   {
-    /* We have already applied the settings of these options to the
-       PPD file and converted the PPD option settings into the printer
-       IPP attributes. The media size and margins corresponding to the
-       name supplied with these options is now included in the printer
-       IPP attributes as "media-col-default". Here we remove the
-       "PageSize" and "media" options and add "media-col" to the job
-       attributes as a copy of "media-col-default" in the printer
-       attributes. We do this only if the size specified by "PageSize"
-       or "media" is not a custom size ("Custom.XXxYYunit") as a
-       custom size cannot get marked in the PPD file and so not set as
-       default page size, so it does not make it into
-       media-col-default. In this case we only remove "media-col". */
+    // We have already applied the settings of these options to the
+    // PPD file and converted the PPD option settings into the printer
+    // IPP attributes. The media size and margins corresponding to the
+    // name supplied with these options is now included in the printer
+    // IPP attributes as "media-col-default". Here we remove the
+    // "PageSize" and "media" options and add "media-col" to the job
+    // attributes as a copy of "media-col-default" in the printer
+    // attributes. We do this only if the size specified by "PageSize"
+    // or "media" is not a custom size ("Custom.XXxYYunit") as a
+    // custom size cannot get marked in the PPD file and so not set as
+    // default page size, so it does not make it into
+    // media-col-default. In this case we only remove "media-col".
 
     int is_custom = 0;
 
@@ -776,22 +776,22 @@ ppdFilterLoadPPD(cf_filter_data_t *data) /* I/O - Job and printer data */
 
     if (!is_custom)
     {
-      /* String from IPP attribute for option list */
+      // String from IPP attribute for option list
       ippAttributeString(attr, buf, sizeof(buf));
       data->num_options = cupsAddOption("media-col", buf,
                                        data->num_options, &(data->options));
 
-      /* Copy the default media-col */
+      // Copy the default media-col
       col = ippGetCollection(attr, 0);
       ippAddCollection(data->job_attrs, IPP_TAG_PRINTER, "media-col", col);
     }
   }
 
- /*
-  * Find out whether the PDF filter (cfFilterPDFToPDF() or
-  * cfFilterImageToPDF()) should log the pages or whether the last
-  * filter (usually the printer driver) should do it.
-  */
+  //
+  // Find out whether the PDF filter (cfFilterPDFToPDF() or
+  // cfFilterImageToPDF()) should log the pages or whether the last
+  // filter (usually the printer driver) should do it.
+  //
 
   if ((val = cupsGetOption("pdf-filter-page-logging",
                           data->num_options, data->options)) == NULL ||
@@ -800,26 +800,26 @@ ppdFilterLoadPPD(cf_filter_data_t *data) /* I/O - Job and printer data */
     int page_logging = -1;
     if (data->final_content_type == NULL)
     {
-      /* Final data MIME type not known, we cannot determine
-        whether we have to log pages, so do not log. */
+      // Final data MIME type not known, we cannot determine
+      // whether we have to log pages, so do not log.
       page_logging = 0;
       if (log) log(ld, CF_LOGLEVEL_DEBUG,
                   "ppdFilterLoadPPD: No final data MIME type known, so we "
                   "cannot determine whether the PDF filter has to log pages "
                   "or not, so turning off page logging for the PDF filter.");
     }
-    /* Proceed depending on number of cupsFilter(2) lines in PPD */
+    // Proceed depending on number of cupsFilter(2) lines in PPD
     else if (ppd->num_filters == 0)
     {
-      /* No filter line, manufacturer-supplied PostScript PPD
-        In this case cfFilterPSToPS, called by cfFilterPDFToPS, does the
-        logging */
+      // No filter line, manufacturer-supplied PostScript PPD
+      // In this case cfFilterPSToPS, called by cfFilterPDFToPS, does the
+      // logging
       page_logging = 0;
     }
     else
     {
-      /* Filter(s) specified by filter line(s), determine the one which got
-        actually used via final data MIME type */
+      // Filter(s) specified by filter line(s), determine the one which got
+      // actually used via final data MIME type
       bool cupsfilter2 = (ppdFindAttr(ppd, "cupsFilter2", NULL) != NULL);
       for (lastfilter = (char *)cupsArrayFirst(ppd->cache->filters);
           lastfilter;
@@ -828,7 +828,7 @@ ppdFilterLoadPPD(cf_filter_data_t *data) /* I/O - Job and printer data */
        char *p = lastfilter;
        if (cupsfilter2)
        {
-         /* Skip first word as the final content type is the second */
+         // Skip first word as the final content type is the second
          while (!isspace(*p)) p ++;
          while (isspace(*p)) p ++;
        }
@@ -844,23 +844,23 @@ ppdFilterLoadPPD(cf_filter_data_t *data) /* I/O - Job and printer data */
     {
       if (lastfilter)
       {
-       /* Get the name of the last filter, without mime type and cost */
+       // Get the name of the last filter, without mime type and cost
        char *p = lastfilter;
        char *q = p + strlen(p) - 1;
        while (!isspace(*q) && *q != '/') q --;
        lastfilter = q + 1;
-       /* Check whether the PDF filter has to log */
+       // Check whether the PDF filter has to log
        if (!strcasecmp(lastfilter, "-"))
        {
-         /* No filter defined in the PPD
-            If output data is PDF, cfFilterPDFToPDF() is last
-            filter (PDF printer) and has to log
-            If output data is Postscript, ppdFilterPSToPS() should log,
-            but it only logs with a pure PostScript PPD (no filter definition),
-            so the PDF filter has to log
-            If output data is Apple/PWG Raster or PCLm, cfFilter*ToRaster() is
-            last filter (Driverless IPP printer) and cfFilterPDFToPDF()
-            also has to log */
+         // No filter defined in the PPD
+         // If output data is PDF, cfFilterPDFToPDF() is last
+         // filter (PDF printer) and has to log
+         // If output data is Postscript, ppdFilterPSToPS() should log,
+         // but it only logs with a pure PostScript PPD (no filter definition),
+         // so the PDF filter has to log
+         // If output data is Apple/PWG Raster or PCLm, cfFilter*ToRaster() is
+         // last filter (Driverless IPP printer) and cfFilterPDFToPDF()
+         // also has to log
          if (strcasestr(data->final_content_type, "/pdf") ||
              strcasestr(data->final_content_type, "/vnd.cups-pdf") ||
              strcasestr(data->final_content_type, "/postscript") ||
@@ -875,15 +875,15 @@ ppdFilterLoadPPD(cf_filter_data_t *data) /* I/O - Job and printer data */
        else if (!strcasecmp(lastfilter, "pdftopdf") ||
                 !strcasecmp(lastfilter, "imagetopdf"))
        {
-         /* cfFilterPDFToPDF() is last filter (PDF printer) */
+         // cfFilterPDFToPDF() is last filter (PDF printer)
          page_logging = 1;
        }
        else if (!strcasecmp(lastfilter, "gstopxl"))
        {
-         /* cfFilterGhostscript() with PCL-XL output is last filter,
-            this is a Ghostscript-based filter without access to the
-            pages of the file to be printed, so the PDF filter has to
-            log the pages */
+         // cfFilterGhostscript() with PCL-XL output is last filter,
+         // this is a Ghostscript-based filter without access to the
+         // pages of the file to be printed, so the PDF filter has to
+         // log the pages
          page_logging = 1;
        }
        else if (!strcasecmp(lastfilter + strlen(lastfilter) - 8,
@@ -891,36 +891,36 @@ ppdFilterLoadPPD(cf_filter_data_t *data) /* I/O - Job and printer data */
                 !strcasecmp(lastfilter + strlen(lastfilter) - 5,
                             "topwg"))
        {
-         /* On IPP Everywhere printers which accept PWG Raster data one
-            of cfFilterGhostscript(), cfFilterPDFToRaster(), or
-            cfFilterMuPDFToPWG() is the last filter. These filters do not
-            log pages so the PDF filter has to do it */
+         // On IPP Everywhere printers which accept PWG Raster data one
+         // of cfFilterGhostscript(), cfFilterPDFToRaster(), or
+         // cfFilterMuPDFToPWG() is the last filter. These filters do not
+         // log pages so the PDF filter has to do it
          page_logging = 1;
        }
        else if (!strcasecmp(lastfilter, "foomatic-rip"))
        {
-         /* foomatic-rip is last filter, foomatic-rip is mainly used as
-            Ghostscript wrapper to use Ghostscript's built-in printer
-            drivers. Here there is also no access to the pages so that we
-            delegate the logging to the PDF filter */
+         // foomatic-rip is last filter, foomatic-rip is mainly used as
+         // Ghostscript wrapper to use Ghostscript's built-in printer
+         // drivers. Here there is also no access to the pages so that we
+         // delegate the logging to the PDF filter
          page_logging = 1;
        }
        else if (!strncasecmp(lastfilter + strlen(lastfilter) - 4, "tops", 4))
        {
-         /* Something-to PostScript filter is the last filter, so output is
-            PostScript but these filters only log with pure PostScript PPD
-            (no filter definition), so the PDF filter has to log */
+         // Something-to PostScript filter is the last filter, so output is
+         // PostScript but these filters only log with pure PostScript PPD
+         // (no filter definition), so the PDF filter has to log
          page_logging = 1;
        }
        else if (!strcasecmp(lastfilter, "hpps"))
        {
-         /* hpps is last filter, hpps is part of HPLIP and it is a bug that
-            it does not do the page logging. */
+         // hpps is last filter, hpps is part of HPLIP and it is a bug that
+         // it does not do the page logging.
          page_logging = 1;
        }
        else
        {
-         /* All the other filters (printer drivers) log pages as expected. */
+         // All the other filters (printer drivers) log pages as expected.
          page_logging = 0;
        }
       }
@@ -941,7 +941,7 @@ ppdFilterLoadPPD(cf_filter_data_t *data) /* I/O - Job and printer data */
                   (page_logging == 0 ? "not " : ""));
     }
 
-    /* Pass on the result as "pdf-filter-page-logging" option */
+    // Pass on the result as "pdf-filter-page-logging" option
     data->num_options = cupsAddOption("pdf-filter-page-logging",
                                      (page_logging == 1 ? "On" : "Off"),
                                      data->num_options, &(data->options));
@@ -951,16 +951,16 @@ ppdFilterLoadPPD(cf_filter_data_t *data) /* I/O - Job and printer data */
 }
 
 
-/*
- * 'ppdFilterFreePPDFile()' - After being done with the filter
- *                            functions free the memory used by the
- *                            PPD file data in the data structure. If
- *                            the pointer to the "libppd" is NULL, do
- *                            nothing.
- */
+//
+// 'ppdFilterFreePPDFile()' - After being done with the filter
+//                            functions free the memory used by the
+//                            PPD file data in the data structure. If
+//                            the pointer to the "libppd" is NULL, do
+//                            nothing.
+//
 
 void
-ppdFilterFreePPDFile(cf_filter_data_t *data) /* I - Job and printer data */
+ppdFilterFreePPDFile(cf_filter_data_t *data) // I - Job and printer data
 {
   ppd_filter_data_ext_t *filter_data_ext =
     (ppd_filter_data_ext_t *)cfFilterDataRemoveExt(data,
@@ -969,7 +969,7 @@ ppdFilterFreePPDFile(cf_filter_data_t *data) /* I - Job and printer data */
   if (filter_data_ext)
   {
     if (filter_data_ext->ppd)
-      /* ppdClose() frees not only the main data structure but also the cache */
+      // ppdClose() frees not only the main data structure but also the cache
       ppdClose(filter_data_ext->ppd);
 
     if (filter_data_ext->ppdfile)
@@ -982,16 +982,16 @@ ppdFilterFreePPDFile(cf_filter_data_t *data) /* I - Job and printer data */
 }
 
 
-/*
- * 'ppdFilterFreePPD()' - After being done with the filter functions
- *                        free the memory used by the PPD file data in
- *                        the data structure. If the pointers to the
- *                        data extracted from the PPD are NULL, do
- *                        nothing.
- */
+//
+// 'ppdFilterFreePPD()' - After being done with the filter functions
+//                        free the memory used by the PPD file data in
+//                        the data structure. If the pointers to the
+//                        data extracted from the PPD are NULL, do
+//                        nothing.
+//
 
 void
-ppdFilterFreePPD(cf_filter_data_t *data) /* I - Job and printer data */
+ppdFilterFreePPD(cf_filter_data_t *data) // I - Job and printer data
 {
   if (data->printer_attrs)
   {
@@ -1007,15 +1007,16 @@ ppdFilterFreePPD(cf_filter_data_t *data) /* I - Job and printer data */
 }
 
 
-/*
- * 'get_env_var()' - Auxiliary function for ppdFilterExternalCUPS(), gets value of
- *                   an environment variable in a list of environment variables
- *                   as used by the execve() function
- */
+//
+// 'get_env_var()' - Auxiliary function for ppdFilterExternalCUPS(),
+//                   gets value of an environment variable in a list
+//                   of environment variables as used by the execve()
+//                   function
+//
 
-static char *             /* O - The value, NULL if variable is not in list */
-get_env_var(char *name,   /* I - Name of environment variable to read */
-           char **env)   /* I - List of environment variable serttings */
+static char *             // O - The value, NULL if variable is not in list
+get_env_var(char *name,   // I - Name of environment variable to read
+           char **env)   // I - List of environment variable serttings
 {
   int i = 0;
 
@@ -1031,17 +1032,18 @@ get_env_var(char *name,   /* I - Name of environment variable to read */
 }
 
 
-/*
- * 'add_env_var()' - Auxiliary function for ppdFilterExternalCUPS(), adds/sets
- *                   an environment variable in a list of environment variables
- *                   as used by the execve() function
- */
+//
+// 'add_env_var()' - Auxiliary function for ppdFilterExternalCUPS(),
+//                   adds/sets an environment variable in a list of
+//                   environment variables as used by the execve()
+//                   function
+//
 
-static int                /* O - Index of where the new value got inserted in
-                                the list */
-add_env_var(char *name,   /* I - Name of environment variable to set */
-           char *value,  /* I - Value of environment variable to set */
-           char ***env)  /* I - List of environment variable serttings */
+static int                // O - Index of where the new value got inserted in
+                         //     the list
+add_env_var(char *name,   // I - Name of environment variable to set
+           char *value,  // I - Value of environment variable to set
+           char ***env)  // I - List of environment variable serttings
 {
   char *p;
   int i = 0,
@@ -1051,10 +1053,10 @@ add_env_var(char *name,   /* I - Name of environment variable to set */
   if (!name || !env || !name[0])
     return (-1);
 
-  /* Assemble a "VAR=VALUE" string and the string length of "VAR" */
+  // Assemble a "VAR=VALUE" string and the string length of "VAR"
   if ((p = strchr(name, '=')) != NULL)
   {
-    /* User supplied "VAR=VALUE" as name and NULL as value */
+    // User supplied "VAR=VALUE" as name and NULL as value
     if (value)
       return (-1);
     name_len = p - name;
@@ -1062,15 +1064,15 @@ add_env_var(char *name,   /* I - Name of environment variable to set */
   }
   else
   {
-    /* User supplied variable name and value as the name and as the value */
+    // User supplied variable name and value as the name and as the value
     name_len = strlen(name);
     p = (char *)calloc(strlen(name) + (value ? strlen(value) : 0) + 2,
                       sizeof(char));
     sprintf(p, "%s=%s", name, (value ? value : ""));
   }
 
-  /* Check whether we already have this variable in the list and update its
-     value if it is there */
+  // Check whether we already have this variable in the list and update its
+  // value if it is there
   if (*env)
     for (i = 0; (*env)[i]; i ++)
       if (strncmp((*env)[i], p, name_len) == 0 && (*env)[i][name_len] == '=')
@@ -1080,7 +1082,7 @@ add_env_var(char *name,   /* I - Name of environment variable to set */
        return (i);
       }
 
-  /* Add the variable as new item to the list */
+  // Add the variable as new item to the list
   *env = (char **)realloc(*env, (i + 2) * sizeof(char *));
   (*env)[i] = p;
   (*env)[i + 1] = NULL;
@@ -1088,192 +1090,193 @@ add_env_var(char *name,   /* I - Name of environment variable to set */
 }
 
 
-/*
- * 'sanitize_device_uri()' - Remove authentication info from a device URI
- */
+//
+// 'sanitize_device_uri()' - Remove authentication info from a device URI
+//
 
-static char *                           /* O - Sanitized URI */
-sanitize_device_uri(const char *uri,   /* I - Device URI */
-                   char *buf,          /* I - Buffer for output */
-                   size_t bufsize)     /* I - Size of buffer */
+static char *                           // O - Sanitized URI
+sanitize_device_uri(const char *uri,   // I - Device URI
+                   char *buf,          // I - Buffer for output
+                   size_t bufsize)     // I - Size of buffer
 {
-  char *start,                         /* Start of data after scheme */
-       *slash,                         /* First slash after scheme:// */
-       *ptr;                           /* Pointer into user@host:port part */
+  char *start,                         // Start of data after scheme
+       *slash,                         // First slash after scheme://
+       *ptr;                           // Pointer into user@host:port part
 
 
-  /* URI not supplied */
+  // URI not supplied
   if (!uri)
     return (NULL);
 
-  /* Copy the device URI to a temporary buffer so we can sanitize any auth
-   * info in it... */
+  // Copy the device URI to a temporary buffer so we can sanitize any auth
+  // info in it...
   strncpy(buf, uri, bufsize);
 
-  /* Find the end of the scheme:// part... */
+  // Find the end of the scheme:// part...
   if ((ptr = strchr(buf, ':')) != NULL)
   {
     for (start = ptr + 1; *start; start ++)
       if (*start != '/')
         break;
 
-    /* Find the next slash (/) in the URI... */
+    // Find the next slash (/) in the URI...
     if ((slash = strchr(start, '/')) == NULL)
-      slash = start + strlen(start);   /* No slash, point to the end */
+      slash = start + strlen(start);   // No slash, point to the end
 
-    /* Check for an @ sign before the slash... */
+    // Check for an @ sign before the slash...
     if ((ptr = strchr(start, '@')) != NULL && ptr < slash)
     {
-      /* Found an @ sign and it is before the resource part, so we have
-        an authentication string.  Copy the remaining URI over the
-        authentication string... */
+      // Found an @ sign and it is before the resource part, so we have
+      // an authentication string.  Copy the remaining URI over the
+      // authentication string...
       memmove(start, ptr + 1, strlen(ptr + 1) + 1);
     }
   }
 
-  /* Return the sanitized URI... */
+  // Return the sanitized URI...
   return (buf);
 }
 
 
-/*
- * 'fcntl_add_cloexec()' - Add FD_CLOEXEC flag to the flags
- *                         of a given file descriptor.
- */
+//
+// 'fcntl_add_cloexec()' - Add FD_CLOEXEC flag to the flags
+//                         of a given file descriptor.
+//
 
-static int                /* Return value of fcntl() */
-fcntl_add_cloexec(int fd) /* File descriptor to add FD_CLOEXEC to */
+static int                // Return value of fcntl()
+fcntl_add_cloexec(int fd) // File descriptor to add FD_CLOEXEC to
 {
   return fcntl(fd, F_SETFD, fcntl(fd, F_GETFD) | FD_CLOEXEC);
 }
 
 
-/*
- * 'fcntl_add_nonblock()' - Add O_NONBLOCK flag to the flags
- *                          of a given file descriptor.
- */
+//
+// 'fcntl_add_nonblock()' - Add O_NONBLOCK flag to the flags
+//                          of a given file descriptor.
 
-static int                 /* Return value of fcntl() */
-fcntl_add_nonblock(int fd) /* File descriptor to add O_NONBLOCK to */
+
+static int                 // Return value of fcntl()
+fcntl_add_nonblock(int fd) // File descriptor to add O_NONBLOCK to
 {
   return fcntl(fd, F_SETFL, fcntl(fd, F_GETFL) | O_NONBLOCK);
 }
 
 
-/*
- * 'ppdFilterExternalCUPS()' - Filter function which calls an external,
- *                          classic CUPS filter, for example a
- *                          (proprietary) printer driver which cannot
- *                          be converted to a filter function or is to
- *                          awkward or risky to convert for example
- *                          when the printer hardware is not available
- *                          for testing
- */
-
-int                                     /* O - Error status */
-ppdFilterExternalCUPS(int inputfd,      /* I - File descriptor input stream */
-                  int outputfd,        /* I - File descriptor output stream */
-                  int inputseekable,   /* I - Is input stream seekable? */
-                  cf_filter_data_t *data, /* I - Job and printer data */
-                  void *parameters)    /* I - Filter-specific parameters */
+//
+// 'ppdFilterExternalCUPS()' - Filter function which calls an
+//                             external, classic CUPS filter, for
+//                             example a (proprietary) printer driver
+//                             which cannot be converted to a filter
+//                             function or is to awkward or risky to
+//                             convert for example when the printer
+//                             hardware is not available for testing
+
+
+int                                        // O - Error status
+ppdFilterExternalCUPS(int inputfd,         // I - File descriptor input stream
+                     int outputfd,        // I - File descriptor output stream
+                     int inputseekable,   // I - Is input stream seekable?
+                     cf_filter_data_t *data, // I - Job and printer data
+                     void *parameters)    // I - Filter-specific parameters
 {
   ppd_filter_data_ext_t *filter_data_ext =
     (ppd_filter_data_ext_t *)cfFilterDataGetExt(data,
                                                PPD_FILTER_DATA_EXT);
   ppd_filter_external_cups_t *params = (ppd_filter_external_cups_t *)parameters;
   int           i;
-  int           is_backend = 0;      /* Do we call a CUPS backend? */
-  int          pid,                 /* Process ID of filter */
-                stderrpid,           /* Process ID for stderr logging process */
-                wpid;                /* PID reported as terminated */
-  int          fd;                  /* Temporary file descriptor */
-  int           backfd, sidefd;      /* file descriptors for back and side
-                                        channels */
-  int           stderrpipe[2];       /* Pipe to log stderr */
-  cups_file_t   *fp;                 /* File pointer to read log lines */
-  char          buf[2048];           /* Log line buffer */
-  cf_loglevel_t log_level;           /* Log level of filter's log message */
+  int           is_backend = 0;      // Do we call a CUPS backend?
+  int          pid,                 // Process ID of filter
+                stderrpid,           // Process ID for stderr logging process
+                wpid;                // PID reported as terminated
+  int          fd;                  // Temporary file descriptor
+  int           backfd, sidefd;      // file descriptors for back and side
+                                     // channels
+  int           stderrpipe[2];       // Pipe to log stderr
+  cups_file_t   *fp;                 // File pointer to read log lines
+  char          buf[2048];           // Log line buffer
+  cf_loglevel_t log_level;           // Log level of filter's log message
   char          *ptr1, *ptr2,
-                *msg,                /* Filter log message */
-                *filter_name;        /* Filter name for logging */
-  char          filter_path[1024];   /* Full path of the filter */
-  char          **argv,                     /* Command line args for filter */
-                **envp = NULL;       /* Environment variables for filter */
+                *msg,                // Filter log message
+                *filter_name;        // Filter name for logging
+  char          filter_path[1024];   // Full path of the filter
+  char          **argv,                     // Command line args for filter
+                **envp = NULL;       // Environment variables for filter
   int           num_all_options = 0;
   cups_option_t *all_options = NULL;
   char          job_id_str[16],
                 copies_str[16],
                 *options_str = NULL;
   cups_option_t *opt;
-  int status = 65536;
-  int wstatus;
-  cf_logfunc_t log = data->logfunc;
+  int           status = 65536;
+  int           wstatus;
+  cf_logfunc_t  log = data->logfunc;
   void          *ld = data->logdata;
   cf_filter_iscanceledfunc_t iscanceled = data->iscanceledfunc;
   void          *icd = data->iscanceleddata;
 
 
-  if (!params->filter || !params->filter[0]) {
+  if (!params->filter || !params->filter[0])
+  {
     if (log) log(ld, CF_LOGLEVEL_ERROR,
                 "ppdFilterExternalCUPS: Filter executable path/command not specified");
     return (1);
   }
 
-  /* Check whether back/side channel FDs are valid and not all-zero
-     from calloc'ed filter_data */
+  // Check whether back/side channel FDs are valid and not all-zero
+  // from calloc'ed filter_data
   if (data->back_pipe[0] == 0 && data->back_pipe[1] == 0)
     data->back_pipe[0] = data->back_pipe[1] = -1;
   if (data->side_pipe[0] == 0 && data->side_pipe[1] == 0)
     data->side_pipe[0] = data->side_pipe[1] = -1;
 
-  /* Select the correct end of the back/side channel pipes:
-     [0] for filters, [1] for backends */
+  // Select the correct end of the back/side channel pipes:
+  // [0] for filters, [1] for backends
   is_backend = (params->is_backend ? 1 : 0);
   backfd = data->back_pipe[is_backend];
   sidefd = data->side_pipe[is_backend];
 
-  /* Filter name for logging */
+  // Filter name for logging
   if ((filter_name = strrchr(params->filter, '/')) != NULL)
     filter_name ++;
   else
     filter_name = (char *)params->filter;
 
- /*
-  * Ignore broken pipe signals...
-  */
+  //
+  // Ignore broken pipe signals...
+  //
 
   signal(SIGPIPE, SIG_IGN);
 
- /*
-  * Copy the current environment variables and add some important ones
-  * needed for correct execution of the CUPS filter (which is not running
-  * out of CUPS here)
-  */
+  //
+  // Copy the current environment variables and add some important ones
+  // needed for correct execution of the CUPS filter (which is not running
+  // out of CUPS here)
+  //
 
-  /* Some default environment variables from CUPS, will get overwritten
-     if also defined in the environment in which the caller is started
-     or in the parameters */
+  // Some default environment variables from CUPS, will get overwritten
+  // if also defined in the environment in which the caller is started
+  // or in the parameters
   add_env_var("CUPS_DATADIR", CUPS_DATADIR, &envp);
   add_env_var("CUPS_SERVERBIN", CUPS_SERVERBIN, &envp);
   add_env_var("CUPS_SERVERROOT", CUPS_SERVERROOT, &envp);
   add_env_var("CUPS_STATEDIR", CUPS_STATEDIR, &envp);
-  add_env_var("SOFTWARE", "CUPS/2.5.99", &envp); /* Last CUPS with PPDs */
+  add_env_var("SOFTWARE", "CUPS/2.5.99", &envp); // Last CUPS with PPDs
   if (data->content_type)
     add_env_var("CONTENT_TYPE", data->content_type, &envp);
   if (data->final_content_type)
     add_env_var("FINAL_CONTENT_TYPE", data->final_content_type, &envp);
 
-  /* Copy the environment in which the caller got started */
+  // Copy the environment in which the caller got started
   if (environ)
     for (i = 0; environ[i]; i ++)
       add_env_var(environ[i], NULL, &envp);
 
-  /* Set the environment variables given by the parameters */
+  // Set the environment variables given by the parameters
   if (params->envp)
     for (i = 0; params->envp[i]; i ++)
       add_env_var(params->envp[i], NULL, &envp);
 
-  /* Add CUPS_SERVERBIN to the beginning of PATH */
+  // Add CUPS_SERVERBIN to the beginning of PATH
   ptr1 = get_env_var("PATH", envp);
   ptr2 = get_env_var("CUPS_SERVERBIN", envp);
   if (ptr2 && ptr2[0])
@@ -1289,24 +1292,24 @@ ppdFilterExternalCUPS(int inputfd,      /* I - File descriptor input stream */
     add_env_var("PATH", ptr1, &envp);
   }
 
-  if (params->is_backend < 2) /* Not needed in discovery mode of backend */
+  if (params->is_backend < 2) // Not needed in discovery mode of backend
   {
-    /* Print queue name from filter data */
+    // Print queue name from filter data
     if (data->printer)
       add_env_var("PRINTER", data->printer, &envp);
     else
       add_env_var("PRINTER", "Unknown", &envp);
 
-    /* PPD file path/name from filter data, required for most CUPS filters */
+    // PPD file path/name from filter data, required for most CUPS filters
     if (filter_data_ext && filter_data_ext->ppdfile)
       add_env_var("PPD", filter_data_ext->ppdfile, &envp);
 
-    /* Device URI from parameters */
+    // Device URI from parameters
     if (params->is_backend && params->device_uri)
       add_env_var("DEVICE_URI", (char *)params->device_uri, &envp);
   }
 
-  /* Determine full path for the filter */
+  // Determine full path for the filter
   if (params->filter[0] == '/' ||
       (ptr1 = get_env_var("CUPS_SERVERBIN", envp)) == NULL || !ptr1[0])
     strncpy(filter_path, params->filter, sizeof(filter_path) - 1);
@@ -1314,16 +1317,18 @@ ppdFilterExternalCUPS(int inputfd,      /* I - File descriptor input stream */
     snprintf(filter_path, sizeof(filter_path), "%s/%s/%s", ptr1,
             params->is_backend ? "backend" : "filter", params->filter);
 
-  /* Log the resulting list of environment variable settings
-     (with any authentication info removed)*/
+  // Log the resulting list of environment variable settings
+  // (with any authentication info removed)
   if (log)
   {
     for (i = 0; envp[i]; i ++)
       if (!strncmp(envp[i], "AUTH_", 5))
-       log(ld, CF_LOGLEVEL_DEBUG, "ppdFilterExternalCUPS (%s): envp[%d]: AUTH_%c****",
+       log(ld, CF_LOGLEVEL_DEBUG,
+           "ppdFilterExternalCUPS (%s): envp[%d]: AUTH_%c****",
            filter_name, i, envp[i][5]);
       else if (!strncmp(envp[i], "DEVICE_URI=", 11))
-       log(ld, CF_LOGLEVEL_DEBUG, "ppdFilterExternalCUPS (%s): envp[%d]: DEVICE_URI=%s",
+       log(ld, CF_LOGLEVEL_DEBUG,
+           "ppdFilterExternalCUPS (%s): envp[%d]: DEVICE_URI=%s",
            filter_name, i, sanitize_device_uri(envp[i] + 11,
                                                buf, sizeof(buf)));
       else
@@ -1331,16 +1336,17 @@ ppdFilterExternalCUPS(int inputfd,      /* I - File descriptor input stream */
            filter_name, i, envp[i]);
   }
 
-  if (params->is_backend < 2) {
-   /*
-    * Filter or backend for job execution
-    */
+  if (params->is_backend < 2)
+  {
+    //
+    // Filter or backend for job execution
+    //
 
-   /*
-    * Join the options from the filter data and from the parameters
-    * If an option is present in both filter data and parameters, the
-    * value in the filter data has priority
-    */
+    //
+    // Join the options from the filter data and from the parameters
+    // If an option is present in both filter data and parameters, the
+    // value in the filter data has priority
+    //
 
     for (i = 0, opt = params->options; i < params->num_options; i ++, opt ++)
       num_all_options = cupsAddOption(opt->name, opt->value, num_all_options,
@@ -1349,23 +1355,25 @@ ppdFilterExternalCUPS(int inputfd,      /* I - File descriptor input stream */
       num_all_options = cupsAddOption(opt->name, opt->value, num_all_options,
                                      &all_options);
 
-   /*
-    * Create command line arguments for the CUPS filter
-    */
+    //
+    // Create command line arguments for the CUPS filter
+    //
 
     argv = (char **)calloc(7, sizeof(char *));
 
-    /* Numeric parameters */
+    // Numeric parameters
     snprintf(job_id_str, sizeof(job_id_str) - 1, "%d",
             data->job_id > 0 ? data->job_id : 1);
     snprintf(copies_str, sizeof(copies_str) - 1, "%d",
             data->copies > 0 ? data->copies : 1);
 
-    /* Options, build string of "Name1=Value1 Name2=Value2 ..." but use
-       "Name" and "noName" instead for boolean options */
-    for (i = 0, opt = all_options; i < num_all_options; i ++, opt ++) {
+    // Options, build string of "Name1=Value1 Name2=Value2 ..." but use
+    // "Name" and "noName" instead for boolean options
+    for (i = 0, opt = all_options; i < num_all_options; i ++, opt ++)
+    {
       if (strcasecmp(opt->value, "true") == 0 ||
-         strcasecmp(opt->value, "false") == 0) {
+         strcasecmp(opt->value, "false") == 0)
+      {
        options_str =
          (char *)realloc(options_str,
                          ((options_str ? strlen(options_str) : 0) +
@@ -1376,7 +1384,9 @@ ppdFilterExternalCUPS(int inputfd,      /* I - File descriptor input stream */
          options_str[0] = '\0';
        sprintf(options_str + strlen(options_str), " %s%s",
                (strcasecmp(opt->value, "false") == 0 ? "no" : ""), opt->name);
-      } else {
+      }
+      else
+      {
        options_str =
          (char *)realloc(options_str,
                          ((options_str ? strlen(options_str) : 0) +
@@ -1384,17 +1394,18 @@ ppdFilterExternalCUPS(int inputfd,      /* I - File descriptor input stream */
                          sizeof(char));
        if (i == 0)
          options_str[0] = '\0';
-       sprintf(options_str + strlen(options_str), " %s=%s", opt->name, opt->value);
+       sprintf(options_str + strlen(options_str), " %s=%s", opt->name,
+               opt->value);
       }
     }
 
-    /* Find DEVICE_URI environment variable */
+    // Find DEVICE_URI environment variable
     if (params->is_backend && !params->device_uri)
       for (i = 0; envp[i]; i ++)
        if (strncmp(envp[i], "DEVICE_URI=", 11) == 0)
          break;
 
-    /* Add items to array */
+    // Add items to array
     argv[0] = strdup((params->is_backend && params->device_uri ?
                      (char *)sanitize_device_uri(params->device_uri,
                                                  buf, sizeof(buf)) :
@@ -1410,50 +1421,58 @@ ppdFilterExternalCUPS(int inputfd,      /* I - File descriptor input stream */
     argv[5] = options_str ? options_str + 1 : "";
     argv[6] = NULL;
 
-    /* Log the arguments */
+    // Log the arguments
     if (log)
       for (i = 0; argv[i]; i ++)
        log(ld, CF_LOGLEVEL_DEBUG, "ppdFilterExternalCUPS (%s): argv[%d]: %s",
            filter_name, i, argv[i]);
-  } else {
-   /*
-    * Backend in device discovery mode
-    */
+  }
+  else
+  {
+    //
+    // Backend in device discovery mode
+    //
 
     argv = (char **)calloc(2, sizeof(char *));
     argv[0] = strdup((char *)params->filter);
     argv[1] = NULL;
   }
 
- /*
-  * Execute the filter
-  */
+  //
+  // Execute the filter
+  //
 
-  if (pipe(stderrpipe) < 0) {
+  if (pipe(stderrpipe) < 0)
+  {
     if (log) log(ld, CF_LOGLEVEL_ERROR,
                 "ppdFilterExternalCUPS (%s): Could not create pipe for stderr: %s",
                 filter_name, strerror(errno));
     return (1);
   }
 
-  if ((pid = fork()) == 0) {
-   /*
-    * Child process goes here...
-    *
-    * Update stdin/stdout/stderr as needed...
-    */
+  if ((pid = fork()) == 0)
+  {
+    //
+    // Child process goes here...
+    //
+    // Update stdin/stdout/stderr as needed...
+    //
 
-    if (inputfd != 0) {
-      if (inputfd < 0) {
+    if (inputfd != 0)
+    {
+      if (inputfd < 0)
+      {
         inputfd = open("/dev/null", O_RDONLY);
        if (log) log(ld, CF_LOGLEVEL_ERROR,
                     "ppdFilterExternalCUPS (%s): No input file descriptor supplied for CUPS filter - %s",
-                  filter_name, strerror(errno));
+                    filter_name, strerror(errno));
       }
 
-      if (inputfd > 0) {
+      if (inputfd > 0)
+      {
        fcntl_add_cloexec(inputfd);
-        if (dup2(inputfd, 0) < 0) {
+        if (dup2(inputfd, 0) < 0)
+       {
          if (log) log(ld, CF_LOGLEVEL_ERROR,
                       "ppdFilterExternalCUPS (%s): Failed to connect input file descriptor with CUPS filter's stdin - %s",
                       filter_name, strerror(errno));
@@ -1464,12 +1483,14 @@ ppdFilterExternalCUPS(int inputfd,      /* I - File descriptor input stream */
                       filter_name, inputfd);
        close(inputfd);
       }
-    } else
+    }
+    else
       if (log) log(ld, CF_LOGLEVEL_DEBUG,
                   "ppdFilterExternalCUPS (%s): Input comes from stdin, letting the filter grab stdin directly",
                   filter_name);
 
-    if (outputfd != 1) {
+    if (outputfd != 1)
+    {
       if (outputfd < 0)
         outputfd = open("/dev/null", O_WRONLY);
 
@@ -1480,17 +1501,21 @@ ppdFilterExternalCUPS(int inputfd,      /* I - File descriptor input stream */
       }
     }
 
-    if (strcasestr(params->filter, "gziptoany")) {
-      /* Send stderr to the Nirwana if we are running gziptoany, as
-        gziptoany emits a false "PAGE: 1 1" */
-      if ((fd = open("/dev/null", O_RDWR)) > 2) {
+    if (strcasestr(params->filter, "gziptoany"))
+    {
+      // Send stderr to the Nirwana if we are running gziptoany, as
+      // gziptoany emits a false "PAGE: 1 1"
+      if ((fd = open("/dev/null", O_RDWR)) > 2)
+      {
        fcntl_add_cloexec(fd);
        dup2(fd, 2);
        close(fd);
       } else
         close(fd);
-    } else {
-      /* Send stderr into pipe for logging */
+    }
+    else
+    {
+      // Send stderr into pipe for logging
       fcntl_add_cloexec(stderrpipe[1]);
       dup2(stderrpipe[1], 2);
       fcntl_add_nonblock(2);
@@ -1498,28 +1523,38 @@ ppdFilterExternalCUPS(int inputfd,      /* I - File descriptor input stream */
     close(stderrpipe[0]);
     close(stderrpipe[1]);
 
-    if (params->is_backend < 2) { /* Not needed in discovery mode of backend */
-      /* Back channel */
-      if (backfd != 3 && backfd >= 0) {
+    if (params->is_backend < 2) // Not needed in discovery mode of backend
+    {
+      // Back channel
+      if (backfd != 3 && backfd >= 0)
+      {
        dup2(backfd, 3);
        close(backfd);
        fcntl_add_nonblock(3);
-      } else if (backfd < 0) {
-       if ((backfd = open("/dev/null", O_RDWR)) > 3) {
+      }
+      else if (backfd < 0)
+      {
+       if ((backfd = open("/dev/null", O_RDWR)) > 3)
+       {
          dup2(backfd, 3);
          close(backfd);
-       } else
+       }
+       else
          close(backfd);
        fcntl_add_nonblock(3);
       }
 
-      /* Side channel */
-      if (sidefd != 4 && sidefd >= 0) {
+      // Side channel
+      if (sidefd != 4 && sidefd >= 0)
+      {
        dup2(sidefd, 4);
        close(sidefd);
        fcntl_add_nonblock(4);
-      } else if (sidefd < 0) {
-       if ((sidefd = open("/dev/null", O_RDWR)) > 4) {
+      }
+      else if (sidefd < 0)
+      {
+       if ((sidefd = open("/dev/null", O_RDWR)) > 4)
+       {
          dup2(sidefd, 4);
          close(sidefd);
        } else
@@ -1528,9 +1563,9 @@ ppdFilterExternalCUPS(int inputfd,      /* I - File descriptor input stream */
       }
     }
 
-   /*
-    * Execute command...
-    */
+    //
+    // Execute command...
+    //
 
     execve(filter_path, argv, envp);
 
@@ -1541,11 +1576,15 @@ ppdFilterExternalCUPS(int inputfd,      /* I - File descriptor input stream */
 
   fd_error:
     exit(errno);
-  } else if (pid > 0) {
+  }
+  else if (pid > 0)
+  {
     if (log) log(ld, CF_LOGLEVEL_INFO,
                 "ppdFilterExternalCUPS (%s): %s (PID %d) started.",
                 filter_name, filter_path, pid);
-  } else {
+  }
+  else
+  {
     if (log) log(ld, CF_LOGLEVEL_ERROR,
                 "ppdFilterExternalCUPS (%s): Unable to fork process for %s %s",
                 filter_name, params->is_backend ? "backend" : "filter",
@@ -1560,59 +1599,79 @@ ppdFilterExternalCUPS(int inputfd,      /* I - File descriptor input stream */
   if (outputfd >= 0)
     close(outputfd);
 
- /*
-  * Log the filter's stderr
-  */
+  //
+  // Log the filter's stderr
+  //
 
-  if ((stderrpid = fork()) == 0) {
-   /*
-    * Child process goes here...
-    */
+  if ((stderrpid = fork()) == 0)
+  {
+    //
+    // Child process goes here...
+    //
 
     close(stderrpipe[1]);
     fp = cupsFileOpenFd(stderrpipe[0], "r");
     while (cupsFileGets(fp, buf, sizeof(buf)))
-      if (log) {
-       if (strncmp(buf, "DEBUG: ", 7) == 0) {
+      if (log)
+      {
+       if (strncmp(buf, "DEBUG: ", 7) == 0)
+       {
          log_level = CF_LOGLEVEL_DEBUG;
          msg = buf + 7;
-       } else if (strncmp(buf, "DEBUG2: ", 8) == 0) {
+       }
+       else if (strncmp(buf, "DEBUG2: ", 8) == 0)
+       {
          log_level = CF_LOGLEVEL_DEBUG;
          msg = buf + 8;
-       } else if (strncmp(buf, "INFO: ", 6) == 0) {
+       }
+       else if (strncmp(buf, "INFO: ", 6) == 0)
+       {
          log_level = CF_LOGLEVEL_INFO;
          msg = buf + 6;
-       } else if (strncmp(buf, "WARNING: ", 9) == 0) {
+       }
+       else if (strncmp(buf, "WARNING: ", 9) == 0)
+       {
          log_level = CF_LOGLEVEL_WARN;
          msg = buf + 9;
-       } else if (strncmp(buf, "ERROR: ", 7) == 0) {
+       }
+       else if (strncmp(buf, "ERROR: ", 7) == 0)
+       {
          log_level = CF_LOGLEVEL_ERROR;
          msg = buf + 7;
-       } else if (strncmp(buf, "PAGE: ", 6) == 0 ||
-                  strncmp(buf, "ATTR: ", 6) == 0 ||
-                  strncmp(buf, "STATE: ", 7) == 0 ||
-                  strncmp(buf, "PPD: ", 5) == 0) {
+       }
+       else if (strncmp(buf, "PAGE: ", 6) == 0 ||
+                strncmp(buf, "ATTR: ", 6) == 0 ||
+                strncmp(buf, "STATE: ", 7) == 0 ||
+                strncmp(buf, "PPD: ", 5) == 0)
+       {
          log_level = CF_LOGLEVEL_CONTROL;
          msg = buf;
-       } else {
+       }
+       else
+       {
          log_level = CF_LOGLEVEL_DEBUG;
          msg = buf;
        }
        if (log_level == CF_LOGLEVEL_CONTROL)
          log(ld, log_level, msg);
        else
-         log(ld, log_level, "ppdFilterExternalCUPS (%s): %s", filter_name, msg);
+         log(ld, log_level, "ppdFilterExternalCUPS (%s): %s",
+             filter_name, msg);
       }
     cupsFileClose(fp);
-    /* No need to close the fd stderrpipe[0], as cupsFileClose(fp) does this
-       already */
-    /* Ignore errors of the logging process */
+    // No need to close the fd stderrpipe[0], as cupsFileClose(fp) does this
+    // already
+    // Ignore errors of the logging process
     exit(0);
-  } else if (stderrpid > 0) {
+  }
+  else if (stderrpid > 0)
+  {
     if (log) log(ld, CF_LOGLEVEL_INFO,
                 "ppdFilterExternalCUPS (%s): Logging (PID %d) started.",
                 filter_name, stderrpid);
-  } else {
+  }
+  else
+  {
     if (log) log(ld, CF_LOGLEVEL_ERROR,
                 "ppdFilterExternalCUPS (%s): Unable to fork process for logging",
                 filter_name);
@@ -1625,15 +1684,18 @@ ppdFilterExternalCUPS(int inputfd,      /* I - File descriptor input stream */
   close(stderrpipe[0]);
   close(stderrpipe[1]);
 
- /*
-  * Wait for filter and logging processes to finish
-  */
+  //
+  // Wait for filter and logging processes to finish
+  //
 
   status = 0;
 
-  while (pid > 0 || stderrpid > 0) {
-    if ((wpid = wait(&wstatus)) < 0) {
-      if (errno == EINTR && iscanceled && iscanceled(icd)) {
+  while (pid > 0 || stderrpid > 0)
+  {
+    if ((wpid = wait(&wstatus)) < 0)
+    {
+      if (errno == EINTR && iscanceled && iscanceled(icd))
+      {
        if (log) log(ld, CF_LOGLEVEL_DEBUG,
                     "ppdFilterExternalCUPS (%s): Job canceled, killing %s ...",
                     filter_name, params->is_backend ? "backend" : "filter");
@@ -1642,14 +1704,17 @@ ppdFilterExternalCUPS(int inputfd,      /* I - File descriptor input stream */
        kill(stderrpid, SIGTERM);
        stderrpid = -1;
        break;
-      } else
+      }
+      else
        continue;
     }
 
-    /* How did the filter terminate */
-    if (wstatus) {
-      if (WIFEXITED(wstatus)) {
-       /* Via exit() anywhere or return() in the main() function */
+    // How did the filter terminate
+    if (wstatus)
+    {
+      if (WIFEXITED(wstatus))
+      {
+       // Via exit() anywhere or return() in the main() function
        if (log) log(ld, CF_LOGLEVEL_ERROR,
                     "ppdFilterExternalCUPS (%s): %s (PID %d) stopped with status %d",
                     filter_name,
@@ -1657,8 +1722,10 @@ ppdFilterExternalCUPS(int inputfd,      /* I - File descriptor input stream */
                      (params->is_backend ? "Backend" : "Filter") :
                      "Logging"),
                     wpid, WEXITSTATUS(wstatus));
-      } else {
-       /* Via signal */
+      }
+      else
+      {
+       // Via signal
        if (log) log(ld, CF_LOGLEVEL_ERROR,
                     "ppdFilterExternalCUPS (%s): %s (PID %d) crashed on signal %d",
                     filter_name,
@@ -1668,7 +1735,9 @@ ppdFilterExternalCUPS(int inputfd,      /* I - File descriptor input stream */
                     wpid, WTERMSIG(wstatus));
       }
       status = 1;
-    } else {
+    }
+    else
+    {
       if (log) log(ld, CF_LOGLEVEL_INFO,
                   "ppdFilterExternalCUPS (%s): %s (PID %d) exited with no errors.",
                   filter_name,
@@ -1682,9 +1751,9 @@ ppdFilterExternalCUPS(int inputfd,      /* I - File descriptor input stream */
       stderrpid = -1;
   }
 
- /*
-  * Clean up
-  */
+  //
+  // Clean up
+  //
 
  out:
   cupsFreeOptions(num_all_options, all_options);
@@ -1700,18 +1769,18 @@ ppdFilterExternalCUPS(int inputfd,      /* I - File descriptor input stream */
 }
 
 
-/*
- * 'ppdFilterEmitJCL()' - Wrapper for the PDF-generating filter
- *                        functions to emit JCL (PJL) before and after
- *                        the PDF output.
- */
+//
+// 'ppdFilterEmitJCL()' - Wrapper for the PDF-generating filter
+//                        functions to emit JCL (PJL) before and after
+//                        the PDF output.
+//
 
-int                                   /* O - Error status */
-ppdFilterEmitJCL(int inputfd,         /* I - File descriptor input stream */
-                int outputfd,        /* I - File descriptor output stream */
-                int inputseekable,   /* I - Is input stream seekable? */
-                cf_filter_data_t *data, /* I - Job and printer data */
-                void *parameters,    /* I - Filter-specific parameters */
+int                                   // O - Error status
+ppdFilterEmitJCL(int inputfd,         // I - File descriptor input stream
+                int outputfd,        // I - File descriptor output stream
+                int inputseekable,   // I - Is input stream seekable?
+                cf_filter_data_t *data, // I - Job and printer data
+                void *parameters,    // I - Filter-specific parameters
                 cf_filter_function_t orig_filter)
 {
   ppd_filter_data_ext_t *filter_data_ext =
@@ -1726,20 +1795,20 @@ ppdFilterEmitJCL(int inputfd,         /* I - File descriptor input stream */
   FILE          *fp;
   int           hw_copies = 1;
   bool          hw_collate = false;
-  int          status,          /* Exit status */
-                retval = 1;     /* Return value */
+  int          status,          // Exit status
+                retval = 1;     // Return value
   cf_logfunc_t  log = data->logfunc;
   void          *ld = data->logdata;
 
 
- /*
-  * Check whether we are in streaming mode (cfFilterPDFToPDF() only)
-  *
-  * If we are in streaming mode of cfFilterPDFToPDF() we only apply
-  * JCL and do not run the job through cfFilterPDFToPDF() itself (so
-  * no page management, form flattening, page size/orientation
-  * adjustment, ...)
-  */
+  //
+  // Check whether we are in streaming mode (cfFilterPDFToPDF() only)
+  //
+  // If we are in streaming mode of cfFilterPDFToPDF() we only apply
+  // JCL and do not run the job through cfFilterPDFToPDF() itself (so
+  // no page management, form flattening, page size/orientation
+  // adjustment, ...)
+  //
 
   if (orig_filter == cfFilterPDFToPDF &&
       (val = cupsGetOption("filter-streaming-mode",
@@ -1752,10 +1821,10 @@ ppdFilterEmitJCL(int inputfd,         /* I - File descriptor input stream */
                 "ppdFilterEmitJCL: Streaming mode: No PDF processing, only adding of JCL");
   }
 
- /*
-  * Call the original filter function without forking if we suppress
-  * JCL output via option...
-  */
+  //
+  // Call the original filter function without forking if we suppress
+  // JCL output via option...
+  //
 
   if ((val = cupsGetOption("emit-jcl",
                           data->num_options, data->options)) != NULL &&
@@ -1763,11 +1832,11 @@ ppdFilterEmitJCL(int inputfd,         /* I - File descriptor input stream */
        strcasecmp(val, "no") == 0))
   {
     if (!streaming)
-      /* Call actual filter function from libcupsfilters */
+      // Call actual filter function from libcupsfilters
       ret = orig_filter(inputfd, outputfd, inputseekable, data, parameters);
     else
     {
-      /* Just pass through the data unchanged... */
+      // Just pass through the data unchanged...
       fp = fdopen(outputfd, "w");
       while ((bytes = read(inputfd, buf, sizeof(buf))) > 0)
        fwrite(buf, 1, bytes, fp);
@@ -1780,9 +1849,9 @@ ppdFilterEmitJCL(int inputfd,         /* I - File descriptor input stream */
 
   if (!streaming)
   {
-   /*
-    * Create pipe for output of original filter function...
-    */
+    //
+    // Create pipe for output of original filter function...
+    //
 
     if (pipe(outfds) < 0)
     {
@@ -1792,17 +1861,17 @@ ppdFilterEmitJCL(int inputfd,         /* I - File descriptor input stream */
       return (1);
     }
 
-   /*
-    * Fork child process for original filter function...
-    */
+    //
+    // Fork child process for original filter function...
+    //
 
     if ((pid = fork()) == 0)
     {
-      /* Send output into pipe for adding JCL */
+      // Send output into pipe for adding JCL
       fcntl_add_cloexec(outfds[1]);
       close(outfds[0]);
 
-      /* Call actual filter function from libcupsfilters */
+      // Call actual filter function from libcupsfilters
       ret = orig_filter(inputfd, outfds[1], inputseekable, data, parameters);
 
       exit(ret);
@@ -1816,7 +1885,7 @@ ppdFilterEmitJCL(int inputfd,         /* I - File descriptor input stream */
     else
     {
       if (log) log(ld, CF_LOGLEVEL_ERROR,
-                "ppdFilterEmitJCL: Unable to fork process for filter function.");
+                  "ppdFilterEmitJCL: Unable to fork process for filter function.");
       close(outfds[0]);
       close(outfds[1]);
       retval = 1;
@@ -1828,16 +1897,15 @@ ppdFilterEmitJCL(int inputfd,         /* I - File descriptor input stream */
     close(outfds[1]);
   }
   else
-
-   /*
-    * In Streaming mode we simply copy the input
-    */
+    //
+    // In Streaming mode we simply copy the input
+    //
 
     outfds[0] = inputfd;
 
- /*
-  * Check options for caller's instructions about hardware copies/collate
-  */
+  //
+  // Check options for caller's instructions about hardware copies/collate
+  //
 
   hw_copies =
     ((val = cupsGetOption("hardware-copies",
@@ -1853,9 +1921,9 @@ ppdFilterEmitJCL(int inputfd,         /* I - File descriptor input stream */
      (strcasecmp(val, "true") == 0 || strcasecmp(val, "on") == 0 ||
       strcasecmp(val, "yes") == 0));
 
- /*
-  * Assemble the output: Exit server, JCL preamble, PDF output, JCL postamble
-  */
+  //
+  // Assemble the output: Exit server, JCL preamble, PDF output, JCL postamble
+  //
 
   fp = fdopen(outputfd, "w");
   if (filter_data_ext)
@@ -1874,9 +1942,9 @@ ppdFilterEmitJCL(int inputfd,         /* I - File descriptor input stream */
 
   if (!streaming)
   {
-   /*
-    * Wait for filter process to finish
-    */
+    //
+    // Wait for filter process to finish
+    //
 
   retry_wait:
     if (waitpid (pid, &status, 0) == -1)
@@ -1894,12 +1962,12 @@ ppdFilterEmitJCL(int inputfd,         /* I - File descriptor input stream */
                 "ppdFilterEmitJCL: Filter function (PID %d) exited with no errors.",
                 pid);
 
-    /* How did the filter function terminate */
+    // How did the filter function terminate
     if (WIFEXITED(status))
-      /* Via exit() anywhere or return() in the main() function */
+      // Via exit() anywhere or return() in the main() function
       retval = WEXITSTATUS(status);
     else if (WIFSIGNALED(status))
-      /* Via signal */
+      // Via signal
       retval = 256 * WTERMSIG(status);
   }
   else
@@ -1910,54 +1978,54 @@ ppdFilterEmitJCL(int inputfd,         /* I - File descriptor input stream */
 }
 
 
-/*
- * 'ppdFilterImageToPDF()' - Wrapper for the filter function
- *                           cfFilterImageToPDF() to add PPD file
- *                           support to it.
- */
+//
+// 'ppdFilterImageToPDF()' - Wrapper for the filter function
+//                           cfFilterImageToPDF() to add PPD file
+//                           support to it.
+//
 
-int                                       /* O - Error status */
-ppdFilterImageToPDF(int inputfd,          /* I - File descriptor input stream */
-                   int outputfd,         /* I - File descriptor output stream*/
-                   int inputseekable,    /* I - Is input stream seekable? */
-                   cf_filter_data_t *data, /* I - Job and printer data */
-                   void *parameters)     /* I - Filter-specific parameters */
+int                                       // O - Error status
+ppdFilterImageToPDF(int inputfd,          // I - File descriptor input stream
+                   int outputfd,         // I - File descriptor output stream
+                   int inputseekable,    // I - Is input stream seekable?
+                   cf_filter_data_t *data, // I - Job and printer data
+                   void *parameters)     // I - Filter-specific parameters
 {
   return ppdFilterEmitJCL(inputfd, outputfd, inputseekable, data,
                          parameters, cfFilterImageToPDF);
 }
 
 
-/*
- * 'ppdFilterPDFtoPDF()' - Wrapper for the filter function 
- *                         cfFilterPDFtoPDF() to add PPD file
- *                         support to it.
- */
+//
+// 'ppdFilterPDFtoPDF()' - Wrapper for the filter function 
+//                         cfFilterPDFtoPDF() to add PPD file
+//                         support to it.
+//
 
-int                                    /* O - Error status */
-ppdFilterPDFToPDF(int inputfd,         /* I - File descriptor input stream */
-                 int outputfd,        /* I - File descriptor output stream */
-                 int inputseekable,   /* I - Is input stream seekable? */
-                 cf_filter_data_t *data, /* I - Job and printer data */
-                 void *parameters)    /* I - Filter-specific parameters */
+int                                    // O - Error status
+ppdFilterPDFToPDF(int inputfd,         // I - File descriptor input stream
+                 int outputfd,        // I - File descriptor output stream
+                 int inputseekable,   // I - Is input stream seekable?
+                 cf_filter_data_t *data, // I - Job and printer data
+                 void *parameters)    // I - Filter-specific parameters
 {
   return ppdFilterEmitJCL(inputfd, outputfd, inputseekable, data,
                          parameters, cfFilterPDFToPDF);
 }
 
 
-/*
- * 'ppdFilterUniversal()' - Wrapper for the filter function
- *                          cfFilterUniversal() to add PPD file
- *                          support to it.
- */
+//
+// 'ppdFilterUniversal()' - Wrapper for the filter function
+//                          cfFilterUniversal() to add PPD file
+//                          support to it.
+//
 
-int                                     /* O - Error status */
-ppdFilterUniversal(int inputfd,         /* I - File descriptor input stream */
-                  int outputfd,        /* I - File descriptor output stream*/
-                  int inputseekable,   /* I - Is input stream seekable? */
-                  cf_filter_data_t *data, /* I - Job and printer data */
-                  void *parameters)    /* I - Filter-specific parameters */
+int                                     // O - Error status
+ppdFilterUniversal(int inputfd,         // I - File descriptor input stream
+                  int outputfd,        // I - File descriptor output stream
+                  int inputseekable,   // I - Is input stream seekable?
+                  cf_filter_data_t *data, // I - Job and printer data
+                  void *parameters)    // I - Filter-specific parameters
 {
   ppd_filter_data_ext_t *filter_data_ext =
     (ppd_filter_data_ext_t *)cfFilterDataGetExt(data,
@@ -2010,29 +2078,29 @@ ppdFilterUniversal(int inputfd,         /* I - File descriptor input stream */
     {
       cache = ppd ? ppd->cache : NULL;
 
-      /* Check whether our output format (under CUPS it is taken from
-        the FINAL_CONTENT_TYPE env variable) is the destination format
-        (2nd word) of a "*cupsFilter2: ..." line (string has 4 words),
-        in this case the specified filter (4th word) does the last
-        step, converting from the input format (1st word) of the line
-        to the destination format and so we only need to convert to the
-        input format. In this case we need to correct our output
-        format.
-
-        If there is more than one line with the given output format and
-        an inpout format we can produce, we select the one with the
-        lowest cost value (3rd word) as this is the one which CUPS
-        should have chosen for this job.
-
-        If we have "*cupsFilter: ..." lines (without "2", string with 3
-        words) we do not need to do anything special, as the input
-        format specified is the FIMAL_CONTENT_TYPE which CUPS supplies
-        to us and into which we have to convert. So we quit parsing if
-        the first line has only 3 words, as if CUPS uses the
-        "*cupsFilter: ..."  lines only if there is no "*cupsFilter2:
-        ..." line min the PPD, so if we encounter a line with only 3
-        words the other lines will have only 3 words, too and nothing
-        has to be done. */
+      // Check whether our output format (under CUPS it is taken from
+      // the FINAL_CONTENT_TYPE env variable) is the destination format
+      // (2nd word) of a "*cupsFilter2: ..." line (string has 4 words),
+      // in this case the specified filter (4th word) does the last
+      // step, converting from the input format (1st word) of the line
+      // to the destination format and so we only need to convert to the
+      // input format. In this case we need to correct our output
+      // format.
+      //
+      // If there is more than one line with the given output format and
+      // an inpout format we can produce, we select the one with the
+      // lowest cost value (3rd word) as this is the one which CUPS
+      // should have chosen for this job.
+      //
+      // If we have "*cupsFilter: ..." lines (without "2", string with 3
+      // words) we do not need to do anything special, as the input
+      // format specified is the FIMAL_CONTENT_TYPE which CUPS supplies
+      // to us and into which we have to convert. So we quit parsing if
+      // the first line has only 3 words, as if CUPS uses the
+      // "*cupsFilter: ..."  lines only if there is no "*cupsFilter2:
+      // ..." line min the PPD, so if we encounter a line with only 3
+      // words the other lines will have only 3 words, too and nothing
+      // has to be done.
 
       if (ppd && ppd->num_filters && cache)
       {
@@ -2048,18 +2116,18 @@ ppdFilterUniversal(int inputfd,         /* I - File descriptor input stream */
        {
          char buf[256];
          char *ptr,
-           *in = NULL,
-           *out = NULL,
-           *coststr = NULL;
-         int cost;
+              *in = NULL,
+              *out = NULL,
+              *coststr = NULL;
+         int  cost;
 
          if (log) log(ld, CF_LOGLEVEL_DEBUG,
                       "ppdFilterUniversal:    %s", filter);
 
-         /* String of the "*cupsfilter:" or "*cupsfilter2:" line */
+         // String of the "*cupsfilter:" or "*cupsfilter2:" line
          strncpy(buf, filter, sizeof(buf) - 1);
 
-         /* Separate the words */
+         // Separate the words
          in = ptr = buf;
          while (*ptr && !isspace(*ptr)) ptr ++;
          if (!*ptr) goto error;
@@ -2084,12 +2152,12 @@ ppdFilterUniversal(int inputfd,         /* I - File descriptor input stream */
          if (!*ptr) goto error;
          cost = atoi(coststr);
 
-         /* Valid "*cupsFilter2: ..." line ... */
-         if (/* Must be of lower cost than what we selected before */
+         // Valid "*cupsFilter2: ..." line ...
+         if (// Must be of lower cost than what we selected before
              cost < lowest_cost &&
-             /* Must have our FINAL_CONTENT_TYPE as output */
+             // Must have our FINAL_CONTENT_TYPE as output
              strcasecmp(out, final_output) == 0 &&
-             /* Must have as input a format we are able to produce */
+             // Must have as input a format we are able to produce
              (strcasecmp(in, "application/vnd.cups-raster") == 0 ||
               strcasecmp(in, "application/vnd.cups-pdf") == 0 ||
               strcasecmp(in, "application/vnd.cups-postscript") == 0 ||
@@ -2101,11 +2169,11 @@ ppdFilterUniversal(int inputfd,         /* I - File descriptor input stream */
          {
            if (log) log(ld, CF_LOGLEVEL_DEBUG,
                         "ppdFilterUniversal:       --> Selecting this line");
-           /* Take the input format of the line as output format for us */
+           // Take the input format of the line as output format for us
            strncpy(output, in, sizeof(output));
-           /* Update the minimum cost found */
+           // Update the minimum cost found
            lowest_cost = cost;
-           /* We cannot find a "better" solution ... */
+           // We cannot find a "better" solution ...
            if (lowest_cost == 0)
            {
              if (log) log(ld, CF_LOGLEVEL_DEBUG,
@@ -2146,8 +2214,8 @@ ppdFilterUniversal(int inputfd,         /* I - File descriptor input stream */
 
   if (strstr(output, "postscript"))
   {
-    /* PostScript output, we need to add libppd's ppdFilterPDFToPS() to
-       the end of the chain */
+    // PostScript output, we need to add libppd's ppdFilterPDFToPS() to
+    // the end of the chain
     universal_parameters.actual_output_type = "application/vnd.cups-pdf";
     extra_filter.function = ppdFilterPDFToPS;
     extra_filter.parameters = NULL;
@@ -2160,19 +2228,19 @@ ppdFilterUniversal(int inputfd,         /* I - File descriptor input stream */
           strstr(output, "pdf"))
 #endif
   {
-    /* Classic PDF printer, with job control via JCL/PJL, needs
-       libppd's ppdFilterPDFToPDF() filter function which adds PPD's JCL/PJL*/
+    // Classic PDF printer, with job control via JCL/PJL, needs
+    // libppd's ppdFilterPDFToPDF() filter function which adds PPD's JCL/PJL
     if (!strncmp(input, "image/", 6) &&
        strcmp(input + 6, "urf") && strcmp(input + 6, "pwg-raster"))
-      /* Input is an image file: call only ppdFilterImageToPDF() as
-        cfFilterImageToPDF() + ppdFilterPDFToPDF() would apply the margins
-        twice */
+      // Input is an image file: call only ppdFilterImageToPDF() as
+      // cfFilterImageToPDF() + ppdFilterPDFToPDF() would apply the margins
+      // twice
       return ppdFilterImageToPDF(inputfd, outputfd, inputseekable, data, NULL);
     else
     {
-      /* Any other input format: Replace the cfFilterPDFToPDF() call by
-        cfFilterUniversal() with a call of ppdFilterPDFToPDF(), so that
-        JCL/PJL from the PPD gets added. */
+      // Any other input format: Replace the cfFilterPDFToPDF() call by
+      // cfFilterUniversal() with a call of ppdFilterPDFToPDF(), so that
+      // JCL/PJL from the PPD gets added.
       universal_parameters.actual_output_type = "application/pdf";
       extra_filter.function = ppdFilterPDFToPDF;
       extra_filter.parameters = NULL;
@@ -2180,13 +2248,13 @@ ppdFilterUniversal(int inputfd,         /* I - File descriptor input stream */
     }
   }
   else
-    /* No extra filter needed, cfFilterUniversal() does the job
-       correctly with only the filter functions of libcupsfilters */
+    // No extra filter needed, cfFilterUniversal() does the job
+    // correctly with only the filter functions of libcupsfilters
     extra_filter.function = NULL;
 
   if (extra_filter.function)
   {
-    /* Chain cfFilterUniversal() with the extra filter function */
+    // Chain cfFilterUniversal() with the extra filter function
     universal_filter.function = cfFilterUniversal;
     universal_filter.parameters = &universal_parameters;
     universal_filter.name = "universal";
@@ -2205,18 +2273,18 @@ ppdFilterUniversal(int inputfd,         /* I - File descriptor input stream */
 }
 
 
-/*
- * 'ppdFilterSetCommonOptions()' - Set common filter options for media size,
- *                                 etc. based on PPD file
- */
+//
+// 'ppdFilterSetCommonOptions()' - Set common filter options for media size,
+//                                 etc. based on PPD file
+//
 
 void
 ppdFilterSetCommonOptions(
-    ppd_file_t    *ppd,                        /* I - PPD file */
-    int           num_options,          /* I - Number of options */
-    cups_option_t *options,             /* I - Options */
-    int           change_size,         /* I - Change page size? */
-    int           *Orientation,         /* I/O - Basic page parameters */
+    ppd_file_t    *ppd,                        // I - PPD file
+    int           num_options,          // I - Number of options
+    cups_option_t *options,             // I - Options
+    int           change_size,         // I - Change page size?
+    int           *Orientation,         // I/O - Basic page parameters
     int           *Duplex,
     int           *LanguageLevel,
     int           *ColorDevice,
@@ -2226,25 +2294,25 @@ ppdFilterSetCommonOptions(
     float         *PageBottom,
     float         *PageWidth,
     float         *PageLength,
-    cf_logfunc_t log,                   /* I - Logging function,
-                                              NULL for no logging */
-    void *ld)                           /* I - User data for logging function,
-                                              can be NULL */
+    cf_logfunc_t log,                   // I - Logging function,
+                                       //     NULL for no logging
+    void *ld)                           // I - User data for logging function,
+                                       //     can be NULL
 {
-  ppd_size_t   *pagesize;              /* Current page size */
-  const char   *val;                   /* Option value */
+  ppd_size_t   *pagesize;              // Current page size
+  const char   *val;                   // Option value
 
 
-  *Orientation = 0;            /* 0 = portrait, 1 = landscape, etc. */
-  *Duplex = 0;                 /* Duplexed? */
-  *LanguageLevel = 1;          /* Language level of printer */
-  *ColorDevice = 1;            /* Color printer? */
-  *PageLeft = 18.0f;           /* Left margin */
-  *PageRight = 594.0f;         /* Right margin */
-  *PageBottom = 36.0f;         /* Bottom margin */
-  *PageTop = 756.0f;           /* Top margin */
-  *PageWidth = 612.0f;         /* Total page width */
-  *PageLength = 792.0f;                /* Total page length */
+  *Orientation = 0;            // 0 = portrait, 1 = landscape, etc.
+  *Duplex = 0;                 // Duplexed?
+  *LanguageLevel = 1;          // Language level of printer
+  *ColorDevice = 1;            // Color printer?
+  *PageLeft = 18.0f;           // Left margin
+  *PageRight = 594.0f;         // Right margin
+  *PageBottom = 36.0f;         // Bottom margin
+  *PageTop = 756.0f;           // Top margin
+  *PageWidth = 612.0f;         // Total page width
+  *PageLength = 792.0f;                // Total page length
 
   if ((pagesize = ppdPageSize(ppd, NULL)) != NULL)
   {
@@ -2401,14 +2469,14 @@ ppdFilterSetCommonOptions(
   else if ((val = cupsGetOption("orientation-requested",
                                num_options, options)) != NULL)
   {
-   /*
-    * Map IPP orientation values to 0 to 3:
-    *
-    *   3 = 0 degrees   = 0
-    *   4 = 90 degrees  = 1
-    *   5 = -90 degrees = 3
-    *   6 = 180 degrees = 2
-    */
+    //
+    // Map IPP orientation values to 0 to 3:
+    //
+    //   3 = 0 degrees   = 0
+    //   4 = 90 degrees  = 1
+    //   5 = -90 degrees = 3
+    //   6 = 180 degrees = 2
+    //
 
     *Orientation = atoi(val) - 3;
     if (*Orientation >= 2)
@@ -2513,25 +2581,25 @@ ppdFilterSetCommonOptions(
 }
 
 
-/*
- * 'ppdFilterUpdatePageVars()' - Update the page variables for the orientation.
- */
+//
+// 'ppdFilterUpdatePageVars()' - Update the page variables for the orientation.
+//
 
 void
 ppdFilterUpdatePageVars(int Orientation,
-                    float *PageLeft, float *PageRight,
-                    float *PageTop, float *PageBottom,
-                    float *PageWidth, float *PageLength)
+                       float *PageLeft, float *PageRight,
+                       float *PageTop, float *PageBottom,
+                       float *PageWidth, float *PageLength)
 {
-  float                temp;                   /* Swapping variable */
+  float                temp;                   // Swapping variable
 
 
   switch (Orientation & 3)
   {
-    case 0 : /* Portait */
+    case 0 : // Portait
         break;
 
-    case 1 : /* Landscape */
+    case 1 : // Landscape
        temp        = *PageLeft;
        *PageLeft   = *PageBottom;
        *PageBottom = temp;
@@ -2545,7 +2613,7 @@ ppdFilterUpdatePageVars(int Orientation,
        *PageLength = temp;
        break;
 
-    case 2 : /* Reverse Portrait */
+    case 2 : // Reverse Portrait
        temp        = *PageWidth - *PageLeft;
        *PageLeft   = *PageWidth - *PageRight;
        *PageRight  = temp;
@@ -2555,7 +2623,7 @@ ppdFilterUpdatePageVars(int Orientation,
        *PageTop    = temp;
         break;
 
-    case 3 : /* Reverse Landscape */
+    case 3 : // Reverse Landscape
        temp        = *PageWidth - *PageLeft;
        *PageLeft   = *PageWidth - *PageRight;
        *PageRight  = temp;
index 156b27a9207e97751b1771457a63490fc2856444..9b271dc2bc36fd2ff83bb5f173a4ed393b60a031 100644 (file)
@@ -1,23 +1,23 @@
-/*
- *   Filter functions header file for libppd.
- *
- *   Copyright © 2020-2022 by Till Kamppeter.
- *
- *   Licensed under Apache License v2.0.  See the file "LICENSE" for more
- *   information.
- */
+//
+//   Filter functions API definitions for libppd.
+//
+//   Copyright © 2020-2022 by Till Kamppeter.
+//
+//   Licensed under Apache License v2.0.  See the file "LICENSE" for more
+//   information.
+//
 
 #ifndef _PPD_PPD_FILTER_H_
 #  define _PPD_PPD_FILTER_H_
 
 #  ifdef __cplusplus
 extern "C" {
-#  endif /* __cplusplus */
+#  endif // __cplusplus
 
 
-/*
- * Include necessary headers...
- */
+//
+// Include necessary headers...
+//
 
 #  include <cupsfilters/log.h>
 #  include <cupsfilters/filter.h>
@@ -32,7 +32,7 @@ extern "C" {
 #  else
 #    include <unistd.h>
 #    include <fcntl.h>
-#  endif /* WIN32 || __EMX__ */
+#  endif // WIN32 || __EMX__
 
 #  include <cups/cups.h>
 #  include <cups/raster.h>
@@ -41,39 +41,39 @@ extern "C" {
 #  define PPD_FILTER_DATA_EXT "libppd"
 
 
-/*
- * Types and structures...
- */
+//
+// Types and structures...
+//
 
 typedef struct ppd_filter_data_ext_s {
-  char *ppdfile;             /* PPD file name */
-  ppd_file_t *ppd;           /* PPD file data */
+  char *ppdfile;             // PPD file name
+  ppd_file_t *ppd;           // PPD file data
 } ppd_filter_data_ext_t;
 
-typedef struct ppd_filter_external_cups_s { /* Parameters for the
-                                              ppdFilterExternalCUPS() filter
-                                              function */
-  const char *filter;        /* Path/Name of the CUPS filter to be called by
-                               this filter function, required */
-  int is_backend;            /* 0 if we call a filter, 1 if we call a CUPS
-                               backend, 2 if we call a CUPS backend in
-                               device discovery mode */
-  const char *device_uri;    /* Device URI when calling a CUPS Backend for
-                               processing a job, optional, alternatively
-                               DEVICE_URI environment variable can get set
-                               in envp */
-  int num_options;           /* Extra options for the 5th command line */
-  cups_option_t *options;    /* argument, options of filter_data have
-                                priority, 0/NULL if none */
-  char **envp;               /* Additional environment variables, the already
-                                defined ones stay valid but can be overwritten
-                                by these ones, NULL if none */
+typedef struct ppd_filter_external_cups_s { // Parameters for the
+                                           // ppdFilterExternalCUPS() filter
+                                           // function
+  const char *filter;        // Path/Name of the CUPS filter to be called by
+                            // this filter function, required
+  int is_backend;            // 0 if we call a filter, 1 if we call a CUPS
+                            // backend, 2 if we call a CUPS backend in
+                            // device discovery mode
+  const char *device_uri;    // Device URI when calling a CUPS Backend for
+                            // processing a job, optional, alternatively
+                            // DEVICE_URI environment variable can get set
+                            // in envp
+  int num_options;           // Extra options for the 5th command line
+  cups_option_t *options;    // argument, options of filter_data have
+                             // priority, 0/NULL if none
+  char **envp;               // Additional environment variables, the already
+                             // defined ones stay valid but can be overwritten
+                             // by these ones, NULL if none
 } ppd_filter_external_cups_t;
 
 
-/*
- * Prototypes...
- */
+//
+// Prototypes...
+//
 
 extern int ppdFilterCUPSWrapper(int argc,
                                char *argv[],
@@ -100,12 +100,12 @@ extern int ppdFilterExternalCUPS(int inputfd,
                                 cf_filter_data_t *data,
                                 void *parameters);
 
-/* Parameters: ppd_filter_external_cups_t*
-   Path/Name of the CUPS filter to be called by this filter function,
-   specification whether we call a filter or a backend, an in case of
-   backend, whether in job processing or discovery mode, extra options
-   for the 5th command line argument, and extra environment
-   variables */
+// Parameters: ppd_filter_external_cups_t*
+// Path/Name of the CUPS filter to be called by this filter function,
+// specification whether we call a filter or a backend, an in case of
+// backend, whether in job processing or discovery mode, extra options
+// for the 5th command line argument, and extra environment
+// variables
 
 
 extern int ppdFilterEmitJCL(int inputfd,
@@ -136,17 +136,16 @@ extern int ppdFilterPDFToPDF(int inputfd,
                             cf_filter_data_t *data,
                             void *parameters);
 
-/* (Optional) Specification of output format via
-   data->final_content_type is used for determining whether this
-   filter function does page logging for CUPS (output of "PAGE: XX YY"
-   log messages) or not and also to determine whether the printer or
-   driver generates copies or whether we have to send the pages
-   repeatedly.
-
-   Alternatively, the options "pdf-filter-page-logging",
-   "hardware-copies", and "hardware-collate" can be used to manually
-   do these selections. */
-
+// (Optional) Specification of output format via
+// data->final_content_type is used for determining whether this
+// filter function does page logging for CUPS (output of "PAGE: XX YY"
+// log messages) or not and also to determine whether the printer or
+// driver generates copies or whether we have to send the pages
+// repeatedly.
+//
+// Alternatively, the options "pdf-filter-page-logging",
+// "hardware-copies", and "hardware-collate" can be used to manually
+// do these selections.
 
 
 extern int ppdFilterPDFToPS(int inputfd,
@@ -176,17 +175,17 @@ extern int ppdFilterUniversal(int inputfd,
                              cf_filter_data_t *data,
                              void *parameters);
 
-/* Requires specification of input format via data->content_type and 
-   job's final output format via data->final_content_type
-
-   Parameters: cf_filter_universal_parameter_t
-
-   Contains: actual_output_type: Format which the filter should
-             actually produce if different from job's final output
-             format, or NULL to auto-determine the needed output
-            format from the PPDs "cupsFilter2: ..." lines. Default
-            is the job's final output format.
-            texttopdf_params: parameters for texttopdf */
+// Requires specification of input format via data->content_type and 
+// job's final output format via data->final_content_type
+//
+//   Parameters: cf_filter_universal_parameter_t
+//
+//   Contains: actual_output_type: Format which the filter should
+//             actually produce if different from job's final output
+//             format, or NULL to auto-determine the needed output
+//            format from the PPDs "cupsFilter2: ..." lines. Default
+//            is the job's final output format.
+//            texttopdf_params: parameters for texttopdf
 
 
 extern void ppdFilterSetCommonOptions(ppd_file_t *ppd,
@@ -215,6 +214,6 @@ extern void ppdFilterUpdatePageVars(int Orientation,
 
 #  ifdef __cplusplus
 }
-#  endif /* __cplusplus */
+#  endif // __cplusplus
 
-#endif /* !_PPD_PPD_FILTER_H_ */
+#endif // !_PPD_PPD_FILTER_H_
index 3ea9694dc4adfd1b0b7b65913fc8298acda22098..b175c6496752b618432950e29a3428fdffcf7b51 100644 (file)
@@ -1,21 +1,19 @@
-/*
- *   PWG Raster/Apple Raster/PCLm/PDF/IPP legacy PPD generator
- *
- *   Copyright 2016-2019 by Till Kamppeter.
- *   Copyright 2017-2019 by Sahil Arora.
- *   Copyright 2018-2019 by Deepak Patankar.
- *
- *   The PPD generator is based on the PPD generator for the CUPS
- *   "lpadmin -m everywhere" functionality in the cups/ppd-cache.c
- *   file. The copyright of this file is:
- *
- *   Copyright 2010-2016 by Apple Inc.
- *
- *   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 "COPYING"
- *   which should have been included with this file. 
- */
+//
+//   PWG Raster/Apple Raster/PCLm/PDF/IPP legacy PPD generator for libppd.
+//
+//   Copyright 2016-2019 by Till Kamppeter.
+//   Copyright 2017-2019 by Sahil Arora.
+//   Copyright 2018-2019 by Deepak Patankar.
+//
+//   The PPD generator is based on the PPD generator for the CUPS
+//   "lpadmin -m everywhere" functionality in the cups/ppd-cache.c
+//   file. The copyright of this file is:
+//
+//   Copyright 2010-2016 by Apple Inc.
+//
+//   Licensed under Apache License v2.0.  See the file "LICENSE" for more
+//   information.
+//
 
 #include <config.h>
 #include <limits.h>
@@ -27,9 +25,9 @@
 #include <cupsfilters/catalog.h>
 
 
-/*
- * Include necessary headers.
- */
+//
+// Include necessary headers.
+//
 
 #include <errno.h>
 #include <string.h>
@@ -37,9 +35,9 @@
 #include <cups/pwg.h>
 
 
-/*
- * Macros to work around typos in older libcups version
- */
+//
+// Macros to work around typos in older libcups version
+//
 
 #if (CUPS_VERSION_MAJOR < 2) || ((CUPS_VERSION_MAJOR == 2) && ((CUPS_VERSION_MINOR < 3) || ((CUPS_VERSION_MINOR == 3) && (CUPS_VERSION_PATCH < 1))))
 #define IPP_FINISHINGS_CUPS_FOLD_ACCORDION IPP_FINISHINGS_CUPS_FOLD_ACCORDIAN
 #endif
 
 
-/*
- * The code below is borrowed from the CUPS 2.2.x upstream repository
- * (via patches attached to https://www.cups.org/str.php?L4258). This
- * allows for automatic PPD generation already with CUPS versions older
- * than CUPS 2.2.x. We have also an additional test and development
- * platform for this code. Taken from cups/ppd-cache.c,
- * cups/string-private.h, cups/string.c.
- * 
- * The advantage of PPD generation instead of working with System V
- * interface scripts is that the print dialogs of the clients do not
- * need to ask the printer for its options via IPP. So we have access
- * to the options with the current PPD-based dialogs and can even share
- * the automatically created print queue to other CUPS-based machines
- * without problems.
- */
+//
+// The code below is borrowed from the CUPS 2.2.x upstream repository
+// (via patches attached to https://www.cups.org/str.php?L4258). This
+// allows for automatic PPD generation already with CUPS versions older
+// than CUPS 2.2.x. We have also an additional test and development
+// platform for this code. Taken from cups/ppd-cache.c,
+// cups/string-private.h, cups/string.c.
+// 
+// The advantage of PPD generation instead of working with System V
+// interface scripts is that the print dialogs of the clients do not
+// need to ask the printer for its options via IPP. So we have access
+// to the options with the current PPD-based dialogs and can even share
+// the automatically created print queues to other CUPS-based machines
+// without problems.
+//
 
 
 char ppdgenerator_msg[1024];
 
-/*
- * Human-readable strings in the PPDs generated by the PPD generator for
- * using driverless IPP printers with CUPS
- *
- * To allow for translated/localized PPDs we use the standard set
- * of human-readable strings from the PWG:
- *
- * https://ftp.pwg.org/pub/pwg/ipp/examples/ipp.pot
- * https://ftp.pwg.org/pub/pwg/ipp/examples/ipp.strings
- *
- * Creating those with translated human-readable strings would allow us to
- * easily produce PPDs in other languges.
- *
- * Translations are supposed to go here (but none are available yet):
- *
- * https://github.com/istopwg/ippregistry/tree/master/localizations
- *
- * These standard strings are also part of CUPS' translation files:
- *
- * https://github.com/OpenPrinting/cups/tree/master/locale
- *
- * Here translations take actually place as part of the translations
- * of CUPS itself.
- *
- * We take the files from the CUPS installed into the system (as the PPD
- * generator actually does not make sense without CUPS) but currently
- * only use the English version. It is not complicated to check the user
- * language in the printer's IPP response via the
- * attributes-natural-language attribute and then request an appropriate
- * language version of the files if available. The printer-specific
- * strings are downloaded from the printer following the URI in the
- * printer-strings-uri attribute and are in the selected language.
- *
- * It is not clear whether PPD translation will get fixed in the PPD
- * generator as the need of PPDs in CUPS will go away with version
- * 3.x.
- *
- * See also:
- *
- * https://lists.linuxfoundation.org/pipermail/printing-architecture/2021/003992.html
- * https://lists.linuxfoundation.org/pipermail/printing-architecture/2021/003995.html
- */
-
-/*
- * 'ppdCreatePPDFromIPP()' - Create a PPD file describing the capabilities
- *                           of an IPP printer, using info from DNS-SD record
- *                           as fallback (for poor IPP responses, especially
- *                           IPP 1.x legacy)
- */
-
-char *                                             /* O - PPD filename or NULL 
-                                                          on error */
-ppdCreatePPDFromIPP(char         *buffer,          /* I - Filename buffer */
-                   size_t       bufsize,          /* I - Size of filename
-                                                         buffer */
-                   ipp_t        *response,        /* I - Get-Printer-Attributes
-                                                         response */
-                   const char   *make_model,      /* I - Make and model from
-                                                         DNS-SD */
-                   const char   *pdl,             /* I - List of PDLs from
-                                                         DNS-SD */
-                   int          color,            /* I - Color printer? (from
-                                                         DNS-SD) */
-                   int          duplex,           /* I - Duplex printer? (from
-                                                         DNS-SD) */
-                   char         *status_msg,      /* I - Status message buffer,
-                                                         NULL to ignore
-                                                         message */
-                   size_t       status_msg_size)  /* I - Size of status message
-                                                         buffer */
+
+//
+// Human-readable strings in the PPDs generated by the PPD generator for
+// using driverless IPP printers with CUPS
+//
+// To allow for translated/localized PPDs we use the standard set
+// of human-readable strings from the PWG:
+//
+// https://ftp.pwg.org/pub/pwg/ipp/examples/ipp.pot
+// https://ftp.pwg.org/pub/pwg/ipp/examples/ipp.strings
+//
+// Creating those with translated human-readable strings would allow us to
+// easily produce PPDs in other languges.
+//
+// Translations are supposed to go here (but none are available yet):
+//
+// https://github.com/istopwg/ippregistry/tree/master/localizations
+//
+// These standard strings are also part of CUPS' translation files:
+//
+// https://github.com/OpenPrinting/cups/tree/master/locale
+//
+// Here translations take actually place as part of the translations
+// of CUPS itself.
+//
+// We take the files from the CUPS installed into the system (as the PPD
+// generator actually does not make sense without CUPS) but currently
+// only use the English version. It is not complicated to check the user
+// language in the printer's IPP response via the
+// attributes-natural-language attribute and then request an appropriate
+// language version of the files if available. The printer-specific
+// strings are downloaded from the printer following the URI in the
+// printer-strings-uri attribute and are in the selected language.
+//
+// It is not clear whether PPD translation will get fixed in the PPD
+// generator as the need of PPDs in CUPS will go away with version
+// 3.x.
+//
+// See also:
+//
+// https://lists.linuxfoundation.org/pipermail/printing-architecture/2021/003992.html
+// https://lists.linuxfoundation.org/pipermail/printing-architecture/2021/003995.html
+//
+
+
+//
+// 'ppdCreatePPDFromIPP()' - Create a PPD file describing the capabilities
+//                           of an IPP printer, using info from DNS-SD record
+//                           as fallback (for poor IPP responses, especially
+//                           IPP 1.x legacy)
+//
+
+char *                                             // O - PPD filename or NULL 
+                                                   //     on error
+ppdCreatePPDFromIPP(char         *buffer,          // I - Filename buffer
+                   size_t       bufsize,          // I - Size of filename
+                                                  //     buffer
+                   ipp_t        *response,        // I - Get-Printer-Attributes
+                                                  //     response
+                   const char   *make_model,      // I - Make and model from
+                                                  //     DNS-SD
+                   const char   *pdl,             // I - List of PDLs from
+                                                  //     DNS-SD
+                   int          color,            // I - Color printer? (from
+                                                  //     DNS-SD)
+                   int          duplex,           // I - Duplex printer? (from
+                                                  //     DNS-SD)
+                   char         *status_msg,      // I - Status message buffer,
+                                                  //     NULL to ignore
+                                                  //     message
+                   size_t       status_msg_size)  // I - Size of status message
+                                                  //     buffer
 {
   return ppdCreatePPDFromIPP2(buffer, bufsize, response, make_model, pdl,
                              color, duplex, NULL, NULL, NULL, NULL,
                              status_msg, status_msg_size);
 }
 
-/*
- * 'ppdCreatePPDFromIPP2()' - Create a PPD file describing the
- *                            capabilities of an IPP printer, with
- *                            extra parameters for PPDs from a merged
- *                            IPP record for printer clusters
- */
-
-char *                                              /* O - PPD filename or NULL
-                                                          on error */
-ppdCreatePPDFromIPP2(char         *buffer,          /* I - Filename buffer */
-                    size_t       bufsize,          /* I - Size of filename
-                                                          buffer */
-                    ipp_t        *response,        /* I - Get-Printer-
-                                                          Attributes response*/
-                    const char   *make_model,      /* I - Make and model from
-                                                          DNS-SD */
-                    const char   *pdl,             /* I - List of PDLs from
-                                                          DNS-SD */
-                    int          color,            /* I - Color printer? (from
-                                                          DNS-SD) */
-                    int          duplex,           /* I - Duplex printer? (from
-                                                          DNS-SD) */
-                    cups_array_t *conflicts,       /* I - Array of
-                                                          constraints */
-                    cups_array_t *sizes,           /* I - Media sizes we've
-                                                          added */ 
-                    char*        default_pagesize, /* I - Default page size*/
-                    const char   *default_cluster_color, /* I - cluster def
-                                                          color (if cluster's
-                                                          attributes are
-                                                          returned) */
-                    char         *status_msg,      /* I - Status message
-                                                          buffer, NULL to
-                                                          ignore message */
-                    size_t       status_msg_size)  /* I - Size of status
-                                                          message buffer */
+//
+// 'ppdCreatePPDFromIPP2()' - Create a PPD file describing the
+//                            capabilities of an IPP printer, with
+//                            extra parameters for PPDs from a merged
+//                            IPP record for printer clusters
+//
+
+char *                                              // O - PPD filename or NULL
+                                                   //     on error
+ppdCreatePPDFromIPP2(char         *buffer,          // I - Filename buffer
+                    size_t       bufsize,          // I - Size of filename
+                                                   //     buffer
+                    ipp_t        *response,        // I - Get-Printer-
+                                                   //     Attributes response
+                    const char   *make_model,      // I - Make and model from
+                                                   //     DNS-SD
+                    const char   *pdl,             // I - List of PDLs from
+                                                   //     DNS-SD
+                    int          color,            // I - Color printer? (from
+                                                   //     DNS-SD)
+                    int          duplex,           // I - Duplex printer? (from
+                                                   //     DNS-SD)
+                    cups_array_t *conflicts,       // I - Array of
+                                                   //     constraints
+                    cups_array_t *sizes,           // I - Media sizes we've
+                                                   //     added 
+                    char*        default_pagesize, // I - Default page size
+                    const char   *default_cluster_color, // I - cluster def
+                                                   //     color (if cluster's
+                                                   //     attributes are
+                                                   //     returned)
+                    char         *status_msg,      // I - Status message
+                                                   //     buffer, NULL to
+                                                   //     ignore message
+                    size_t       status_msg_size)  // I - Size of status
+                                                   //     message buffer
 {
-  cups_file_t          *fp;            /* PPD file */
-  cups_array_t         *printer_sizes; /* Media sizes we've added */
-  cups_size_t          *size;          /* Current media size */
-  ipp_attribute_t      *attr,          /* xxx-supported */
+  cups_file_t          *fp;            // PPD file
+  cups_array_t         *printer_sizes; // Media sizes we've added
+  cups_size_t          *size;          // Current media size
+  ipp_attribute_t      *attr,          // xxx-supported
                         *attr2,
-                       *defattr,       /* xxx-default */
-                        *quality,      /* print-quality-supported */
-                       *x_dim, *y_dim; /* Media dimensions */
-  ipp_t                        *media_col,     /* Media collection */
-                       *media_size;    /* Media size collection */
-  char                 make[256],      /* Make and model */
-                       *model,         /* Model name */
+                       *defattr,       // xxx-default
+                        *quality,      // print-quality-supported
+                       *x_dim, *y_dim; // Media dimensions
+  ipp_t                        *media_col,     // Media collection
+                       *media_size;    // Media size collection
+  char                 make[256],      // Make and model
+                       *model,         // Model name
                        ppdname[PPD_MAX_NAME];
-                                       /* PPD keyword */
-  int                  i, j,           /* Looping vars */
-                       count = 0,      /* Number of values */
-                       bottom,         /* Largest bottom margin */
-                       left,           /* Largest left margin */
-                       right,          /* Largest right margin */
-                       top,            /* Largest top margin */
-                       max_length = 0, /* Maximum custom size */
+                                       // PPD keyword
+  int                  i, j,           // Looping vars
+                       count = 0,      // Number of values
+                       bottom,         // Largest bottom margin
+                       left,           // Largest left margin
+                       right,          // Largest right margin
+                       top,            // Largest top margin
+                       max_length = 0, // Maximum custom size
                        max_width = 0,
                        min_length = INT_MAX,
-                                       /* Minimum custom size */
+                                       // Minimum custom size
                        min_width = INT_MAX,
-                       is_apple = 0,   /* Does the printer support Apple
-                                          Raster? */
-                        is_pwg = 0,    /* Does the printer support PWG
-                                          Raster? */
-                        is_pclm = 0,    /* Does the printer support PCLm? */
-                        is_pdf = 0;     /* Does the printer support PDF? */
-  pwg_media_t          *pwg;           /* PWG media size */
-  int                  xres, yres;     /* Resolution values */
-  cups_array_t          *common_res,    /* Common resolutions of all PDLs */
-                        *current_res,   /* Resolutions of current PDL */
-                        *pdl_list;      /* List of PDLs */
-  cf_res_t              *common_def,    /* Common default resolution */
-                        *current_def,   /* Default resolution of current PDL */
-                        *min_res,       /* Minimum common resolution */
-                        *max_res;       /* Maximum common resolution */
+                       is_apple = 0,   // Does the printer support Apple
+                                       // Raster?
+                        is_pwg = 0,    // Does the printer support PWG
+                                       // Raster?
+                        is_pclm = 0,    // Does the printer support PCLm?
+                        is_pdf = 0;     // Does the printer support PDF?
+  pwg_media_t          *pwg;           // PWG media size
+  int                  xres, yres;     // Resolution values
+  cups_array_t          *common_res,    // Common resolutions of all PDLs
+                        *current_res,   // Resolutions of current PDL
+                        *pdl_list;      // List of PDLs
+  cf_res_t              *common_def,    // Common default resolution
+                        *current_def,   // Default resolution of current PDL
+                        *min_res,       // Minimum common resolution
+                        *max_res;       // Maximum common resolution
   struct lconv         *loc = localeconv();
-                                       /* Locale data */
+                                       // Locale data
   cups_array_t          *opt_strings_catalog = NULL;
-                                        /* Standard option UI strings */
+                                        // Standard option UI strings
   cups_array_t          *printer_opt_strings_catalog = NULL;
-                                        /* Printer-specific option UI strings */
+                                        // Printer-specific option UI strings
   char                  *human_readable,
                         *human_readable2;
-  const char           *keyword;       /* Keyword value */
+  const char           *keyword;       // Keyword value
   cups_array_t         *fin_options = NULL;
-                                       /* Finishing options */
+                                       // Finishing options
   char                 buf[256];
   char                 *defaultoutbin = NULL;
   const char           *outbin;
@@ -242,38 +242,41 @@ ppdCreatePPDFromIPP2(char         *buffer,          /* I - Filename buffer */
   int                  manual_copies = -1,
                        is_fax = 0;
 
- /*
-  * Range check input...
-  */
+  //
+  // Range check input...
+  //
 
   if (buffer)
     *buffer = '\0';
 
-  if (!buffer || bufsize < 1) {
+  if (!buffer || bufsize < 1)
+  {
     if (status_msg && status_msg_size)
       snprintf(status_msg, status_msg_size, "%s", strerror(EINVAL));
     return (NULL);
   }
 
-  if (!response) {
+  if (!response)
+  {
     if (status_msg && status_msg_size)
       snprintf(status_msg, status_msg_size, "No IPP attributes.");
     return (NULL);
   }
 
- /*
-  * Open a temporary file for the PPD...
-  */
+  //
+  // Open a temporary file for the PPD...
+  //
 
-  if ((fp = cupsTempFile2(buffer, (int)bufsize)) == NULL) {
+  if ((fp = cupsTempFile2(buffer, (int)bufsize)) == NULL)
+  {
     if (status_msg && status_msg_size)
       snprintf(status_msg, status_msg_size, "%s", strerror(errno));
     return (NULL);
   }
 
- /*
-  * Standard stuff for PPD file...
-  */
+  //
+  // Standard stuff for PPD file...
+  //
 
   cupsFilePuts(fp, "*PPD-Adobe: \"4.3\"\n");
   cupsFilePuts(fp, "*FormatVersion: \"4.3\"\n");
@@ -308,7 +311,8 @@ ppdCreatePPDFromIPP2(char         *buffer,          /* I - Filename buffer */
     strlcpy(make, "Unknown Printer", sizeof(make));
 
   if (!strncasecmp(make, "Hewlett Packard ", 16) ||
-      !strncasecmp(make, "Hewlett-Packard ", 16)) {
+      !strncasecmp(make, "Hewlett-Packard ", 16))
+  {
     model = make + 16;
     strlcpy(make, "HP", sizeof(make));
   }
@@ -324,21 +328,24 @@ ppdCreatePPDFromIPP2(char         *buffer,          /* I - Filename buffer */
                 make, model, (is_fax ? "Fax, " : ""), VERSION);
   cupsFilePrintf(fp, "*ShortNickName: \"%s %s\"\n", make, model);
 
-  /* Which is the default output bin? */
+  // Which is the default output bin?
   if ((attr = ippFindAttribute(response, "output-bin-default", IPP_TAG_ZERO))
       != NULL)
     defaultoutbin = strdup(ippGetString(attr, 0, NULL));
-  /* Find out on which position of the list of output bins the default one is,
-     if there is no default bin, take the first of this list */
+  // Find out on which position of the list of output bins the default one is,
+  // if there is no default bin, take the first of this list
   i = 0;
   if ((attr = ippFindAttribute(response, "output-bin-supported",
-                              IPP_TAG_ZERO)) != NULL) {
+                              IPP_TAG_ZERO)) != NULL)
+  {
     count = ippGetCount(attr);
-    for (i = 0; i < count; i ++) {
+    for (i = 0; i < count; i ++)
+    {
       outbin = ippGetString(attr, i, NULL);
       if (outbin == NULL)
        continue;
-      if (defaultoutbin == NULL) {
+      if (defaultoutbin == NULL)
+      {
        defaultoutbin = strdup(outbin);
        break;
       } else if (strcasecmp(outbin, defaultoutbin) == 0)
@@ -347,13 +354,15 @@ ppdCreatePPDFromIPP2(char         *buffer,          /* I - Filename buffer */
   }
   if ((attr = ippFindAttribute(response, "printer-output-tray",
                               IPP_TAG_STRING)) != NULL &&
-      i < ippGetCount(attr)) {
+      i < ippGetCount(attr))
+  {
     outbin_properties_octet = ippGetOctetString(attr, i, &octet_str_len);
     memset(outbin_properties, 0, sizeof(outbin_properties));
     memcpy(outbin_properties, outbin_properties_octet,
           ((size_t)octet_str_len < sizeof(outbin_properties) - 1 ?
            (size_t)octet_str_len : sizeof(outbin_properties) - 1));
-    if (strcasestr(outbin_properties, "pagedelivery=faceUp")) {
+    if (strcasestr(outbin_properties, "pagedelivery=faceUp"))
+    {
       outputorderinfofound = 1;
       faceupdown = -1;
     }
@@ -370,7 +379,7 @@ ppdCreatePPDFromIPP2(char         *buffer,          /* I - Filename buffer */
   else
     cupsFilePuts(fp, "*DefaultOutputOrder: Normal\n");
 
-  /* Do we have a color printer? */
+  // Do we have a color printer?
   if (((attr = ippFindAttribute(response,
                               "color-supported", IPP_TAG_BOOLEAN)) != NULL &&
        ippGetBoolean(attr, 0)) ||
@@ -393,11 +402,12 @@ ppdCreatePPDFromIPP2(char         *buffer,          /* I - Filename buffer */
     cupsFilePrintf(fp, "*cupsChargeInfoURI: \"%s\"\n", ippGetString(attr, 0,
                                                                    NULL));
 
-  /* Message catalogs for UI strings */
+  // Message catalogs for UI strings
   opt_strings_catalog = cfCatalogOptionArrayNew();
   cfCatalogLoad(NULL, opt_strings_catalog);
   if ((attr = ippFindAttribute(response, "printer-strings-uri",
-                              IPP_TAG_URI)) != NULL) {
+                              IPP_TAG_URI)) != NULL)
+  {
     printer_opt_strings_catalog = cfCatalogOptionArrayNew();
     cfCatalogLoad(ippGetString(attr, 0, NULL),
                  printer_opt_strings_catalog);
@@ -406,9 +416,9 @@ ppdCreatePPDFromIPP2(char         *buffer,          /* I - Filename buffer */
                                                                   NULL));
   }
 
- /*
-  * Accounting...
-  */
+  //
+  // Accounting...
+  //
 
   if (ippGetBoolean(ippFindAttribute(response, "job-account-id-supported",
                                     IPP_TAG_BOOLEAN), 0))
@@ -419,10 +429,13 @@ ppdCreatePPDFromIPP2(char         *buffer,          /* I - Filename buffer */
                                     IPP_TAG_BOOLEAN), 0))
     cupsFilePuts(fp, "*cupsJobAccountingUserId: True\n");
 
-  if ((attr = ippFindAttribute(response, "printer-privacy-policy-uri", IPP_TAG_URI)) != NULL)
-    cupsFilePrintf(fp, "*cupsPrivacyURI: \"%s\"\n", ippGetString(attr, 0, NULL));
+  if ((attr = ippFindAttribute(response, "printer-privacy-policy-uri",
+                              IPP_TAG_URI)) != NULL)
+    cupsFilePrintf(fp, "*cupsPrivacyURI: \"%s\"\n",
+                  ippGetString(attr, 0, NULL));
 
-  if ((attr = ippFindAttribute(response, "printer-mandatory-job-attributes", IPP_TAG_KEYWORD)) != NULL)
+  if ((attr = ippFindAttribute(response, "printer-mandatory-job-attributes",
+                              IPP_TAG_KEYWORD)) != NULL)
   {
     char       prefix = '\"';          // Prefix for string
 
@@ -431,7 +444,9 @@ ppdCreatePPDFromIPP2(char         *buffer,          /* I - Filename buffer */
     {
       keyword = ippGetString(attr, i, NULL);
 
-      if (strcmp(keyword, "attributes-charset") && strcmp(keyword, "attributes-natural-language") && strcmp(keyword, "printer-uri"))
+      if (strcmp(keyword, "attributes-charset") &&
+         strcmp(keyword, "attributes-natural-language") &&
+         strcmp(keyword, "printer-uri"))
       {
         cupsFilePrintf(fp, "%c%s", prefix, keyword);
         prefix = ',';
@@ -440,7 +455,8 @@ ppdCreatePPDFromIPP2(char         *buffer,          /* I - Filename buffer */
     cupsFilePuts(fp, "\"\n");
   }
 
-  if ((attr = ippFindAttribute(response, "printer-requested-job-attributes", IPP_TAG_KEYWORD)) != NULL)
+  if ((attr = ippFindAttribute(response, "printer-requested-job-attributes",
+                              IPP_TAG_KEYWORD)) != NULL)
   {
     char       prefix = '\"';          // Prefix for string
 
@@ -449,7 +465,9 @@ ppdCreatePPDFromIPP2(char         *buffer,          /* I - Filename buffer */
     {
       keyword = ippGetString(attr, i, NULL);
 
-      if (strcmp(keyword, "attributes-charset") && strcmp(keyword, "attributes-natural-language") && strcmp(keyword, "printer-uri"))
+      if (strcmp(keyword, "attributes-charset") &&
+         strcmp(keyword, "attributes-natural-language") &&
+         strcmp(keyword, "printer-uri"))
       {
         cupsFilePrintf(fp, "%c%s", prefix, keyword);
         prefix = ',';
@@ -458,20 +476,21 @@ ppdCreatePPDFromIPP2(char         *buffer,          /* I - Filename buffer */
     cupsFilePuts(fp, "\"\n");
   }
 
- /*
-  * Password/PIN printing...
-  */
+  //
+  // Password/PIN printing...
+  //
 
   if ((attr = ippFindAttribute(response, "job-password-supported",
-                              IPP_TAG_INTEGER)) != NULL) {
-    char       pattern[33];            /* Password pattern */
+                              IPP_TAG_INTEGER)) != NULL)
+  {
+    char       pattern[33];            // Password pattern
     int                maxlen = ippGetInteger(attr, 0);
-                                       /* Maximum length */
+                                       // Maximum length
     const char *repertoire =
       ippGetString(ippFindAttribute(response,
                                    "job-password-repertoire-configured",
                                    IPP_TAG_KEYWORD), 0, NULL);
-                                       /* Type of password */
+                                       // Type of password
 
     if (maxlen > (int)(sizeof(pattern) - 1))
       maxlen = (int)sizeof(pattern) - 1;
@@ -496,11 +515,9 @@ ppdCreatePPDFromIPP2(char         *buffer,          /* I - Filename buffer */
     cupsFilePrintf(fp, "*cupsJobPassword: \"%s\"\n", pattern);
   }
 
-  
-
- /*
-  * PDLs and common resolutions ...
-  */
+  //
+  // PDLs and common resolutions ...
+  //
 
   common_res = NULL;
   current_res = NULL;
@@ -508,8 +525,8 @@ ppdCreatePPDFromIPP2(char         *buffer,          /* I - Filename buffer */
   current_def = NULL;
   min_res = NULL;
   max_res = NULL;
-  /* Put all available PDls into a simple case-insensitevely searchable
-     sorted string list */
+  // Put all available PDls into a simple case-insensitevely searchable
+  // sorted string list
   if ((pdl_list = cupsArrayNew3((cups_array_func_t)strcasecmp, NULL, NULL, 0,
                                (cups_acopy_func_t)strdup,
                                (cups_afree_func_t)free)) == NULL)
@@ -518,25 +535,27 @@ ppdCreatePPDFromIPP2(char         *buffer,          /* I - Filename buffer */
 
   if (((attr = ippFindAttribute(response, "document-format-supported",
                                IPP_TAG_MIMETYPE)) != NULL) ||
-      (pdl && pdl[0] != '\0')) {
+      (pdl && pdl[0] != '\0'))
+  {
     const char *format = pdl;
     i = 0;
     count = ippGetCount(attr);
-    while ((attr && i < count) || /* Go through formats in attribute */
-          (!attr && pdl && pdl[0] != '\0' && format[0] != '\0')) {
-      /* Go through formats in pdl string (from DNS-SD record) */
+    while ((attr && i < count) || // Go through formats in attribute
+          (!attr && pdl && pdl[0] != '\0' && format[0] != '\0'))
+    {
+      // Go through formats in pdl string (from DNS-SD record)
 
-      /* Pick next format from attribute */
+      // Pick next format from attribute
       if (attr) format = ippGetString(attr, i, NULL);
-      /* Add format to list of supported PDLs, skip duplicates */
+      // Add format to list of supported PDLs, skip duplicates
       if (!cupsArrayFind(pdl_list, (void *)format))
        cupsArrayAdd(pdl_list, (void *)format);
       if (attr)
-       /* Next format in attribute */
+       // Next format in attribute
        i ++;
       else {
-       /* Find the next format in the string pdl, if there is none left,
-          go to the terminating zero */
+       // Find the next format in the string pdl, if there is none left,
+       // go to the terminating zero
        while (!isspace(*format) && *format != ',' && *format != '\0')
          format ++;
        while ((isspace(*format) || *format == ',') && *format != '\0')
@@ -545,9 +564,9 @@ ppdCreatePPDFromIPP2(char         *buffer,          /* I - Filename buffer */
     }
   }
 
-  /*
-   * Fax 
-   */
+  //
+  // Fax 
+  //
 
   if (is_fax)
   {
@@ -555,27 +574,30 @@ ppdCreatePPDFromIPP2(char         *buffer,          /* I - Filename buffer */
     cupsFilePuts(fp, "*cupsIPPFaxOut: True\n");
   }
 
-  /* Check for each CUPS/cups-filters-supported PDL, starting with the
-     most desirable going to the least desirable. If a PDL requires a
-     certain set of resolutions (the raster-based PDLs), find the
-     resolutions and find out which are the common resolutions of all
-     supported PDLs. Choose the default resolution from the most
-     desirable of all resolution-requiring PDLs if it is common in all
-     of them. Skip a resolution-requiring PDL if its resolution list
-     attribute is missing or contains only broken entries. Use the
-     general resolution list and default resolution of the printer
-     only if it does not support any resolution-requiring PDL. Use 300
-     dpi if there is no resolution info at all in the attributes.
-     In case of PDF as PDL check whether also the
-     "application/vnd.cups-pdf" MIME type is accepted. In this case
-     our printer is a remote CUPS queue which already runs the
-     pdftopdf filter on the server, so let the PPD take
-     "application/pdf" as input format so that pdftopdf does not also
-     get executed on the client, applying option settings twice. See
-     https://github.com/apple/cups/issues/5361 */
+  //
+  // Check for each CUPS/cups-filters-supported PDL, starting with the
+  // most desirable going to the least desirable. If a PDL requires a
+  // certain set of resolutions (the raster-based PDLs), find the
+  // resolutions and find out which are the common resolutions of all
+  // supported PDLs. Choose the default resolution from the most
+  // desirable of all resolution-requiring PDLs if it is common in all
+  // of them. Skip a resolution-requiring PDL if its resolution list
+  // attribute is missing or contains only broken entries. Use the
+  // general resolution list and default resolution of the printer
+  // only if it does not support any resolution-requiring PDL. Use 300
+  // dpi if there is no resolution info at all in the attributes.
+  // In case of PDF as PDL check whether also the
+  // "application/vnd.cups-pdf" MIME type is accepted. In this case
+  // our printer is a remote CUPS queue which already runs the
+  // pdftopdf filter on the server, so let the PPD take
+  // "application/pdf" as input format so that pdftopdf does not also
+  // get executed on the client, applying option settings twice. See
+  // https://github.com/apple/cups/issues/5361
+  //
+
   if (cupsArrayFind(pdl_list, "application/vnd.cups-pdf"))
   {
-    /* Remote CUPS queue */
+    // Remote CUPS queue
     cupsFilePuts(fp, "*cupsFilter2: \"application/pdf application/pdf 0 -\"\n");
     manual_copies = 0;
     formatfound = 1;
@@ -585,10 +607,12 @@ ppdCreatePPDFromIPP2(char         *buffer,          /* I - Filename buffer */
   else if (cupsArrayFind(pdl_list, "image/urf"))
   {
     if ((attr = ippFindAttribute(response, "urf-supported",
-                                IPP_TAG_KEYWORD)) != NULL) {
-      int lowdpi = 0, hidpi = 0; /* Lower and higher resolution */
-      for (i = 0, count = ippGetCount(attr); i < count; i ++) {
-       const char *rs = ippGetString(attr, i, NULL); /* RS value */
+                                IPP_TAG_KEYWORD)) != NULL)
+    {
+      int lowdpi = 0, hidpi = 0; // Lower and higher resolution
+      for (i = 0, count = ippGetCount(attr); i < count; i ++)
+      {
+       const char *rs = ippGetString(attr, i, NULL); // RS value
        if (strncasecmp(rs, "RS", 2))
          continue;
        lowdpi = atoi(rs + 2);
@@ -598,11 +622,15 @@ ppdCreatePPDFromIPP2(char         *buffer,          /* I - Filename buffer */
          hidpi = lowdpi;
        break;
       }
-      if (lowdpi == 0) {
-       /* Invalid "urf-supported" value... */
+      if (lowdpi == 0)
+      {
+       // Invalid "urf-supported" value...
        goto bad_ppd;
-      } else {
-       if ((current_res = cfNewResolutionArray()) != NULL) {
+      }
+      else
+      {
+       if ((current_res = cfNewResolutionArray()) != NULL)
+       {
          if ((current_def = cfNewResolution(lowdpi, lowdpi)) != NULL)
           {
            cupsArrayAdd(current_res, current_def);
@@ -630,7 +658,7 @@ ppdCreatePPDFromIPP2(char         *buffer,          /* I - Filename buffer */
 #endif
   else if (cupsArrayFind(pdl_list, "application/pdf"))
   {
-    /* PDF printer */
+    // PDF printer
     cupsFilePuts(fp, "*cupsFilter2: \"application/vnd.cups-pdf application/pdf 0 -\"\n");
     manual_copies = 0;
     formatfound = 1;
@@ -640,11 +668,13 @@ ppdCreatePPDFromIPP2(char         *buffer,          /* I - Filename buffer */
   {
     if ((attr = ippFindAttribute(response,
                                 "pwg-raster-document-resolution-supported",
-                                IPP_TAG_RESOLUTION)) != NULL) {
+                                IPP_TAG_RESOLUTION)) != NULL)
+    {
       current_def = NULL;
       if ((current_res = cfIPPAttrToResolutionArray(attr)) != NULL &&
          cfJoinResolutionArrays(&common_res, &current_res, &common_def,
-                                &current_def)) {
+                                &current_def))
+      {
        cupsFilePuts(fp, "*cupsFilter2: \"image/pwg-raster image/pwg-raster 0 -\"\n");
        if (formatfound == 0) manual_copies = 1;
        formatfound = 1;
@@ -655,7 +685,8 @@ ppdCreatePPDFromIPP2(char         *buffer,          /* I - Filename buffer */
   else if (cupsArrayFind(pdl_list, "application/PCLm"))
   {
     if ((attr = ippFindAttribute(response, "pclm-source-resolution-supported",
-                                IPP_TAG_RESOLUTION)) != NULL) {
+                                IPP_TAG_RESOLUTION)) != NULL)
+    {
       if ((defattr = ippFindAttribute(response,
                                      "pclm-source-resolution-default",
                                      IPP_TAG_RESOLUTION)) != NULL)
@@ -664,7 +695,8 @@ ppdCreatePPDFromIPP2(char         *buffer,          /* I - Filename buffer */
        current_def = NULL;
       if ((current_res = cfIPPAttrToResolutionArray(attr)) != NULL &&
          cfJoinResolutionArrays(&common_res, &current_res, &common_def,
-                                &current_def)) {
+                                &current_def))
+      {
        cupsFilePuts(fp, "*cupsFilter2: \"application/PCLm application/PCLm 0 -\"\n");
        if (formatfound == 0) manual_copies = 1;
        formatfound = 1;
@@ -672,24 +704,27 @@ ppdCreatePPDFromIPP2(char         *buffer,          /* I - Filename buffer */
       }
     }
   }
-  /* Legacy formats only if we have no driverless format */
+  // Legacy formats only if we have no driverless format
   else if (cupsArrayFind(pdl_list, "application/vnd.hp-pclxl"))
   {
     cupsFilePrintf(fp, "*cupsFilter2: \"application/vnd.cups-pdf application/vnd.hp-pclxl 100 gstopxl\"\n");
-    if (formatfound == 0) manual_copies = 1;
+    if (formatfound == 0)
+      manual_copies = 1;
     formatfound = 1;
   }
   else if (cupsArrayFind(pdl_list, "application/postscript"))
   {
-    /* Higher cost value as PostScript interpreters are often buggy */
+    // Higher cost value as PostScript interpreters are often buggy
     cupsFilePuts(fp, "*cupsFilter2: \"application/vnd.cups-postscript application/postscript 0 -\"\n");
-    if (formatfound == 0) manual_copies = 0;
+    if (formatfound == 0)
+      manual_copies = 0;
     formatfound = 1;
   }
   else if (cupsArrayFind(pdl_list, "application/vnd.hp-pcl"))
   {
     cupsFilePrintf(fp, "*cupsFilter2: \"application/vnd.cups-raster application/vnd.hp-pcl 100 rastertopclx\"\n");
-    if (formatfound == 0) manual_copies = 1;
+    if (formatfound == 0)
+      manual_copies = 1;
     formatfound = 1;
   }
   if (cupsArrayFind(pdl_list, "image/jpeg"))
@@ -697,21 +732,24 @@ ppdCreatePPDFromIPP2(char         *buffer,          /* I - Filename buffer */
   if (cupsArrayFind(pdl_list, "image/png"))
     cupsFilePuts(fp, "*cupsFilter2: \"image/png image/png 0 -\"\n");
   cupsArrayDelete(pdl_list);
-  if (manual_copies < 0) manual_copies = 1;
+  if (manual_copies < 0)
+    manual_copies = 1;
   if (formatfound == 0)
     goto bad_ppd;
 
-  /* For the case that we will print in a raster format and not in a high-level
-     format, we need to create multiple copies on the client. We add a line to
-     the PPD which tells the pdftopdf filter to generate the copies */
+  // For the case that we will print in a raster format and not in a high-level
+  // format, we need to create multiple copies on the client. We add a line to
+  // the PPD which tells the pdftopdf filter to generate the copies
   if (manual_copies == 1)
     cupsFilePuts(fp, "*cupsManualCopies: True\n");
 
-  /* No resolution requirements by any of the supported PDLs? 
-     Use "printer-resolution-supported" attribute */
-  if (common_res == NULL) {
+  // No resolution requirements by any of the supported PDLs? 
+  // Use "printer-resolution-supported" attribute
+  if (common_res == NULL)
+  {
     if ((attr = ippFindAttribute(response, "printer-resolution-supported",
-                                IPP_TAG_RESOLUTION)) != NULL) {
+                                IPP_TAG_RESOLUTION)) != NULL)
+    {
       if ((defattr = ippFindAttribute(response, "printer-resolution-default",
                                      IPP_TAG_RESOLUTION)) != NULL)
        current_def = cfIPPResToResolution(defattr, 0);
@@ -722,9 +760,11 @@ ppdCreatePPDFromIPP2(char         *buffer,          /* I - Filename buffer */
                               &current_def);
     }
   }
-  /* Still no resolution found? Default to 300 dpi */
-  if (common_res == NULL) {
-    if ((common_res = cfNewResolutionArray()) != NULL) {
+  // Still no resolution found? Default to 300 dpi
+  if (common_res == NULL)
+  {
+    if ((common_res = cfNewResolutionArray()) != NULL)
+    {
       if ((current_def = cfNewResolution(300, 300)) != NULL)
       {
        cupsArrayAdd(common_res, current_def);
@@ -734,50 +774,58 @@ ppdCreatePPDFromIPP2(char         *buffer,          /* I - Filename buffer */
     } else
       goto bad_ppd;
   }
-  /* No default resolution determined yet */
-  if (common_def == NULL) {
+  // No default resolution determined yet
+  if (common_def == NULL)
+  {
     if ((defattr = ippFindAttribute(response, "printer-resolution-default",
-                                   IPP_TAG_RESOLUTION)) != NULL) {
+                                   IPP_TAG_RESOLUTION)) != NULL)
+    {
       common_def = cfIPPResToResolution(defattr, 0);
-      if (!cupsArrayFind(common_res, common_def)) {
+      if (!cupsArrayFind(common_res, common_def))
+      {
        free(common_def);
        common_def = NULL;
       }
     }
     if (common_def == NULL) {
       count = cupsArrayCount(common_res);
-      common_def = cfCopyResolution(cupsArrayIndex(common_res, count / 2), NULL);
+      common_def =
+       cfCopyResolution(cupsArrayIndex(common_res, count / 2), NULL);
     }
   }
-  /* Get minimum and maximum resolution */
+  // Get minimum and maximum resolution
   min_res = cfCopyResolution(cupsArrayFirst(common_res), NULL);
   max_res = cfCopyResolution(cupsArrayLast(common_res), NULL);
   cupsArrayDelete(common_res);
 
- /*
-  * Generically check for Raster-format-related attributes in IPP
-  * response and ppdize them one by one
-  */
+  //
+  // Generically check for Raster-format-related attributes in IPP
+  // response and ppdize them one by one
+  //
 
-  attr = ippFirstAttribute(response); /* first attribute */
-  while (attr) {                      /* loop through all the attributes */
+  attr = ippFirstAttribute(response); // first attribute
+  while (attr)                        // loop through all the attributes
+  {
     if ((is_apple && strncasecmp(ippGetName(attr), "urf-", 4) == 0) ||
-       (is_pwg && strncasecmp(ippGetName(attr), "pwg-raster-", 11) == 0)
-       || (is_pclm && strncasecmp(ippGetName(attr), "pclm-", 5) == 0)
-       ) {
+       (is_pwg && strncasecmp(ippGetName(attr), "pwg-raster-", 11) == 0) ||
+       (is_pclm && strncasecmp(ippGetName(attr), "pclm-", 5) == 0))
+    {
       ppdPwgPpdizeName(ippGetName(attr), ppdname, sizeof(ppdname));
       cupsFilePrintf(fp, "*cups%s: ", ppdname);
       ipp_tag_t tag = ippGetValueTag(attr);
       count = ippGetCount(attr);
 
-      if (tag == IPP_TAG_RESOLUTION) { /* ppdize values of type resolution */
-       if ((current_res = cfIPPAttrToResolutionArray(attr)) != NULL) {
+      if (tag == IPP_TAG_RESOLUTION) // ppdize values of type resolution
+      {
+       if ((current_res = cfIPPAttrToResolutionArray(attr)) != NULL)
+       {
          count = cupsArrayCount(current_res);
          if (count > 1)
            cupsFilePuts(fp, "\"");
          for (i = 0, current_def = cupsArrayFirst(current_res);
               current_def;
-              i ++, current_def = cupsArrayNext(current_res)) {
+              i ++, current_def = cupsArrayNext(current_res))
+         {
            int x = current_def->x;
            int y = current_def->y;
            if (x == y)
@@ -793,10 +841,12 @@ ppdCreatePPDFromIPP2(char         *buffer,          /* I - Filename buffer */
        } else
          cupsFilePuts(fp, "\"\"\n");
        cupsArrayDelete(current_res);
-      } else {
+      }
+      else
+      {
        ippAttributeString(attr, buf, sizeof(buf));
-       if (count > 1 || /* quotes around multi-valued and string
-                           attributes */
+       if (count > 1 || // quotes around multi-valued and string
+                        // attributes
            tag == IPP_TAG_STRING ||
            tag == IPP_TAG_TEXT ||
            tag == IPP_TAG_TEXTLANG)
@@ -808,37 +858,39 @@ ppdCreatePPDFromIPP2(char         *buffer,          /* I - Filename buffer */
     attr = ippNextAttribute(response);
   }
 
- /*
-  * PageSize/PageRegion/ImageableArea/PaperDimension
-  */
+  //
+  // PageSize/PageRegion/ImageableArea/PaperDimension
+  //
   cfGenerateSizes(response, CF_GEN_SIZES_DEFAULT, &printer_sizes, &defattr,
                  NULL, NULL, NULL, NULL, NULL, NULL,
                  &min_width, &min_length,
                  &max_width, &max_length,
                  &left, &bottom, &right, &top, ppdname, NULL);
-  if (sizes==NULL) {
+  if (sizes == NULL)
     sizes = printer_sizes;
-  else
+  else
     strcpy(ppdname, default_pagesize);
 
-  if (cupsArrayCount(sizes) > 0) {
-   /*
-    * List all of the standard sizes...
-    */
-
-    char       tleft[256],             /* Left string */
-               tbottom[256],           /* Bottom string */
-               tright[256],            /* Right string */
-               ttop[256],              /* Top string */
-               twidth[256],            /* Width string */
-               tlength[256],           /* Length string */
+  if (cupsArrayCount(sizes) > 0)
+  {
+    //
+    // List all of the standard sizes...
+    //
+
+    char       tleft[256],             // Left string
+               tbottom[256],           // Bottom string
+               tright[256],            // Right string
+               ttop[256],              // Top string
+               twidth[256],            // Width string
+               tlength[256],           // Length string
                ppdsizename[128];
     char        *ippsizename,
                 *suffix;
     int         all_borderless = 1;
 
-    /* Find a page size without ".Borderless" suffix */
-    /* (if all are ".Borderless" we drop the suffix in the PPD) */
+    // Find a page size without ".Borderless" suffix
+    // (if all are ".Borderless" we drop the suffix in the PPD)
     for (size = (cups_size_t *)cupsArrayFirst(sizes); size;
         size = (cups_size_t *)cupsArrayNext(sizes))
       if (strcasestr(size->media, ".Borderless") == NULL)
@@ -846,7 +898,8 @@ ppdCreatePPDFromIPP2(char         *buffer,          /* I - Filename buffer */
     if (size)
       all_borderless = 0;
 
-    if (all_borderless) {
+    if (all_borderless)
+    {
       suffix = strcasestr(ppdname, ".Borderless");
       if (suffix)
        *suffix = '\0';
@@ -856,13 +909,15 @@ ppdCreatePPDFromIPP2(char         *buffer,          /* I - Filename buffer */
                   "*OrderDependency: 10 AnySetup *PageSize\n"
                   "*DefaultPageSize: %s\n", "Media Size", ppdname);
     for (size = (cups_size_t *)cupsArrayFirst(sizes); size;
-        size = (cups_size_t *)cupsArrayNext(sizes)) {
+        size = (cups_size_t *)cupsArrayNext(sizes))
+    {
       cfStrFormatd(twidth, twidth + sizeof(twidth),
                      size->width * 72.0 / 2540.0, loc);
       cfStrFormatd(tlength, tlength + sizeof(tlength),
                      size->length * 72.0 / 2540.0, loc);
       strlcpy(ppdsizename, size->media, sizeof(ppdsizename));
-      if ((ippsizename = strchr(ppdsizename, ' ')) != NULL) {
+      if ((ippsizename = strchr(ppdsizename, ' ')) != NULL)
+      {
        *ippsizename = '\0';
        ippsizename ++;
       }
@@ -873,7 +928,8 @@ ppdCreatePPDFromIPP2(char         *buffer,          /* I - Filename buffer */
                                               printer_opt_strings_catalog);
       else
        human_readable = NULL;
-      if (!human_readable) {
+      if (!human_readable)
+      {
        pwg = pwgMediaForSize(size->width, size->length);
        if (pwg)
          human_readable = cfCatalogLookUpChoice((char *)pwg->pwg, "media",
@@ -881,7 +937,8 @@ ppdCreatePPDFromIPP2(char         *buffer,          /* I - Filename buffer */
                                                 printer_opt_strings_catalog);
       }
 
-      if (all_borderless) {
+      if (all_borderless)
+      {
        suffix = strcasestr(ppdsizename, ".Borderless");
        if (suffix)
          *suffix = '\0';
@@ -901,13 +958,15 @@ ppdCreatePPDFromIPP2(char         *buffer,          /* I - Filename buffer */
                   "*OrderDependency: 10 AnySetup *PageRegion\n"
                   "*DefaultPageRegion: %s\n", "Media Size", ppdname);
     for (size = (cups_size_t *)cupsArrayFirst(sizes); size;
-        size = (cups_size_t *)cupsArrayNext(sizes)) {
+        size = (cups_size_t *)cupsArrayNext(sizes))
+    {
       cfStrFormatd(twidth, twidth + sizeof(twidth),
                      size->width * 72.0 / 2540.0, loc);
       cfStrFormatd(tlength, tlength + sizeof(tlength),
                      size->length * 72.0 / 2540.0, loc);
       strlcpy(ppdsizename, size->media, sizeof(ppdsizename));
-      if ((ippsizename = strchr(ppdsizename, ' ')) != NULL) {
+      if ((ippsizename = strchr(ppdsizename, ' ')) != NULL)
+      {
        *ippsizename = '\0';
        ippsizename ++;
       }
@@ -918,7 +977,8 @@ ppdCreatePPDFromIPP2(char         *buffer,          /* I - Filename buffer */
                                               printer_opt_strings_catalog);
       else
        human_readable = NULL;
-      if (!human_readable) {
+      if (!human_readable)
+      {
        pwg = pwgMediaForSize(size->width, size->length);
        if (pwg)
          human_readable = cfCatalogLookUpChoice((char *)pwg->pwg, "media",
@@ -926,7 +986,8 @@ ppdCreatePPDFromIPP2(char         *buffer,          /* I - Filename buffer */
                                                 printer_opt_strings_catalog);
       }
 
-      if (all_borderless) {
+      if (all_borderless)
+      {
        suffix = strcasestr(ppdsizename, ".Borderless");
        if (suffix)
          *suffix = '\0';
@@ -946,7 +1007,8 @@ ppdCreatePPDFromIPP2(char         *buffer,          /* I - Filename buffer */
                   "*DefaultPaperDimension: %s\n", ppdname, ppdname);
 
     for (size = (cups_size_t *)cupsArrayFirst(sizes); size;
-        size = (cups_size_t *)cupsArrayNext(sizes)) {
+        size = (cups_size_t *)cupsArrayNext(sizes))
+    {
       cfStrFormatd(tleft, tleft + sizeof(tleft),
                      size->left * 72.0 / 2540.0, loc);
       cfStrFormatd(tbottom, tbottom + sizeof(tbottom),
@@ -963,7 +1025,8 @@ ppdCreatePPDFromIPP2(char         *buffer,          /* I - Filename buffer */
       if ((ippsizename = strchr(ppdsizename, ' ')) != NULL)
        *ippsizename = '\0';
 
-      if (all_borderless) {
+      if (all_borderless)
+      {
        suffix = strcasestr(ppdsizename, ".Borderless");
        if (suffix)
          *suffix = '\0';
@@ -975,35 +1038,36 @@ ppdCreatePPDFromIPP2(char         *buffer,          /* I - Filename buffer */
                     twidth, tlength);
     }
 
-   /*
-    * Custom size support...
-    */
+    //
+    // Custom size support...
+    //
 
     if (max_width > 0 && min_width < INT_MAX && max_length > 0 &&
-       min_length < INT_MAX) {
-      char     tmax[256], tmin[256];   /* Min/max values */
+       min_length < INT_MAX)
+    {
+      char     tmax[256], tmin[256];   // Min/max values
 
       cfStrFormatd(tleft, tleft + sizeof(tleft), left * 72.0 / 2540.0, loc);
       cfStrFormatd(tbottom, tbottom + sizeof(tbottom),
-                     bottom * 72.0 / 2540.0, loc);
+                  bottom * 72.0 / 2540.0, loc);
       cfStrFormatd(tright, tright + sizeof(tright), right * 72.0 / 2540.0,
-                     loc);
+                  loc);
       cfStrFormatd(ttop, ttop + sizeof(ttop), top * 72.0 / 2540.0, loc);
 
       cupsFilePrintf(fp, "*HWMargins: \"%s %s %s %s\"\n", tleft, tbottom,
                     tright, ttop);
 
       cfStrFormatd(tmax, tmax + sizeof(tmax), max_width * 72.0 / 2540.0,
-                     loc);
+                  loc);
       cfStrFormatd(tmin, tmin + sizeof(tmin), min_width * 72.0 / 2540.0,
-                     loc);
+                  loc);
       cupsFilePrintf(fp, "*ParamCustomPageSize Width: 1 points %s %s\n", tmin,
                     tmax);
 
       cfStrFormatd(tmax, tmax + sizeof(tmax), max_length * 72.0 / 2540.0,
-                     loc);
+                  loc);
       cfStrFormatd(tmin, tmin + sizeof(tmin), min_length * 72.0 / 2540.0,
-                     loc);
+                  loc);
       cupsFilePrintf(fp, "*ParamCustomPageSize Height: 2 points %s %s\n", tmin,
                     tmax);
 
@@ -1012,7 +1076,9 @@ ppdCreatePPDFromIPP2(char         *buffer,          /* I - Filename buffer */
       cupsFilePuts(fp, "*ParamCustomPageSize Orientation: 5 int 0 3\n");
       cupsFilePuts(fp, "*CustomPageSize True: \"pop pop pop <</PageSize[5 -2 roll]/ImagingBBox null>>setpagedevice\"\n");
     }
-  } else {
+  }
+  else
+  {
     cupsFilePrintf(fp,
                   "*%% Printer did not supply page size info via IPP, using defaults\n"
                   "*OpenUI *PageSize/Media Size: PickOne\n"
@@ -1081,9 +1147,9 @@ ppdCreatePPDFromIPP2(char         *buffer,          /* I - Filename buffer */
 
   cupsArrayDelete(printer_sizes);
 
- /*
-  * InputSlot...
-  */
+  //
+  // InputSlot...
+  //
 
   if ((attr = ippFindAttribute(ippGetCollection(defattr, 0), "media-source",
                               IPP_TAG_KEYWORD)) != NULL)
@@ -1093,11 +1159,12 @@ ppdCreatePPDFromIPP2(char         *buffer,          /* I - Filename buffer */
 
   if ((attr = ippFindAttribute(response, "media-source-supported",
                               IPP_TAG_KEYWORD)) != NULL &&
-      (count = ippGetCount(attr)) > 1) {
+      (count = ippGetCount(attr)) > 1)
+  {
     int have_default = ppdname[0] != '\0';
-                                       /* Do we have a default InputSlot? */
+                                       // Do we have a default InputSlot?
     static const char * const sources[] =
-    {                                  /* Standard "media-source" strings */
+    {                                  // Standard "media-source" strings
       "auto",
       "main",
       "alternate",
@@ -1157,7 +1224,8 @@ ppdCreatePPDFromIPP2(char         *buffer,          /* I - Filename buffer */
                   (human_readable ? human_readable : "Media Source"));
     if (have_default)
       cupsFilePrintf(fp, "*DefaultInputSlot: %s\n", ppdname);
-    for (i = 0, count = ippGetCount(attr); i < count; i ++) {
+    for (i = 0, count = ippGetCount(attr); i < count; i ++)
+    {
       keyword = ippGetString(attr, i, NULL);
 
       ppdPwgPpdizeName(keyword, ppdname, sizeof(ppdname));
@@ -1185,9 +1253,9 @@ ppdCreatePPDFromIPP2(char         *buffer,          /* I - Filename buffer */
     cupsFilePuts(fp, "*CloseUI: *InputSlot\n");
   }
 
- /*
-  * MediaType...
-  */
+  //
+  // MediaType...
+  //
 
   if ((attr = ippFindAttribute(ippGetCollection(defattr, 0), "media-type",
                               IPP_TAG_ZERO)) != NULL)
@@ -1197,7 +1265,8 @@ ppdCreatePPDFromIPP2(char         *buffer,          /* I - Filename buffer */
 
   if ((attr = ippFindAttribute(response, "media-type-supported",
                               IPP_TAG_ZERO)) != NULL &&
-      (count = ippGetCount(attr)) > 1) {
+      (count = ippGetCount(attr)) > 1)
+  {
     human_readable = cfCatalogLookUpOption("media-type", opt_strings_catalog,
                                           printer_opt_strings_catalog);
     cupsFilePrintf(fp, "*OpenUI *MediaType/%s: PickOne\n"
@@ -1205,7 +1274,8 @@ ppdCreatePPDFromIPP2(char         *buffer,          /* I - Filename buffer */
                   "*DefaultMediaType: %s\n",
                   (human_readable ? human_readable : "Media Type"),
                   ppdname);
-    for (i = 0; i < count; i ++) {
+    for (i = 0; i < count; i ++)
+    {
       keyword = ippGetString(attr, i, NULL);
 
       ppdPwgPpdizeName(keyword, ppdname, sizeof(ppdname));
@@ -1222,9 +1292,10 @@ ppdCreatePPDFromIPP2(char         *buffer,          /* I - Filename buffer */
     cupsFilePuts(fp, "*CloseUI: *MediaType\n");
   }
 
- /*
-  * ColorModel...
-  */
+  //
+  // ColorModel...
+  //
+
   if ((defattr = ippFindAttribute(response, "print-color-mode-default",
                                  IPP_TAG_KEYWORD)) == NULL)
     defattr = ippFindAttribute(response, "output-mode-default",
@@ -1238,8 +1309,9 @@ ppdCreatePPDFromIPP2(char         *buffer,          /* I - Filename buffer */
   human_readable = cfCatalogLookUpOption("print-color-mode",
                                         opt_strings_catalog,
                                         printer_opt_strings_catalog);
-  if (attr && ippGetCount(attr) > 0) {
-    const char *default_color = NULL;  /* Default */
+  if (attr && ippGetCount(attr) > 0)
+  {
+    const char *default_color = NULL;  // Default
     int first_choice = 1;
 
     if ((keyword = ippGetString(defattr, 0, NULL)) != NULL)
@@ -1260,11 +1332,14 @@ ppdCreatePPDFromIPP2(char         *buffer,          /* I - Filename buffer */
 
     cupsFilePrintf(fp, "*%% ColorModel from %s\n", ippGetName(attr));
 
-    for (i = 0, count = ippGetCount(attr); i < count; i ++) {
-      keyword = ippGetString(attr, i, NULL); /* Keyword for color/bit depth */
+    for (i = 0, count = ippGetCount(attr); i < count; i ++)
+    {
+      keyword = ippGetString(attr, i, NULL); // Keyword for color/bit depth
 
-      if (!strcmp(keyword, "bi-level")) {
-        if (first_choice) {
+      if (!strcmp(keyword, "bi-level"))
+      {
+        if (first_choice)
+       {
          first_choice = 0;
          cupsFilePrintf(fp, "*OpenUI *ColorModel/%s: PickOne\n"
                         "*OrderDependency: 10 AnySetup *ColorModel\n",
@@ -1279,8 +1354,11 @@ ppdCreatePPDFromIPP2(char         *buffer,          /* I - Filename buffer */
 
         if (!default_color)
          default_color = "FastGray";
-      } else if (!strcmp(keyword, "process-bi-level")) {
-        if (first_choice) {
+      }
+      else if (!strcmp(keyword, "process-bi-level"))
+      {
+        if (first_choice)
+       {
          first_choice = 0;
          cupsFilePrintf(fp, "*OpenUI *ColorModel/%s: PickOne\n"
                         "*OrderDependency: 10 AnySetup *ColorModel\n",
@@ -1293,8 +1371,11 @@ ppdCreatePPDFromIPP2(char         *buffer,          /* I - Filename buffer */
                                                printer_opt_strings_catalog);
         cupsFilePrintf(fp, "*ColorModel ProcessFastGray/%s: \"\"\n",
                       (human_readable2 ? human_readable2 : "Process Text"));
-      } else if (!strcmp(keyword, "auto-monochrome")) {
-        if (first_choice) {
+      }
+      else if (!strcmp(keyword, "auto-monochrome"))
+      {
+        if (first_choice)
+       {
          first_choice = 0;
          cupsFilePrintf(fp, "*OpenUI *ColorModel/%s: PickOne\n"
                         "*OrderDependency: 10 AnySetup *ColorModel\n",
@@ -1307,8 +1388,11 @@ ppdCreatePPDFromIPP2(char         *buffer,          /* I - Filename buffer */
                                                printer_opt_strings_catalog);
         cupsFilePrintf(fp, "*ColorModel AutoGray/%s: \"\"\n",
                       (human_readable2 ? human_readable2 : "Auto Monochrome"));
-      } else if (!strcmp(keyword, "monochrome")) {
-        if (first_choice) {
+      }
+      else if (!strcmp(keyword, "monochrome"))
+      {
+        if (first_choice)
+       {
          first_choice = 0;
          cupsFilePrintf(fp, "*OpenUI *ColorModel/%s: PickOne\n"
                         "*OrderDependency: 10 AnySetup *ColorModel\n",
@@ -1324,8 +1408,11 @@ ppdCreatePPDFromIPP2(char         *buffer,          /* I - Filename buffer */
 
         if (!default_color || (!defattr && !strcmp(default_color, "FastGray")))
          default_color = "Gray";
-      } else if (!strcmp(keyword, "process-monochrome")) {
-        if (first_choice) {
+      }
+      else if (!strcmp(keyword, "process-monochrome"))
+      {
+        if (first_choice)
+       {
          first_choice = 0;
          cupsFilePrintf(fp, "*OpenUI *ColorModel/%s: PickOne\n"
                         "*OrderDependency: 10 AnySetup *ColorModel\n",
@@ -1339,8 +1426,11 @@ ppdCreatePPDFromIPP2(char         *buffer,          /* I - Filename buffer */
         cupsFilePrintf(fp, "*ColorModel ProcessGray/%s: \"\"\n",
                       (human_readable2 ? human_readable2 :
                        "Process Monochrome"));
-      } else if (!strcmp(keyword, "color")) {
-        if (first_choice) {
+      }
+      else if (!strcmp(keyword, "color"))
+      {
+        if (first_choice)
+       {
          first_choice = 0;
          cupsFilePrintf(fp, "*OpenUI *ColorModel/%s: PickOne\n"
                         "*OrderDependency: 10 AnySetup *ColorModel\n",
@@ -1356,13 +1446,14 @@ ppdCreatePPDFromIPP2(char         *buffer,          /* I - Filename buffer */
         if (!defattr)
          default_color = "RGB";
 
-       /* Apparently some printers only advertise color support, so make sure
-           we also do grayscale for these printers... */
+       // Apparently some printers only advertise color support, so make sure
+       // we also do grayscale for these printers...
        if (!ippContainsString(attr, "monochrome") &&
            !ippContainsString(attr, "auto-monochrome") &&
            !ippContainsString(attr, "process-monochrome") &&
            !ippContainsString(attr, "bi-level") &&
-           !ippContainsString(attr, "process-bi-level")) {
+           !ippContainsString(attr, "process-bi-level"))
+       {
          human_readable2 = cfCatalogLookUpChoice("monochrome",
                                                  "print-color-mode",
                                                  opt_strings_catalog,
@@ -1373,12 +1464,13 @@ ppdCreatePPDFromIPP2(char         *buffer,          /* I - Filename buffer */
       }
     }
 
-    if (default_pagesize != NULL && (!default_color || !defattr)) {
-      /* Here we are dealing with a cluster, if the default cluster color
-         is not supplied we set it Gray*/
-      if (default_cluster_color != NULL) {
+    if (default_pagesize != NULL && (!default_color || !defattr))
+    {
+      // Here we are dealing with a cluster, if the default cluster color
+      // is not supplied we set it Gray
+      if (default_cluster_color != NULL)
        default_color = default_cluster_color;
-      else
+      else
        default_color = "Gray";
     }
 
@@ -1386,30 +1478,34 @@ ppdCreatePPDFromIPP2(char         *buffer,          /* I - Filename buffer */
       cupsFilePrintf(fp, "*DefaultColorModel: %s\n", default_color);
     if (!first_choice)
       cupsFilePuts(fp, "*CloseUI: *ColorModel\n");
-  } else {
+  }
+  else
+  {
     cupsFilePrintf(fp, "*OpenUI *ColorModel/%s: PickOne\n"
                   "*OrderDependency: 10 AnySetup *ColorModel\n",
                   (human_readable ? human_readable : "Color Mode"));
-    if (color) {
-      /* Color printer according to DNS-SD (or unknown) */
+    if (color)
+    {
+      // Color printer according to DNS-SD (or unknown)
       cupsFilePrintf(fp, "*DefaultColorModel: RGB\n");
       cupsFilePuts(fp, "*ColorModel RGB/Color: \"\"\n");
-    } else {
-      cupsFilePrintf(fp, "*DefaultColorModel: Gray\n");
     }
+    else
+      cupsFilePrintf(fp, "*DefaultColorModel: Gray\n");
     cupsFilePuts(fp, "*ColorModel FastGray/Fast Grayscale: \"\"\n");
     cupsFilePuts(fp, "*ColorModel Gray/Grayscale: \"\"\n");
     cupsFilePuts(fp, "*CloseUI: *ColorModel\n");
   }
 
- /*
-  * Duplex...
-  */
+  //
+  // Duplex...
+  //
 
   if (((attr = ippFindAttribute(response, "sides-supported",
                                IPP_TAG_KEYWORD)) != NULL &&
        ippContainsString(attr, "two-sided-long-edge")) ||
-      (attr == NULL && duplex)) {
+      (attr == NULL && duplex))
+  {
     human_readable = cfCatalogLookUpOption("sides", opt_strings_catalog,
                                           printer_opt_strings_catalog);
     cupsFilePrintf(fp, "*OpenUI *Duplex/%s: PickOne\n"
@@ -1434,28 +1530,39 @@ ppdCreatePPDFromIPP2(char         *buffer,          /* I - Filename buffer */
     cupsFilePrintf(fp, "*CloseUI: *Duplex\n");
 
     if ((attr = ippFindAttribute(response, "urf-supported",
-                                IPP_TAG_KEYWORD)) != NULL) {
-      for (i = 0, count = ippGetCount(attr); i < count; i ++) {
-       const char *dm = ippGetString(attr, i, NULL); /* DM value */
+                                IPP_TAG_KEYWORD)) != NULL)
+    {
+      for (i = 0, count = ippGetCount(attr); i < count; i ++)
+      {
+       const char *dm = ippGetString(attr, i, NULL); // DM value
 
-       if (!strcasecmp(dm, "DM1")) {
+       if (!strcasecmp(dm, "DM1"))
+       {
          cupsFilePuts(fp, "*cupsBackSide: Normal\n");
          break;
-       } else if (!strcasecmp(dm, "DM2")) {
+       }
+       else if (!strcasecmp(dm, "DM2"))
+       {
          cupsFilePuts(fp, "*cupsBackSide: Flipped\n");
          break;
-       } else if (!strcasecmp(dm, "DM3")) {
+       }
+       else if (!strcasecmp(dm, "DM3"))
+       {
          cupsFilePuts(fp, "*cupsBackSide: Rotated\n");
          break;
-       } else if (!strcasecmp(dm, "DM4")) {
+       }
+       else if (!strcasecmp(dm, "DM4"))
+       {
          cupsFilePuts(fp, "*cupsBackSide: ManualTumble\n");
          break;
        }
       }
-    } else if ((attr = ippFindAttribute(response,
-                                       "pwg-raster-document-sheet-back",
-                                       IPP_TAG_KEYWORD)) != NULL) {
-      keyword = ippGetString(attr, 0, NULL); /* Keyword value */
+    }
+    else if ((attr = ippFindAttribute(response,
+                                     "pwg-raster-document-sheet-back",
+                                     IPP_TAG_KEYWORD)) != NULL)
+    {
+      keyword = ippGetString(attr, 0, NULL); // Keyword value
 
       if (!strcmp(keyword, "flipped"))
         cupsFilePuts(fp, "*cupsBackSide: Flipped\n");
@@ -1468,9 +1575,9 @@ ppdCreatePPDFromIPP2(char         *buffer,          /* I - Filename buffer */
     }
   }
 
- /*
-  * Output bin...
-  */
+  //
+  // Output bin...
+  //
 
   if ((attr = ippFindAttribute(response, "output-bin-default",
                               IPP_TAG_ZERO)) != NULL)
@@ -1480,7 +1587,8 @@ ppdCreatePPDFromIPP2(char         *buffer,          /* I - Filename buffer */
 
   if ((attr = ippFindAttribute(response, "output-bin-supported",
                               IPP_TAG_ZERO)) != NULL &&
-      (count = ippGetCount(attr)) > 0) {
+      (count = ippGetCount(attr)) > 0)
+  {
     human_readable = cfCatalogLookUpOption("output-bin", opt_strings_catalog,
                                           printer_opt_strings_catalog);
     cupsFilePrintf(fp, "*OpenUI *OutputBin/%s: PickOne\n"
@@ -1489,7 +1597,8 @@ ppdCreatePPDFromIPP2(char         *buffer,          /* I - Filename buffer */
                   (human_readable ? human_readable : "Output Bin"),
                   ppdname);
     attr2 = ippFindAttribute(response, "printer-output-tray", IPP_TAG_STRING);
-    for (i = 0; i < count; i ++) {
+    for (i = 0; i < count; i ++)
+    {
       keyword = ippGetString(attr, i, NULL);
 
       ppdPwgPpdizeName(keyword, ppdname, sizeof(ppdname));
@@ -1504,33 +1613,42 @@ ppdCreatePPDFromIPP2(char         *buffer,          /* I - Filename buffer */
       outputorderinfofound = 0;
       faceupdown = 1;
       firsttolast = 1;
-      if (attr2 && i < ippGetCount(attr2)) {
+      if (attr2 && i < ippGetCount(attr2))
+      {
        outbin_properties_octet = ippGetOctetString(attr2, i, &octet_str_len);
        memset(outbin_properties, 0, sizeof(outbin_properties));
        memcpy(outbin_properties, outbin_properties_octet,
               ((size_t)octet_str_len < sizeof(outbin_properties) - 1 ?
                (size_t)octet_str_len : sizeof(outbin_properties) - 1));
-       if (strcasestr(outbin_properties, "pagedelivery=faceUp")) {
+       if (strcasestr(outbin_properties, "pagedelivery=faceUp"))
+       {
          outputorderinfofound = 1;
          faceupdown = -1;
-       } else if (strcasestr(outbin_properties, "pagedelivery=faceDown")) {
+       }
+       else if (strcasestr(outbin_properties, "pagedelivery=faceDown"))
+       {
          outputorderinfofound = 1;
          faceupdown = 1;
        }
-       if (strcasestr(outbin_properties, "stackingorder=lastToFirst")) {
+       if (strcasestr(outbin_properties, "stackingorder=lastToFirst"))
+       {
          outputorderinfofound = 1;
          firsttolast = -1;
-       } else if (strcasestr(outbin_properties, "stackingorder=firstToLast")) {
+       }
+       else if (strcasestr(outbin_properties, "stackingorder=firstToLast"))
+       {
          outputorderinfofound = 1;
          firsttolast = 1;
        }
       }
       if (outputorderinfofound == 0) {
-       if (strcasestr(keyword, "face-up")) {
+       if (strcasestr(keyword, "face-up"))
+       {
          outputorderinfofound = 1;
          faceupdown = -1;
        }
-       if (strcasestr(keyword, "face-down")) {
+       if (strcasestr(keyword, "face-down"))
+       {
          outputorderinfofound = 1;
          faceupdown = 1;
        }
@@ -1543,31 +1661,32 @@ ppdCreatePPDFromIPP2(char         *buffer,          /* I - Filename buffer */
     cupsFilePuts(fp, "*CloseUI: *OutputBin\n");
   }
 
- /*
-  * Finishing options...
-  */
+  //
+  // Finishing options...
+  // 
 
   if ((attr = ippFindAttribute(response, "finishings-supported",
-                              IPP_TAG_ENUM)) != NULL) {
-    int                        value;          /* Enum value */
-    const char         *ppd_keyword;   /* PPD keyword for enum */
-    cups_array_t       *names;         /* Names we've added */
+                              IPP_TAG_ENUM)) != NULL)
+  {
+    int                        value;          // Enum value
+    const char         *ppd_keyword;   // PPD keyword for enum
+    cups_array_t       *names;         // Names we've added
     static const char * const base_keywords[] =
-    {                                  /* Base STD 92 keywords */
-      NULL,                            /* none */
-      "SingleAuto",                    /* staple */
-      "SingleAuto",                    /* punch */
-      NULL,                            /* cover */
-      "BindAuto",                      /* bind */
-      "SaddleStitch",                  /* saddle-stitch */
-      "EdgeStitchAuto",                        /* edge-stitch */
-      "Auto",                          /* fold */
-      NULL,                            /* trim */
-      NULL,                            /* bale */
-      NULL,                            /* booklet-maker */
-      NULL,                            /* jog-offset */
-      NULL,                            /* coat */
-      NULL                             /* laminate */
+    {                                  // Base STD 92 keywords
+      NULL,                            // none
+      "SingleAuto",                    // staple
+      "SingleAuto",                    // punch
+      NULL,                            // cover
+      "BindAuto",                      // bind
+      "SaddleStitch",                  // saddle-stitch
+      "EdgeStitchAuto",                        // edge-stitch
+      "Auto",                          // fold
+      NULL,                            // trim
+      NULL,                            // bale
+      NULL,                            // booklet-maker
+      NULL,                            // jog-offset
+      NULL,                            // coat
+      NULL                             // laminate
     };
 
     count = ippGetCount(attr);
@@ -1575,11 +1694,12 @@ ppdCreatePPDFromIPP2(char         *buffer,          /* I - Filename buffer */
                          (cups_acopy_func_t)strdup, (cups_afree_func_t)free);
     fin_options = cupsArrayNew((cups_array_func_t)strcmp, NULL);
 
-   /*
-    * Staple/Bind/Stitch
-    */
+    //
+    // Staple/Bind/Stitch
+    //
 
-    for (i = 0; i < count; i ++) {
+    for (i = 0; i < count; i ++)
+    {
       value   = ippGetInteger(attr, i);
       keyword = ippEnumString("finishings", value);
 
@@ -1590,9 +1710,10 @@ ppdCreatePPDFromIPP2(char         *buffer,          /* I - Filename buffer */
         break;
     }
 
-    if (i < count) {
+    if (i < count)
+    {
       static const char * const staple_keywords[] =
-      {                                        /* StapleLocation keywords */
+      {                                        // StapleLocation keywords
        "SinglePortrait",
        "SingleRevLandscape",
        "SingleLandscape",
@@ -1611,7 +1732,7 @@ ppdCreatePPDFromIPP2(char         *buffer,          /* I - Filename buffer */
        "TripleRevLandscape"
       };
       static const char * const bind_keywords[] =
-      {                                        /* StapleLocation binding keywords */
+      {                                        // StapleLocation binding keywords
        "BindPortrait",
        "BindLandscape",
        "BindRevPortrait",
@@ -1633,7 +1754,8 @@ ppdCreatePPDFromIPP2(char         *buffer,          /* I - Filename buffer */
       cupsFilePrintf(fp, "*StapleLocation None/%s: \"\"\n",
                     (human_readable ? human_readable : "None"));
 
-      for (; i < count; i ++) {
+      for (; i < count; i ++)
+      {
         value   = ippGetInteger(attr, i);
         keyword = ippEnumString("finishings", value);
 
@@ -1644,7 +1766,7 @@ ppdCreatePPDFromIPP2(char         *buffer,          /* I - Filename buffer */
           continue;
 
         if (cupsArrayFind(names, (char *)keyword))
-          continue; /* Already did this finishing template */
+          continue; // Already did this finishing template
 
         cupsArrayAdd(names, (char *)keyword);
 
@@ -1676,11 +1798,12 @@ ppdCreatePPDFromIPP2(char         *buffer,          /* I - Filename buffer */
       cupsFilePuts(fp, "*CloseUI: *StapleLocation\n");
     }
 
-   /*
-    * Fold
-    */
+    //
+    // Fold
+    //
 
-    for (i = 0; i < count; i ++) {
+    for (i = 0; i < count; i ++)
+    {
       value   = ippGetInteger(attr, i);
       keyword = ippEnumString("finishings", value);
 
@@ -1690,9 +1813,10 @@ ppdCreatePPDFromIPP2(char         *buffer,          /* I - Filename buffer */
         break;
     }
 
-    if (i < count) {
+    if (i < count)
+    {
       static const char * const fold_keywords[] =
-      {                                        /* FoldType keywords */
+      {                                        // FoldType keywords
        "Accordion",
        "DoubleGate",
        "Gate",
@@ -1722,7 +1846,8 @@ ppdCreatePPDFromIPP2(char         *buffer,          /* I - Filename buffer */
       cupsFilePrintf(fp, "*FoldType None/%s: \"\"\n",
                     (human_readable ? human_readable : "None"));
 
-      for (; i < count; i ++) {
+      for (; i < count; i ++)
+      {
         value   = ippGetInteger(attr, i);
         keyword = ippEnumString("finishings", value);
 
@@ -1732,7 +1857,7 @@ ppdCreatePPDFromIPP2(char         *buffer,          /* I - Filename buffer */
           continue;
 
         if (cupsArrayFind(names, (char *)keyword))
-          continue; /* Already did this finishing template */
+          continue; // Already did this finishing template
 
         cupsArrayAdd(names, (char *)keyword);
 
@@ -1765,11 +1890,12 @@ ppdCreatePPDFromIPP2(char         *buffer,          /* I - Filename buffer */
       cupsFilePuts(fp, "*CloseUI: *FoldType\n");
     }
 
-   /*
-    * Punch
-    */
+    //
+    // Punch
+    //
 
-    for (i = 0; i < count; i ++) {
+    for (i = 0; i < count; i ++)
+    {
       value   = ippGetInteger(attr, i);
       keyword = ippEnumString("finishings", value);
 
@@ -1778,9 +1904,10 @@ ppdCreatePPDFromIPP2(char         *buffer,          /* I - Filename buffer */
         break;
     }
 
-    if (i < count) {
+    if (i < count)
+    {
       static const char * const punch_keywords[] =
-      {                                        /* PunchMedia keywords */
+      {                                        // PunchMedia keywords
        "SinglePortrait",
        "SingleRevLandscape",
        "SingleLandscape",
@@ -1818,7 +1945,8 @@ ppdCreatePPDFromIPP2(char         *buffer,          /* I - Filename buffer */
       cupsFilePrintf(fp, "*PunchMedia None/%s: \"\"\n",
                     (human_readable ? human_readable : "None"));
 
-      for (i = 0; i < count; i ++) {
+      for (i = 0; i < count; i ++)
+      {
         value   = ippGetInteger(attr, i);
         keyword = ippEnumString("finishings", value);
 
@@ -1828,7 +1956,7 @@ ppdCreatePPDFromIPP2(char         *buffer,          /* I - Filename buffer */
           continue;
 
         if (cupsArrayFind(names, (char *)keyword))
-          continue; /* Already did this finishing template */
+          continue; // Already did this finishing template
 
         cupsArrayAdd(names, (char *)keyword);
 
@@ -1861,11 +1989,12 @@ ppdCreatePPDFromIPP2(char         *buffer,          /* I - Filename buffer */
       cupsFilePuts(fp, "*CloseUI: *PunchMedia\n");
     }
 
-   /*
-    * Booklet
-    */
+    //
+    // Booklet
+    //
 
-    if (ippContainsInteger(attr, IPP_FINISHINGS_BOOKLET_MAKER)) {
+    if (ippContainsInteger(attr, IPP_FINISHINGS_BOOKLET_MAKER))
+    {
       cupsArrayAdd(fin_options, "*Booklet");
 
       human_readable = cfCatalogLookUpChoice("booklet-maker",
@@ -1883,11 +2012,12 @@ ppdCreatePPDFromIPP2(char         *buffer,          /* I - Filename buffer */
       cupsFilePuts(fp, "*CloseUI: *Booklet\n");
     }
 
-   /*
-    * CutMedia
-    */
+    //
+    // CutMedia
+    //
 
-    for (i = 0; i < count; i ++) {
+    for (i = 0; i < count; i ++)
+    {
       value   = ippGetInteger(attr, i);
       keyword = ippEnumString("finishings", value);
 
@@ -1895,9 +2025,10 @@ ppdCreatePPDFromIPP2(char         *buffer,          /* I - Filename buffer */
         break;
     }
 
-    if (i < count) {
+    if (i < count)
+    {
       static const char * const trim_keywords[] =
-      {                                /* CutMedia keywords */
+      {                                // CutMedia keywords
         "EndOfPage",
         "EndOfDoc",
         "EndOfSet",
@@ -1919,7 +2050,8 @@ ppdCreatePPDFromIPP2(char         *buffer,          /* I - Filename buffer */
       cupsFilePrintf(fp, "*CutMedia None/%s: \"\"\n",
                     (human_readable ? human_readable : "None"));
 
-      for (i = 0; i < count; i ++) {
+      for (i = 0; i < count; i ++)
+      {
         value   = ippGetInteger(attr, i);
         keyword = ippEnumString("finishings", value);
 
@@ -1927,7 +2059,7 @@ ppdCreatePPDFromIPP2(char         *buffer,          /* I - Filename buffer */
           continue;
 
         if (cupsArrayFind(names, (char *)keyword))
-          continue; /* Already did this finishing template */
+          continue; // Already did this finishing template
 
         cupsArrayAdd(names, (char *)keyword);
 
@@ -1954,10 +2086,11 @@ ppdCreatePPDFromIPP2(char         *buffer,          /* I - Filename buffer */
   }
 
   if ((attr = ippFindAttribute(response, "finishings-col-database",
-                              IPP_TAG_BEGIN_COLLECTION)) != NULL) {
-    ipp_t      *finishing_col;         /* Current finishing collection */
-    ipp_attribute_t *finishing_attr;   /* Current finishing member attribute */
-    cups_array_t *templates;           /* Finishing templates */
+                              IPP_TAG_BEGIN_COLLECTION)) != NULL)
+  {
+    ipp_t      *finishing_col;         // Current finishing collection
+    ipp_attribute_t *finishing_attr;   // Current finishing member attribute
+    cups_array_t *templates;           // Finishing templates
 
     human_readable = cfCatalogLookUpOption("finishing-template",
                                           opt_strings_catalog,
@@ -1975,7 +2108,8 @@ ppdCreatePPDFromIPP2(char         *buffer,          /* I - Filename buffer */
     templates = cupsArrayNew((cups_array_func_t)strcmp, NULL);
     count     = ippGetCount(attr);
 
-    for (i = 0; i < count; i ++) {
+    for (i = 0; i < count; i ++)
+    {
       finishing_col = ippGetCollection(attr, i);
       keyword = ippGetString(ippFindAttribute(finishing_col,
                                              "finishing-template",
@@ -2001,7 +2135,7 @@ ppdCreatePPDFromIPP2(char         *buffer,          /* I - Filename buffer */
           finishing_attr = ippNextAttribute(finishing_col)) {
         if (ippGetValueTag(finishing_attr) == IPP_TAG_BEGIN_COLLECTION) {
          const char *name = ippGetName(finishing_attr);
-                                       /* Member attribute name */
+                                       // Member attribute name
 
           if (strcmp(name, "media-size"))
             cupsFilePrintf(fp, "%% %s\n", name);
@@ -2013,8 +2147,9 @@ ppdCreatePPDFromIPP2(char         *buffer,          /* I - Filename buffer */
 
     cupsFilePuts(fp, "*CloseUI: *cupsFinishingTemplate\n");
 
-    if (cupsArrayCount(fin_options)) {
-      const char       *fin_option;    /* Current finishing option */
+    if (cupsArrayCount(fin_options))
+    {
+      const char       *fin_option;    // Current finishing option
 
       cupsFilePuts(fp, "*cupsUIConstraint finishing-template: \"*cupsFinishingTemplate");
       for (fin_option = (const char *)cupsArrayFirst(fin_options); fin_option;
@@ -2034,9 +2169,9 @@ ppdCreatePPDFromIPP2(char         *buffer,          /* I - Filename buffer */
 
   cupsArrayDelete(fin_options);
 
- /*
-  * DefaultResolution...
-  */
+  //
+  // DefaultResolution...
+  //
 
   xres = common_def->x;
   yres = common_def->y;
@@ -2045,20 +2180,22 @@ ppdCreatePPDFromIPP2(char         *buffer,          /* I - Filename buffer */
   else
     cupsFilePrintf(fp, "*DefaultResolution: %dx%ddpi\n", xres, yres);
 
- /*
-  * cupsPrintQuality...
-  */
+  //
+  // cupsPrintQuality...
+  //
 
   if ((quality =
        ippFindAttribute(response, "print-quality-supported",
-                       IPP_TAG_ENUM)) != NULL) {
+                       IPP_TAG_ENUM)) != NULL)
+  {
     human_readable = cfCatalogLookUpOption("print-quality", opt_strings_catalog,
                                           printer_opt_strings_catalog);
     cupsFilePrintf(fp, "*OpenUI *cupsPrintQuality/%s: PickOne\n"
                   "*OrderDependency: 10 AnySetup *cupsPrintQuality\n"
                   "*DefaultcupsPrintQuality: Normal\n",
                   (human_readable ? human_readable : "Print Quality"));
-    if (ippContainsInteger(quality, IPP_QUALITY_DRAFT)) {
+    if (ippContainsInteger(quality, IPP_QUALITY_DRAFT))
+    {
       human_readable = cfCatalogLookUpChoice("3", "print-quality",
                                             opt_strings_catalog,
                                             printer_opt_strings_catalog);
@@ -2072,7 +2209,8 @@ ppdCreatePPDFromIPP2(char         *buffer,          /* I - Filename buffer */
     cupsFilePrintf(fp, "*cupsPrintQuality Normal/%s: \"<</HWResolution[%d %d]>>setpagedevice\"\n",
                   (human_readable ? human_readable : "Normal"),
                   common_def->x, common_def->y);
-    if (ippContainsInteger(quality, IPP_QUALITY_HIGH)) {
+    if (ippContainsInteger(quality, IPP_QUALITY_HIGH))
+    {
       human_readable = cfCatalogLookUpChoice("5", "print-quality",
                                             opt_strings_catalog,
                                             printer_opt_strings_catalog);
@@ -2083,14 +2221,15 @@ ppdCreatePPDFromIPP2(char         *buffer,          /* I - Filename buffer */
     cupsFilePuts(fp, "*CloseUI: *cupsPrintQuality\n");
   }
 
-  /* Only add these options if jobs get sent to the printer as PDF,
-     PWG Raster, or Apple Raster, as only then arbitrary IPP
-     attributes get passed through from the filter command line
-     to the printer by the "ipp" CUPS backend. */
-  if (is_pdf || is_pwg || is_apple) {
-    /*
-     * Print Optimization ...
-     */
+  // Only add these options if jobs get sent to the printer as PDF,
+  // PWG Raster, or Apple Raster, as only then arbitrary IPP
+  // attributes get passed through from the filter command line
+  // to the printer by the "ipp" CUPS backend.
+  if (is_pdf || is_pwg || is_apple)
+  {
+    //
+    // Print Optimization ...
+    //
 
     if ((attr = ippFindAttribute(response, "print-content-optimize-default",
                                 IPP_TAG_ZERO)) != NULL)
@@ -2100,7 +2239,8 @@ ppdCreatePPDFromIPP2(char         *buffer,          /* I - Filename buffer */
 
     if ((attr = ippFindAttribute(response, "print-content-optimize-supported",
                                 IPP_TAG_ZERO)) != NULL &&
-       (count = ippGetCount(attr)) > 1) {
+       (count = ippGetCount(attr)) > 1)
+    {
       human_readable = cfCatalogLookUpOption("print-content-optimize",
                                             opt_strings_catalog,
                                             printer_opt_strings_catalog);
@@ -2124,9 +2264,9 @@ ppdCreatePPDFromIPP2(char         *buffer,          /* I - Filename buffer */
       cupsFilePuts(fp, "*CloseUI: *print-content-optimize\n");
     }
 
-    /*
-     * Print Rendering Intent ...
-     */
+    //
+    // Print Rendering Intent ...
+    //
 
     if ((attr = ippFindAttribute(response, "print-rendering-intent-default",
                                 IPP_TAG_ZERO)) != NULL)
@@ -2136,7 +2276,8 @@ ppdCreatePPDFromIPP2(char         *buffer,          /* I - Filename buffer */
 
     if ((attr = ippFindAttribute(response, "print-rendering-intent-supported",
                                 IPP_TAG_ZERO)) != NULL &&
-       (count = ippGetCount(attr)) > 1) {
+       (count = ippGetCount(attr)) > 1)
+    {
       human_readable = cfCatalogLookUpOption("print-rendering-intent",
                                             opt_strings_catalog,
                                             printer_opt_strings_catalog);
@@ -2146,7 +2287,8 @@ ppdCreatePPDFromIPP2(char         *buffer,          /* I - Filename buffer */
                     (human_readable ? human_readable :
                      "Print Rendering Intent"),
                     ppdname);
-      for (i = 0; i < count; i ++) {
+      for (i = 0; i < count; i ++)
+      {
        keyword = ippGetString(attr, i, NULL);
 
        human_readable = cfCatalogLookUpChoice((char *)keyword,
@@ -2162,9 +2304,9 @@ ppdCreatePPDFromIPP2(char         *buffer,          /* I - Filename buffer */
       cupsFilePuts(fp, "*CloseUI: *cupsRenderingIntent\n");
     }
 
-    /*
-     * Print Scaling ...
-     */
+    //
+    // Print Scaling ...
+    //
 
     if ((attr = ippFindAttribute(response, "print-scaling-default",
                                 IPP_TAG_ZERO)) != NULL)
@@ -2174,7 +2316,8 @@ ppdCreatePPDFromIPP2(char         *buffer,          /* I - Filename buffer */
 
     if ((attr = ippFindAttribute(response, "print-scaling-supported",
                                 IPP_TAG_ZERO)) != NULL &&
-       (count = ippGetCount(attr)) > 1) {
+       (count = ippGetCount(attr)) > 1)
+    {
       human_readable = cfCatalogLookUpOption("print-scaling",
                                             opt_strings_catalog,
                                             printer_opt_strings_catalog);
@@ -2183,7 +2326,8 @@ ppdCreatePPDFromIPP2(char         *buffer,          /* I - Filename buffer */
                     "*Defaultprint-scaling: %s\n",
                     (human_readable ? human_readable : "Print Scaling"),
                     ppdname);
-      for (i = 0; i < count; i ++) {
+      for (i = 0; i < count; i ++)
+      {
        keyword = ippGetString(attr, i, NULL);
 
        human_readable = cfCatalogLookUpChoice((char *)keyword, "print-scaling",
@@ -2198,11 +2342,12 @@ ppdCreatePPDFromIPP2(char         *buffer,          /* I - Filename buffer */
     }
   }
 
- /*
-  * Phone Options for Fax..
-  */
+  //
+  // Phone Options for Fax..
+  //
 
-  if (is_fax) {
+  if (is_fax)
+  {
     human_readable = cfCatalogLookUpOption("Phone", opt_strings_catalog,
                                           printer_opt_strings_catalog);
 
@@ -2228,21 +2373,23 @@ ppdCreatePPDFromIPP2(char         *buffer,          /* I - Filename buffer */
                   "*ParamCustomfaxPrefix Text: 1 string 0 64\n");
   }
 
- /*
-  * Presets...
-  */
+  //
+  // Presets...
+  //
 
   if ((attr = ippFindAttribute(response, "job-presets-supported",
-                              IPP_TAG_BEGIN_COLLECTION)) != NULL) {
-    for (i = 0, count = ippGetCount(attr); i < count; i ++) {
-      ipp_t    *preset = ippGetCollection(attr, i); /* Preset collection */
-      const char *preset_name =         /* Preset name */
+                              IPP_TAG_BEGIN_COLLECTION)) != NULL)
+  {
+    for (i = 0, count = ippGetCount(attr); i < count; i ++)
+    {
+      ipp_t     *preset = ippGetCollection(attr, i); // Preset collection
+      const char *preset_name =         // Preset name
        ippGetString(ippFindAttribute(preset,
                                      "preset-name", IPP_TAG_ZERO), 0, NULL),
-                *localized_name;       /* Localized preset name */
-      ipp_attribute_t *member;         /* Member attribute in preset */
-      const char *member_name;         /* Member attribute name */
-      char       member_value[256];    /* Member attribute value */
+                *localized_name;       // Localized preset name
+      ipp_attribute_t *member;         // Member attribute in preset
+      const char *member_name;         // Member attribute name
+      char       member_value[256];    // Member attribute value
 
       if (!preset || !preset_name)
         continue;
@@ -2257,22 +2404,27 @@ ppdCreatePPDFromIPP2(char         *buffer,          /* I - Filename buffer */
                       localized_name);
 
       for (member = ippFirstAttribute(preset); member;
-          member = ippNextAttribute(preset)) {
+          member = ippNextAttribute(preset))
+      {
         member_name = ippGetName(member);
 
         if (!member_name || !strcmp(member_name, "preset-name"))
           continue;
 
-        if (!strcmp(member_name, "finishings")) {
-         for (i = 0, count = ippGetCount(member); i < count; i ++) {
-           const char *option = NULL;  /* PPD option name */
+        if (!strcmp(member_name, "finishings"))
+       {
+         for (i = 0, count = ippGetCount(member); i < count; i ++)
+         {
+           const char *option = NULL;  // PPD option name
 
            keyword = ippEnumString("finishings", ippGetInteger(member, i));
 
-           if (!strcmp(keyword, "booklet-maker")) {
+           if (!strcmp(keyword, "booklet-maker"))
+           {
              option  = "Booklet";
              keyword = "True";
-           } else if (!strncmp(keyword, "fold-", 5))
+           }
+           else if (!strncmp(keyword, "fold-", 5))
              option = "FoldType";
            else if (!strncmp(keyword, "punch-", 6))
              option = "PunchMedia";
@@ -2285,10 +2437,13 @@ ppdCreatePPDFromIPP2(char         *buffer,          /* I - Filename buffer */
            if (option && keyword)
              cupsFilePrintf(fp, "*%s %s\n", option, keyword);
          }
-        } else if (!strcmp(member_name, "finishings-col")) {
-          ipp_t *fin_col;              /* finishings-col value */
+        }
+       else if (!strcmp(member_name, "finishings-col"))
+       {
+          ipp_t *fin_col;              // finishings-col value
 
-          for (i = 0, count = ippGetCount(member); i < count; i ++) {
+          for (i = 0, count = ippGetCount(member); i < count; i ++)
+         {
             fin_col = ippGetCollection(member, i);
 
             if ((keyword =
@@ -2297,22 +2452,27 @@ ppdCreatePPDFromIPP2(char         *buffer,          /* I - Filename buffer */
                                               IPP_TAG_ZERO), 0, NULL)) != NULL)
               cupsFilePrintf(fp, "*cupsFinishingTemplate %s\n", keyword);
           }
-        } else if (!strcmp(member_name, "media")) {
-         /*
-          * Map media to PageSize...
-          */
+        }
+       else if (!strcmp(member_name, "media"))
+       {
+         //
+          // Map media to PageSize...
+         //
 
           if ((pwg = pwgMediaForPWG(ippGetString(member, 0, NULL))) != NULL &&
              pwg->ppd)
             cupsFilePrintf(fp, "*PageSize %s\n", pwg->ppd);
-        } else if (!strcmp(member_name, "media-col")) {
+        }
+       else if (!strcmp(member_name, "media-col"))
+       {
           media_col = ippGetCollection(member, 0);
 
           if ((media_size =
               ippGetCollection(ippFindAttribute(media_col,
                                                 "media-size",
                                                 IPP_TAG_BEGIN_COLLECTION),
-                               0)) != NULL) {
+                               0)) != NULL)
+         {
             x_dim = ippFindAttribute(media_size, "x-dimension",
                                     IPP_TAG_INTEGER);
             y_dim = ippFindAttribute(media_size, "y-dimension",
@@ -2326,35 +2486,43 @@ ppdCreatePPDFromIPP2(char         *buffer,          /* I - Filename buffer */
           if ((keyword = ippGetString(ippFindAttribute(media_col,
                                                       "media-source",
                                                       IPP_TAG_ZERO), 0,
-                                     NULL)) != NULL) {
+                                     NULL)) != NULL)
+         {
             ppdPwgPpdizeName(keyword, ppdname, sizeof(ppdname));
             cupsFilePrintf(fp, "*InputSlot %s\n", keyword);
          }
 
           if ((keyword = ippGetString(ippFindAttribute(media_col, "media-type",
                                                       IPP_TAG_ZERO), 0,
-                                     NULL)) != NULL) {
+                                     NULL)) != NULL)
+         {
             ppdPwgPpdizeName(keyword, ppdname, sizeof(ppdname));
             cupsFilePrintf(fp, "*MediaType %s\n", keyword);
          }
-        } else if (!strcmp(member_name, "print-quality")) {
-        /*
-         * Map print-quality to cupsPrintQuality...
-         */
+        }
+       else if (!strcmp(member_name, "print-quality"))
+       {
+         //
+         // Map print-quality to cupsPrintQuality...
+         //
 
           int qval = ippGetInteger(member, 0);
-                                       /* print-quality value */
+                                       // print-quality value
          static const char * const qualities[] = { "Draft", "Normal", "High" };
-                                       /* cupsPrintQuality values */
+                                       // cupsPrintQuality values
 
           if (qval >= IPP_QUALITY_DRAFT && qval <= IPP_QUALITY_HIGH)
             cupsFilePrintf(fp, "*cupsPrintQuality %s\n",
                           qualities[qval - IPP_QUALITY_DRAFT]);
-        } else if (!strcmp(member_name, "output-bin")) {
+        }
+       else if (!strcmp(member_name, "output-bin"))
+       {
           ppdPwgPpdizeName(ippGetString(member, 0, NULL), ppdname,
                           sizeof(ppdname));
           cupsFilePrintf(fp, "*OutputBin %s\n", ppdname);
-        } else if (!strcmp(member_name, "sides")) {
+        }
+       else if (!strcmp(member_name, "sides"))
+       {
           keyword = ippGetString(member, 0, NULL);
           if (keyword && !strcmp(keyword, "one-sided"))
             cupsFilePuts(fp, "*Duplex None\n");
@@ -2362,10 +2530,12 @@ ppdCreatePPDFromIPP2(char         *buffer,          /* I - Filename buffer */
            cupsFilePuts(fp, "*Duplex DuplexNoTumble\n");
          else if (keyword && !strcmp(keyword, "two-sided-short-edge"))
            cupsFilePuts(fp, "*Duplex DuplexTumble\n");
-        } else {
-         /*
-          * Add attribute name and value as-is...
-          */
+        }
+       else
+       {
+         //
+          // Add attribute name and value as-is...
+         //
 
           ippAttributeString(member, member_value, sizeof(member_value));
           cupsFilePrintf(fp, "*%s %s\n", member_name, member_value);
@@ -2376,20 +2546,21 @@ ppdCreatePPDFromIPP2(char         *buffer,          /* I - Filename buffer */
     }
   }
 
- /*
-  * constraints
-  */
-  if (conflicts != NULL) {
+  //
+  // constraints
+  //
+
+  if (conflicts != NULL)
+  {
     char* constraint;
     for (constraint = (char *)cupsArrayFirst(conflicts); constraint;
-         constraint = (char *)cupsArrayNext(conflicts)) {
+         constraint = (char *)cupsArrayNext(conflicts))
       cupsFilePrintf(fp, "%s", constraint);
-    }
   }
 
- /*
-  * Close up and return...
-  */
+  //
+  // Clean up and return...
+  //
 
   free(common_def);
   free(min_res);
@@ -2413,9 +2584,9 @@ ppdCreatePPDFromIPP2(char         *buffer,          /* I - Filename buffer */
 
   return (buffer);
 
- /*
-  * If we get here then there was a problem creating the PPD...
-  */
+  //
+  // If we get here then there was a problem creating the PPD...
+  //
 
  bad_ppd:
 
index 51d81d019d0e8b6dbe64a4e6ec20249c1b59193a..90f564c6d1b500de1ce9f1a0c8372610a5a38b34 100644 (file)
@@ -1,18 +1,18 @@
-/*
- * PPD file routines for libppd.
- *
- * Copyright © 2007-2019 by Apple Inc.
- * Copyright © 1997-2007 by Easy Software Products, all rights reserved.
- *
- * Licensed under Apache License v2.0.  See the file "LICENSE" for more
- * information.
- *
- * PostScript is a trademark of Adobe Systems, Inc.
- */
-
-/*
- * Include necessary headers.
- */
+//
+// PPD options <-> IPP attributes routines for libppd.
+//
+// Copyright © 2007-2019 by Apple Inc.
+// Copyright © 1997-2007 by Easy Software Products, all rights reserved.
+//
+// Licensed under Apache License v2.0.  See the file "LICENSE" for more
+// information.
+//
+// PostScript is a trademark of Adobe Systems, Inc.
+//
+
+//
+// Include necessary headers.
+//
 
 #include "ppd.h"
 #include "debug-internal.h"
 #include <errno.h>
 
 
-/*
- * Local functions...
- */
+//
+// Local functions...
+//
 
-static ipp_t           *create_media_col(const char *media, const char *source, const char *type, int width, int length, int bottom, int left, int right, int top);
+static ipp_t           *create_media_col(const char *media, const char *source,
+                                         const char *type, int width,
+                                         int length, int bottom, int left,
+                                         int right, int top);
 static ipp_t           *create_media_size(int width, int length);
-static ipp_t           *create_media_size_ranges(int min_width, int min_length, int max_width, int max_length);
-
-
-/*
- * 'ppdGetOptions()' - Get the PPD options corresponding to the IPP Job Template
- *                     attributes for a printer with given PPD and given
- *                     printer attributes (generated by ppdLoadAttributes()).
- */
-
-int                                    /* O - Number of options */
-ppdGetOptions(cups_option_t **options, /* O - Options */
-             ipp_t *printer_attrs,     /* I - Printer attributes, from
-                                              ppdLoadAttributes() */
-             ipp_t *job_attrs,         /* I - Job attributes */
-             ppd_file_t *ppd)          /* I - PPD file data */
+static ipp_t           *create_media_size_ranges(int min_width, int min_length,
+                                                 int max_width,
+                                                 int max_length);
+
+
+//
+// 'ppdGetOptions()' - Get the PPD options corresponding to the IPP Job Template
+//                     attributes for a printer with given PPD and given
+//                     printer attributes (generated by ppdLoadAttributes()).
+//
+
+int                                    // O - Number of options
+ppdGetOptions(cups_option_t **options, // O - Options
+             ipp_t *printer_attrs,     // I - Printer attributes, from
+                                       //     ppdLoadAttributes()
+             ipp_t *job_attrs,         // I - Job attributes
+             ppd_file_t *ppd)          // I - PPD file data
 {
-  ppd_cache_t  *ppd_cache;             /* IPP to PPD cache data */
-  int          num_options = 0;        /* Number of options */
-  ipp_attribute_t      *attr;          /* Job attribute */
-  char         valstr[8192];           /* Attribute value string */
-  const char   *value;                 /* Option value */
-  pwg_media_t  *media = NULL;          /* Media mapping */
-  int          num_media_col = 0;      /* Number of media-col values */
-  cups_option_t        *media_col = NULL;      /* media-col values */
-  const char   *choice;                /* PPD choice */
+  ppd_cache_t  *ppd_cache;             // IPP to PPD cache data
+  int          num_options = 0;        // Number of options
+  ipp_attribute_t      *attr;          // Job attribute
+  char         valstr[8192];           // Attribute value string
+  const char   *value;                 // Option value
+  pwg_media_t  *media = NULL;          // Media mapping
+  int          num_media_col = 0;      // Number of media-col values
+  cups_option_t        *media_col = NULL;      // media-col values
+  const char   *choice;                // PPD choice
 
 
- /*
-  * No options to start...
-  */
+  //
+  // No options to start...
+  //
 
   *options = NULL;
 
- /*
-  * Media...
-  */
+  //
+  // Media...
+  //
 
   if ((attr = ippFindAttribute(job_attrs, "media", IPP_TAG_ZERO)) == NULL)
     if ((attr = ippFindAttribute(job_attrs, "media-col", IPP_TAG_ZERO)) == NULL)
@@ -77,17 +82,17 @@ ppdGetOptions(cups_option_t **options,      /* O - Options */
 
     if (*value == '{')
     {
-     /*
-      * media-col value...
-      */
+      //
+      // media-col value...
+      //
 
       num_media_col = cupsParseOptions(value, 0, &media_col);
     }
     else
     {
-     /*
-      * media value - map to media-col.media-size-name...
-      */
+      //
+      // media value - map to media-col.media-size-name...
+      //
 
       num_media_col = cupsAddOption("media-size-name", value, 0, &media_col);
     }
@@ -101,14 +106,17 @@ ppdGetOptions(cups_option_t **options,    /* O - Options */
   else if ((value = cupsGetOption("media-size", num_media_col, media_col))
           != NULL)
   {
-    int                num_media_size;         /* Number of media-size values */
-    cups_option_t *media_size;         /* media-size values */
-    const char *x_dimension,           /* x-dimension value */
-               *y_dimension;           /* y-dimension value */
+    int                num_media_size;         // Number of media-size values
+    cups_option_t *media_size;         // media-size values
+    const char *x_dimension,           // x-dimension value
+               *y_dimension;           // y-dimension value
 
     num_media_size = cupsParseOptions(value, 0, &media_size);
 
-    if ((x_dimension = cupsGetOption("x-dimension", num_media_size, media_size)) != NULL && (y_dimension = cupsGetOption("y-dimension", num_media_size, media_size)) != NULL)
+    if ((x_dimension = cupsGetOption("x-dimension",
+                                    num_media_size, media_size)) != NULL &&
+       (y_dimension = cupsGetOption("y-dimension",
+                                    num_media_size, media_size)) != NULL)
       media = pwgMediaForSize(atoi(x_dimension), atoi(y_dimension));
 
     cupsFreeOptions(num_media_size, media_size);
@@ -117,9 +125,9 @@ ppdGetOptions(cups_option_t **options,      /* O - Options */
   if (media)
     num_options = cupsAddOption("PageSize", media->ppd, num_options, options);
 
- /*
-  * Generate PPD's corresponding IPP <-> PPD cache data...
-  */
+  //
+  // Generate PPD's corresponding IPP <-> PPD cache data...
+  //
 
   if (ppd)
   {
@@ -131,8 +139,8 @@ ppdGetOptions(cups_option_t **options,      /* O - Options */
     else
       ppd_cache = ppd->cache;
 
-    /* TODO: Fix me - values are names, not numbers... Also need to support
-       finishings-col */
+    // TODO: Fix me - values are names, not numbers... Also need to support
+    // finishings-col
     if ((attr = ippFindAttribute(job_attrs, "finishings", IPP_TAG_ZERO))
        == NULL)
       attr = ippFindAttribute(printer_attrs, "finishings-default",
@@ -140,22 +148,26 @@ ppdGetOptions(cups_option_t **options,    /* O - Options */
 
     if (attr)
     {
-      char     *ptr;                   /* Pointer into value */
-      int      fin;                    /* Current value */
+      char     *ptr;                   // Pointer into value
+      int      fin;                    // Current value
 
       ippAttributeString(attr, valstr, sizeof(valstr));
       value = valstr;
 
       for (fin = strtol(value, &ptr, 10); fin > 0; fin = strtol(ptr + 1, &ptr, 10))
       {
-       num_options = ppdCacheGetFinishingOptions(ppd_cache, NULL, (ipp_finishings_t)fin, num_options, options);
+       num_options =
+         ppdCacheGetFinishingOptions(ppd_cache, NULL,
+                                     (ipp_finishings_t)fin,
+                                     num_options, options);
 
        if (*ptr != ',')
          break;
       }
     }
 
-    if ((value = cupsGetOption("media-source", num_media_col, media_col)) != NULL)
+    if ((value = cupsGetOption("media-source",
+                              num_media_col, media_col)) != NULL)
     {
       if ((choice = ppdCacheGetInputSlot(ppd_cache, NULL, value)) != NULL)
        num_options = cupsAddOption("InputSlot", choice, num_options, options);
@@ -189,11 +201,19 @@ ppdGetOptions(cups_option_t **options,    /* O - Options */
       ippAttributeString(attr, valstr, sizeof(valstr));
       value = valstr;
       if (!strcmp(value, "one-sided") && ppd_cache->sides_1sided)
-       num_options = cupsAddOption(ppd_cache->sides_option, ppd_cache->sides_1sided, num_options, options);
-      else if (!strcmp(value, "two-sided-long-edge") && ppd_cache->sides_2sided_long)
-       num_options = cupsAddOption(ppd_cache->sides_option, ppd_cache->sides_2sided_long, num_options, options);
-      else if (!strcmp(value, "two-sided-short-edge") && ppd_cache->sides_2sided_short)
-       num_options = cupsAddOption(ppd_cache->sides_option, ppd_cache->sides_2sided_short, num_options, options);
+       num_options = cupsAddOption(ppd_cache->sides_option,
+                                   ppd_cache->sides_1sided,
+                                   num_options, options);
+      else if (!strcmp(value, "two-sided-long-edge") &&
+              ppd_cache->sides_2sided_long)
+       num_options = cupsAddOption(ppd_cache->sides_option,
+                                   ppd_cache->sides_2sided_long,
+                                   num_options, options);
+      else if (!strcmp(value, "two-sided-short-edge") &&
+              ppd_cache->sides_2sided_short)
+       num_options = cupsAddOption(ppd_cache->sides_option,
+                                   ppd_cache->sides_2sided_short,
+                                   num_options, options);
     }
 
     if ((attr = ippFindAttribute(job_attrs, "print-quality", IPP_TAG_ZERO))
@@ -203,11 +223,12 @@ ppdGetOptions(cups_option_t **options,    /* O - Options */
 
     if (attr)
     {
-      int              i;              /* Looping var */
-      int              pq;             /* Print quality (0-2) */
-      int              pcm = 1;        /* Print color model (0 = mono, 1 = color) */
-      int              num_presets;    /* Number of presets */
-      cups_option_t    *presets;       /* Presets */
+      int              i;              // Looping var
+      int              pq;             // Print quality (0-2)
+      int              pcm = 1;        // Print color model
+                                        // (0 = mono, 1 = color)
+      int              num_presets;    // Number of presets
+      cups_option_t    *presets;       // Presets
 
       ippAttributeString(attr, valstr, sizeof(valstr));
       value = valstr;
@@ -235,12 +256,13 @@ ppdGetOptions(cups_option_t **options,    /* O - Options */
       presets     = ppd_cache->presets[pcm][pq];
 
       for (i = 0; i < num_presets; i ++)
-       num_options = cupsAddOption(presets[i].name, presets[i].value, num_options, options);
+       num_options = cupsAddOption(presets[i].name, presets[i].value,
+                                   num_options, options);
     }
 
-   /*
-    * Mark the PPD with the options...
-    */
+    //
+    // Mark the PPD with the options...
+    //
 
     ppdMarkDefaults(ppd);
     ppdMarkOptions(ppd, num_options, *options);
@@ -252,58 +274,59 @@ ppdGetOptions(cups_option_t **options,    /* O - Options */
 }
 
 
-/*
- * 'ppdLoadAttributes()' - Load IPP attributes from a PPD file to
- *                         create printer IPP attriutes which describe
- *                         the capabilities of the printer. Note that
- *                         this is for telling filters and drivers how
- *                         to print a job on the printer and NOT for a
- *                         PPD retro-fitting Printer Application (or
- *                         any other PPD-supporting IPP print server)
- *                         to answer a get-printer-attributes IPP
- *                         request.
- */
-
-ipp_t *                                        /* O - IPP attributes or `NULL`
-                                              on error */
+//
+// 'ppdLoadAttributes()' - Load IPP attributes from a PPD file to
+//                         create printer IPP attriutes which describe
+//                         the capabilities of the printer. Note that
+//                         this is for telling filters and drivers how
+//                         to print a job on the printer and NOT for a
+//                         PPD retro-fitting Printer Application (or
+//                         any other PPD-supporting IPP print server)
+//                         to answer a get-printer-attributes IPP
+//                         request.
+//
+
+ipp_t *                                        // O - IPP attributes or `NULL`
+                                       //     on error
 ppdLoadAttributes(
-    ppd_file_t   *ppd)                 /* I - PPD file data */
+    ppd_file_t   *ppd)                 // I - PPD file data
 {
-  int          i, j;                   /* Looping vars */
+  int          i, j;                   // Looping vars
   char          *ptr;
-  cups_array_t  *docformats;           /* document-format-supported
-                                          values */
-  ipp_t                *attrs;                 /* Attributes */
-  ipp_attribute_t *attr;               /* Current attribute */
-  ipp_attribute_t *aux_attr;           /* Auxiliary attribute */
-  ipp_t                *col;                   /* Current collection value */
-  ppd_attr_t   *ppd_attr;              /* PPD attribute */
-  ppd_option_t *ppd_option;            /* PPD option */
-  ppd_choice_t *ppd_choice;            /* PPD choice */
-  ppd_size_t   *ppd_size;              /* Default PPD size */
-  pwg_size_t   *pwg_size,              /* Current PWG size */
-               *default_size = NULL;   /* Default PWG size */
-  const char   *default_source = NULL, /* Default media source */
-               *default_type = NULL,   /* Default media type */
-               *default_output_bin = NULL,     /* Default output bin */
-               *default_output_order = NULL;   /* Default output order */
-  pwg_map_t    *pwg_map;               /* Mapping from PWG to PPD keywords */
-  ppd_cache_t  *pc;                    /* PPD cache */
-  ppd_pwg_finishings_t *finishings;    /* Current finishings value */
-  const char   *template;              /* Current finishings-template value */
-  int          num_margins;            /* Number of media-xxx-margin-supported values */
-  int          margins[10];            /* media-xxx-margin-supported values */
-  int          xres = 0,               /* Default horizontal resolution */
-               yres = 0;               /* Default vertical resolution */
+  cups_array_t  *docformats;           // document-format-supported
+                                       // values
+  ipp_t                *attrs;                 // Attributes
+  ipp_attribute_t *attr;               // Current attribute
+  ipp_attribute_t *aux_attr;           // Auxiliary attribute
+  ipp_t                *col;                   // Current collection value
+  ppd_attr_t   *ppd_attr;              // PPD attribute
+  ppd_option_t *ppd_option;            // PPD option
+  ppd_choice_t *ppd_choice;            // PPD choice
+  ppd_size_t   *ppd_size;              // Default PPD size
+  pwg_size_t   *pwg_size,              // Current PWG size
+               *default_size = NULL;   // Default PWG size
+  const char   *default_source = NULL, // Default media source
+               *default_type = NULL,   // Default media type
+               *default_output_bin = NULL,     // Default output bin
+               *default_output_order = NULL;   // Default output order
+  pwg_map_t    *pwg_map;               // Mapping from PWG to PPD keywords
+  ppd_cache_t  *pc;                    // PPD cache
+  ppd_pwg_finishings_t *finishings;    // Current finishings value
+  const char   *template;              // Current finishings-template value
+  int          num_margins;            // Number of media-xxx-margin-supported
+                                       // values
+  int          margins[10];            // media-xxx-margin-supported values
+  int          xres = 0,               // Default horizontal resolution
+               yres = 0;               // Default vertical resolution
   int           is_texttotext;
-  int          num_items;              /* Number of IPP attribute values */
-  const char   *items[20];             /* IPP attribute values */
-  char         item_buf[64];           /* RS value */
+  int          num_items;              // Number of IPP attribute values
+  const char   *items[20];             // IPP attribute values
+  char         item_buf[64];           // RS value
   int           res_x[20], res_y[20], int_item[20];
   char          *val,
                 *def_output_bin = NULL,
                 buf[1024],
-                cmd[256],               /* Device ID CMD: string */
+                cmd[256],               // Device ID CMD: string
                 *cmdptr;
   int           def_found,
                 order,
@@ -311,7 +334,8 @@ ppdLoadAttributes(
                 have_custom_size = 0;
   cups_page_header2_t header;
   static const char * const pdls[][2] =
-  {                                     /* MIME media type to command set mapping */
+  {                                     // MIME media type to command set
+                                       // mapping
     { "application/postscript", "POSTSCRIPT,PS" },
     { "application/vnd.cups-postscript", "POSTSCRIPT,PS" },
     { "application/pdf", "PDF" },
@@ -328,14 +352,15 @@ ppdLoadAttributes(
     { "image/tiff", "TIFF" }
   };
   static const int     orientation_requested_supported[4] =
-  {                                    /* orientation-requested-supported values */
+  {                                    // orientation-requested-supported
+                                       // values
     IPP_ORIENT_PORTRAIT,
     IPP_ORIENT_LANDSCAPE,
     IPP_ORIENT_REVERSE_LANDSCAPE,
     IPP_ORIENT_REVERSE_PORTRAIT
   };
   static const char * const overrides_supported[] =
-  {                                    /* overrides-supported */
+  {                                    // overrides-supported
     "document-numbers",
     "media",
     "media-col",
@@ -343,23 +368,24 @@ ppdLoadAttributes(
     "pages"
   };
   static const char * const print_color_mode_supported[] =
-  {                                    /* print-color-mode-supported values */
+  {                                    // print-color-mode-supported values
     "monochrome"
   };
   static const char * const print_color_mode_supported_color[] =
-  {                                    /* print-color-mode-supported values */
+  {                                    // print-color-mode-supported values
     "auto",
     "color",
     "monochrome"
   };
   static const int     print_quality_supported[] =
-  {                                    /* print-quality-supported values */
+  {                                    // print-quality-supported values
     IPP_QUALITY_DRAFT,
     IPP_QUALITY_NORMAL,
     IPP_QUALITY_HIGH
   };
   static const char * const print_content_optimize_supported[] =
-  {                                    /* print-content-optimize-supported values */
+  {                                    // print-content-optimize-supported
+                                       // values
     "auto",
     "text",
     "graphic",
@@ -367,16 +393,16 @@ ppdLoadAttributes(
     "photo"
   };
   static const char * const sides_supported[] =
-  {                                    /* sides-supported values */
+  {                                    // sides-supported values
     "one-sided",
     "two-sided-long-edge",
     "two-sided-short-edge"
   };
 
 
- /*
-  * Open the PPD file...
-  */
+  //
+  // Open the PPD file...
+  //
 
   if (ppd == NULL)
     return (NULL);
@@ -393,9 +419,9 @@ ppdLoadAttributes(
 
   if ((ppd_size = ppdPageSize(ppd, NULL)) != NULL)
   {
-   /*
-    * Look up default size...
-    */
+    //
+    // Look up default size...
+    //
 
     for (i = 0, pwg_size = pc->sizes; i < pc->num_sizes; i ++, pwg_size ++)
     {
@@ -409,13 +435,14 @@ ppdLoadAttributes(
 
   if (!default_size)
   {
-   /*
-    * Default to A4 or Letter...
-    */
+    //
+    // Default to A4 or Letter...
+    //
 
     for (i = 0, pwg_size = pc->sizes; i < pc->num_sizes; i ++, pwg_size ++)
     {
-      if (!strcmp(pwg_size->map.ppd, "Letter") || !strcmp(pwg_size->map.ppd, "A4"))
+      if (!strcmp(pwg_size->map.ppd, "Letter") ||
+         !strcmp(pwg_size->map.ppd, "A4"))
       {
         default_size = pwg_size;
         break;
@@ -423,7 +450,7 @@ ppdLoadAttributes(
     }
 
     if (!default_size)
-      default_size = pc->sizes;                /* Last resort: first size */
+      default_size = pc->sizes;                // Last resort: first size
   }
 
   if ((ppd_choice = ppdFindMarkedChoice(ppd, "InputSlot")) != NULL)
@@ -448,11 +475,11 @@ ppdLoadAttributes(
   if (default_output_order == NULL)
     default_output_order = "Normal";
 
- /*
-  * Data formats which the printer understands, if the PPD specifies
-  * a driver in a "*cupsFilter(2): ..." line, we add the input format
-  * of the driver, as this is what our filter need to produce.
-  */
+  //
+  // Data formats which the printer understands, if the PPD specifies
+  // a driver in a "*cupsFilter(2): ..." line, we add the input format
+  // of the driver, as this is what our filter need to produce.
+  //
 
   docformats = cupsArrayNew3((cups_array_func_t)strcmp, NULL, NULL, 0, NULL,
                             (cups_afree_func_t)free);
@@ -466,26 +493,26 @@ ppdLoadAttributes(
         filter;
         filter = (char *)cupsArrayNext(pc->filters))
     {
-      /* String of the "*cupsfilter:" or "*cupsfilter2:" line */
+      // String of the "*cupsfilter:" or "*cupsfilter2:" line
       strncpy(buf, filter, sizeof(buf) - 1);
 
-      /* Do not count in "comandto..." filters */
+      // Do not count in "comandto..." filters
       if (strstr(buf, " commandto"))
        continue;
 
-      /* Is the PPD file using the "texttotext" filter? */
+      // Is the PPD file using the "texttotext" filter?
       if (strcmp(buf + strlen(buf) - 10, "texttotext") == 0)
        is_texttotext = 1;
 
-      /* Separate the first word */
+      // Separate the first word
       ptr = buf;
       while (*ptr && !isspace(*ptr)) ptr ++;
       if (*ptr)
        *ptr = '\0';
 
-      /* Check whether the second word is not the cost value, then we have
-        a "*cupsFilter2:* line and the second word is the printer's input
-        format */
+      // Check whether the second word is not the cost value, then we have
+      // a "*cupsFilter2:* line and the second word is the printer's input
+      // format
       ptr ++;
       while (*ptr && isspace(*ptr)) ptr ++;
       if (!isdigit(*ptr))
@@ -497,20 +524,20 @@ ppdLoadAttributes(
          *ptr = '\0';
       }
 
-      /* Add it to the list of output formats */
+      // Add it to the list of output formats
       cupsArrayAdd(docformats, strdup(buf));
 
-      /* Add it to the CMD: string for the device ID */
+      // Add it to the CMD: string for the device ID
       if (!ppdFindAttr(ppd, "1284DeviceId", NULL))
       {
-       /* See if it is a known MIME media type and map to the corresponding
-          1284 command-set name... */
+       // See if it is a known MIME media type and map to the corresponding
+       // 1284 command-set name...
        for (i = 0; i < (sizeof(pdls) / sizeof(pdls[0])); i ++)
        {
          if (!strcasecmp(buf, pdls[i][0]) &&
              strlen(pdls[i][1]) < sizeof(cmd) - (size_t)(cmdptr - cmd) - 3)
          {
-           /* MIME media type matches, append this CMD value... */
+           // MIME media type matches, append this CMD value...
            if (cmdptr > cmd + 4)
              *cmdptr++ = ',';
            strcpy(cmdptr, pdls[i][1]);
@@ -534,17 +561,17 @@ ppdLoadAttributes(
       strcpy(cmd, "CMD:POSTSCRIPT,PS;");
   }
 
- /*
-  * Create the attributes...
-  */
+  //
+  // Create the attributes...
+  //
 
   attrs = ippNew();
 
- /*
-  * Properties of supported Raster formats: Convert from strings
-  * in the PPD files (from driverless PPD auto-generator) into
-  * printer IPP attributes
-  */
+  //
+  // Properties of supported Raster formats: Convert from strings
+  // in the PPD files (from driverless PPD auto-generator) into
+  // printer IPP attributes
+  //
 
   for (i = 0; i < ppd->num_attrs; i ++)
   {
@@ -556,9 +583,9 @@ ppdLoadAttributes(
        (cupsArrayFind(docformats, (void *)"application/PCLm") &&
         strncasecmp(ppd_attr->name, "cupsPclm", 8) == 0))
     {
-      /* Convert PPD-style names into IPP-style names */
+      // Convert PPD-style names into IPP-style names
       ppdPwgUnppdizeName(ppd_attr->name + 4, item_buf, sizeof(item_buf), NULL);
-      /* Make array from comma-separated list */
+      // Make array from comma-separated list
       strncpy(buf, ppd_attr->value, sizeof(buf) - 1);
       num_items = 0;
       char *p = buf;
@@ -570,12 +597,12 @@ ppdLoadAttributes(
          *p = '\0';
          p ++;
        }
-       /* Default resolution via urf-supported */
+       // Default resolution via urf-supported
        if (!strcmp(item_buf, "urf-supported") &&
-           (xres == 0 && yres == 0) &&/* Default resolution not found in
-                                         other raster-format-related PPD
-                                         attribute yet, use first resolution in
-                                         urf-supported */
+           (xres == 0 && yres == 0) &&// Default resolution not found in
+                                      // other raster-format-related PPD
+                                      // attribute yet, use first resolution in
+                                      // urf-supported
            items[num_items - 1][0] == 'R' && items[num_items - 1][1] == 'S')
          xres = yres = atoi(items[num_items - 1] + 2);
       }
@@ -584,49 +611,53 @@ ppdLoadAttributes(
          strncasecmp(items[0] + strlen(items[0]) - 3, "dpi", 3) == 0 &&
          isdigit(*(items[0] + strlen(items[0]) - 4)))
       {
-       /* Resolutions */
+       // Resolutions
        for (j = 0; j < num_items; j ++)
          if (sscanf(items[j], "%dx%d", &res_x[j], &res_y[j]) == 1)
            res_y[j] = res_x[j];
-       ippAddResolutions(attrs, IPP_TAG_PRINTER, item_buf, num_items, IPP_RES_PER_INCH, res_x, res_y);
-       /* Default resolution? */
-       if ((xres == 0 && yres == 0) ||  /* Take first in list if there is no
-                                           separate PPD attribute providing a
-                                           default resolution */
-           strstr(item_buf, "default")) /* PPD attribute with default
-                                           resolution, take it, even if we
-                                           already had the list from which we
-                                           have taken the first item. */
+       ippAddResolutions(attrs, IPP_TAG_PRINTER, item_buf, num_items,
+                         IPP_RES_PER_INCH, res_x, res_y);
+       // Default resolution?
+       if ((xres == 0 && yres == 0) ||  // Take first in list if there is no
+                                        // separate PPD attribute providing a
+                                        // default resolution
+           strstr(item_buf, "default")) // PPD attribute with default
+                                        // resolution, take it, even if we
+                                        // already had the list from which we
+                                        // have taken the first item.
        {
          xres = res_x[0];
          yres = res_y[0];
        }
       }
       else if (strlen(items[0]) > 0 &&
-              ((int)(strtol(items[0], &p, 10) * 0) || (errno == 0 && *p == '\0')))
+              ((int)(strtol(items[0], &p, 10) * 0) ||
+               (errno == 0 && *p == '\0')))
       {
-       /* Integer number(s) */
+       // Integer number(s)
        for (j = 0; j < num_items; j ++)
          int_item[j] = (int)strtol(items[j], NULL, 10);
-       ippAddIntegers(attrs, IPP_TAG_PRINTER, IPP_TAG_INTEGER, item_buf, num_items, int_item);
+       ippAddIntegers(attrs, IPP_TAG_PRINTER, IPP_TAG_INTEGER, item_buf,
+                      num_items, int_item);
       }
       else
-       /* General */
-       ippAddStrings(attrs, IPP_TAG_PRINTER, IPP_TAG_KEYWORD, item_buf, num_items, NULL, items);
+       // General
+       ippAddStrings(attrs, IPP_TAG_PRINTER, IPP_TAG_KEYWORD, item_buf,
+                     num_items, NULL, items);
     }
   }
 
- /*
-  * Resolution
-  */
+  //
+  // Resolution
+  //
 
   if (xres == 0 && yres == 0)
   {
-    /* Ignore error exits of ppdRasterInterpretPPD(), if it found a resolution
-       setting before erroring it is OK for us */
+    // Ignore error exits of ppdRasterInterpretPPD(), if it found a resolution
+    // setting before erroring it is OK for us
     ppdRasterInterpretPPD(&header, ppd, 0, NULL, NULL);
-    /* 100 dpi is default, this means that if we have 100 dpi here this
-       method failed to find the printing resolution */
+    // 100 dpi is default, this means that if we have 100 dpi here this
+    // method failed to find the printing resolution
     buf[0] = '\0';
     if (header.HWResolution[0] != 100 || header.HWResolution[1] != 100)
     {
@@ -638,12 +669,12 @@ ppdLoadAttributes(
     else if ((ppd_attr = ppdFindAttr(ppd, "DefaultResolution", NULL)) != NULL)
       strncpy(buf, ppd_attr->value, sizeof(buf) - 1);
     else
-      /* Use default of 300dpi... */
+      // Use default of 300dpi...
       xres = yres = 300;
     buf[sizeof(buf) - 1] = '\0';
     if (buf[0])
     {
-      /* Use the marked resolution or the default resolution in the PPD... */
+      // Use the marked resolution or the default resolution in the PPD...
       if ((i = sscanf(buf, "%dx%d", &xres, &yres)) == 1)
        yres = xres;
       else if (i <= 0)
@@ -651,20 +682,23 @@ ppdLoadAttributes(
     }
   }
 
-  /* Fax out PPD? */
+  // Fax out PPD?
   if (((ppd_attr = ppdFindAttr(ppd, "cupsFax", NULL)) != NULL &&
        strcasecmp(ppd_attr->value, "True") == 0) ||
       ((ppd_attr = ppdFindAttr(ppd, "cupsIPPFaxOut", NULL)) != NULL &&
        strcasecmp(ppd_attr->value, "True") == 0))
   {
-    ippAddString(attrs, IPP_TAG_PRINTER, IPP_CONST_TAG(IPP_TAG_KEYWORD), "ipp-features-supported", NULL, "faxout");
-    ippAddString(attrs, IPP_TAG_PRINTER, IPP_CONST_TAG(IPP_TAG_URI), "printer-uri-supported", NULL, "ipp://localhost/ipp/faxout");
+    ippAddString(attrs, IPP_TAG_PRINTER, IPP_CONST_TAG(IPP_TAG_KEYWORD),
+                "ipp-features-supported", NULL, "faxout");
+    ippAddString(attrs, IPP_TAG_PRINTER, IPP_CONST_TAG(IPP_TAG_URI),
+                "printer-uri-supported", NULL, "ipp://localhost/ipp/faxout");
   }
   
-  /* color-supported */
-  ippAddBoolean(attrs, IPP_TAG_PRINTER, "color-supported", (char)ppd->color_device);
+  // color-supported
+  ippAddBoolean(attrs, IPP_TAG_PRINTER, "color-supported",
+               (char)ppd->color_device);
 
-  /* copies-default */
+  // copies-default
   if (((ppd_choice = ppdFindMarkedChoice(ppd, "Copies")) == NULL ||
        (i = atoi(ppd_choice->choice)) <= 0) &&
       ((ppd_attr = ppdFindAttr(ppd, "DefaultCopies", NULL)) == NULL ||
@@ -672,80 +706,111 @@ ppdLoadAttributes(
     i = 1;
   ippAddInteger(attrs, IPP_TAG_PRINTER, IPP_TAG_INTEGER, "copies-default", i);
 
-  /* copies-supported */
+  // copies-supported
   ippAddRange(attrs, IPP_TAG_PRINTER, "copies-supported", 1,
              pc->max_copies > 0 ? pc->max_copies : 999);
 
-  /* document-format-supported */
-  attr = ippAddStrings(attrs, IPP_TAG_PRINTER, IPP_TAG_KEYWORD, "document-format-supported", cupsArrayCount(docformats), NULL, NULL);
+  // document-format-supported
+  attr = ippAddStrings(attrs, IPP_TAG_PRINTER, IPP_TAG_KEYWORD,
+                      "document-format-supported",
+                      cupsArrayCount(docformats), NULL, NULL);
   for (ptr = (char *)cupsArrayFirst(docformats), i = 0; ptr;
        ptr = (char *)cupsArrayNext(docformats), i ++)
     ippSetString(attrs, &attr, i, ptr);
 
-  /* finishing-template-supported */
-  attr = ippAddStrings(attrs, IPP_TAG_PRINTER, IPP_TAG_KEYWORD, "finishing-template-supported", cupsArrayCount(pc->templates) + 1, NULL, NULL);
+  // finishing-template-supported
+  attr = ippAddStrings(attrs, IPP_TAG_PRINTER, IPP_TAG_KEYWORD,
+                      "finishing-template-supported",
+                      cupsArrayCount(pc->templates) + 1, NULL, NULL);
   ippSetString(attrs, &attr, 0, "none");
-  for (i = 1, template = (const char *)cupsArrayFirst(pc->templates); template; i ++, template = (const char *)cupsArrayNext(pc->templates))
+  for (i = 1, template = (const char *)cupsArrayFirst(pc->templates);
+       template; i ++, template = (const char *)cupsArrayNext(pc->templates))
     ippSetString(attrs, &attr, i, template);
 
-  /* finishings-col-database */
-  attr = ippAddCollections(attrs, IPP_TAG_PRINTER, "finishings-col-database", cupsArrayCount(pc->templates) + 1, NULL);
+  // finishings-col-database
+  attr = ippAddCollections(attrs, IPP_TAG_PRINTER, "finishings-col-database",
+                          cupsArrayCount(pc->templates) + 1, NULL);
 
   col = ippNew();
-  ippAddString(col, IPP_TAG_PRINTER, IPP_TAG_KEYWORD, "finishing-template", NULL, "none");
+  ippAddString(col, IPP_TAG_PRINTER, IPP_TAG_KEYWORD, "finishing-template",
+              NULL, "none");
   ippSetCollection(attrs, &attr, 0, col);
   ippDelete(col);
 
-  for (i = 1, template = (const char *)cupsArrayFirst(pc->templates); template; i ++, template = (const char *)cupsArrayNext(pc->templates))
+  for (i = 1, template = (const char *)cupsArrayFirst(pc->templates);
+       template; i ++, template = (const char *)cupsArrayNext(pc->templates))
   {
     col = ippNew();
-    ippAddString(col, IPP_TAG_PRINTER, IPP_TAG_KEYWORD, "finishing-template", NULL, template);
+    ippAddString(col, IPP_TAG_PRINTER, IPP_TAG_KEYWORD, "finishing-template",
+                NULL, template);
     ippSetCollection(attrs, &attr, i, col);
     ippDelete(col);
   }
 
-  /* finishings-col-default */
+  // finishings-col-default
   col = ippNew();
-  ippAddString(col, IPP_TAG_PRINTER, IPP_TAG_KEYWORD, "finishing-template", NULL, "none");
+  ippAddString(col, IPP_TAG_PRINTER, IPP_TAG_KEYWORD, "finishing-template",
+              NULL, "none");
   ippAddCollection(attrs, IPP_TAG_PRINTER, "finishings-col-default", col);
   ippDelete(col);
 
-  /* finishings-col-ready */
-  attr = ippAddCollections(attrs, IPP_TAG_PRINTER, "finishings-col-ready", cupsArrayCount(pc->templates) + 1, NULL);
+  // finishings-col-ready
+  attr = ippAddCollections(attrs, IPP_TAG_PRINTER, "finishings-col-ready",
+                          cupsArrayCount(pc->templates) + 1, NULL);
 
   col = ippNew();
-  ippAddString(col, IPP_TAG_PRINTER, IPP_TAG_KEYWORD, "finishing-template", NULL, "none");
+  ippAddString(col, IPP_TAG_PRINTER, IPP_TAG_KEYWORD, "finishing-template",
+              NULL, "none");
   ippSetCollection(attrs, &attr, 0, col);
   ippDelete(col);
 
-  for (i = 1, template = (const char *)cupsArrayFirst(pc->templates); template; i ++, template = (const char *)cupsArrayNext(pc->templates))
+  for (i = 1, template = (const char *)cupsArrayFirst(pc->templates); template;
+       i ++, template = (const char *)cupsArrayNext(pc->templates))
   {
     col = ippNew();
-    ippAddString(col, IPP_TAG_PRINTER, IPP_TAG_KEYWORD, "finishing-template", NULL, template);
+    ippAddString(col, IPP_TAG_PRINTER, IPP_TAG_KEYWORD, "finishing-template",
+                NULL, template);
     ippSetCollection(attrs, &attr, i, col);
     ippDelete(col);
   }
 
-  /* finishings-col-supported */
-  ippAddString(attrs, IPP_TAG_PRINTER, IPP_CONST_TAG(IPP_TAG_KEYWORD), "finishings-col-supported", NULL, "finishing-template");
+  // finishings-col-supported
+  ippAddString(attrs, IPP_TAG_PRINTER, IPP_CONST_TAG(IPP_TAG_KEYWORD),
+              "finishings-col-supported", NULL, "finishing-template");
 
-  /* finishings-default */
-  ippAddInteger(attrs, IPP_TAG_PRINTER, IPP_TAG_ENUM, "finishings-default", IPP_FINISHINGS_NONE);
+  // finishings-default
+  ippAddInteger(attrs, IPP_TAG_PRINTER, IPP_TAG_ENUM, "finishings-default",
+               IPP_FINISHINGS_NONE);
 
-  /* finishings-ready */
-  attr = ippAddIntegers(attrs, IPP_TAG_PRINTER, IPP_TAG_ENUM, "finishings-ready", cupsArrayCount(pc->finishings) + 1, NULL);
+  // finishings-ready
+  attr = ippAddIntegers(attrs, IPP_TAG_PRINTER, IPP_TAG_ENUM,
+                       "finishings-ready",
+                       cupsArrayCount(pc->finishings) + 1, NULL);
   ippSetInteger(attrs, &attr, 0, IPP_FINISHINGS_NONE);
-  for (i = 1, finishings = (ppd_pwg_finishings_t *)cupsArrayFirst(pc->finishings); finishings; i ++, finishings = (ppd_pwg_finishings_t *)cupsArrayNext(pc->finishings))
+  for (i = 1,
+        finishings = (ppd_pwg_finishings_t *)cupsArrayFirst(pc->finishings);
+       finishings;
+       i ++,
+        finishings = (ppd_pwg_finishings_t *)cupsArrayNext(pc->finishings))
     ippSetInteger(attrs, &attr, i, (int)finishings->value);
 
-  /* finishings-supported */
-  attr = ippAddIntegers(attrs, IPP_TAG_PRINTER, IPP_TAG_ENUM, "finishings-supported", cupsArrayCount(pc->finishings) + 1, NULL);
+  // finishings-supported
+  attr = ippAddIntegers(attrs, IPP_TAG_PRINTER, IPP_TAG_ENUM,
+                       "finishings-supported",
+                       cupsArrayCount(pc->finishings) + 1, NULL);
   ippSetInteger(attrs, &attr, 0, IPP_FINISHINGS_NONE);
-  for (i = 1, finishings = (ppd_pwg_finishings_t *)cupsArrayFirst(pc->finishings); finishings; i ++, finishings = (ppd_pwg_finishings_t *)cupsArrayNext(pc->finishings))
+  for (i = 1,
+        finishings = (ppd_pwg_finishings_t *)cupsArrayFirst(pc->finishings);
+       finishings;
+       i ++,
+        finishings = (ppd_pwg_finishings_t *)cupsArrayNext(pc->finishings))
     ippSetInteger(attrs, &attr, i, (int)finishings->value);
 
-  /* media-bottom-margin-supported */
-  for (i = 0, num_margins = 0, pwg_size = pc->sizes; i < pc->num_sizes && num_margins < (int)(sizeof(margins) / sizeof(margins[0])); i ++, pwg_size ++)
+  // media-bottom-margin-supported
+  for (i = 0, num_margins = 0, pwg_size = pc->sizes;
+       i < pc->num_sizes &&
+        num_margins < (int)(sizeof(margins) / sizeof(margins[0]));
+       i ++, pwg_size ++)
   {
     for (j = 0; j < num_margins; j ++)
     {
@@ -771,27 +836,31 @@ ppdLoadAttributes(
     }
   }
 
-  ippAddIntegers(attrs, IPP_TAG_PRINTER, IPP_TAG_INTEGER, "media-bottom-margin-supported", num_margins, margins);
+  ippAddIntegers(attrs, IPP_TAG_PRINTER, IPP_TAG_INTEGER,
+                "media-bottom-margin-supported", num_margins, margins);
 
-  /* landscape-orientation-requested-preferred */
-  if (ppd->landscape < 0)      /* Direction the printer rotates landscape
-                                 (-90) */
+  // landscape-orientation-requested-preferred
+  if (ppd->landscape < 0)      // Direction the printer rotates landscape
+                              // (-90)
   {
-    /* Rotate clockwise (reverse landscape)*/
-    ippAddInteger(attrs, IPP_TAG_PRINTER, IPP_TAG_ENUM, "landscape-orientation-requested-preferred", 5);
+    // Rotate clockwise (reverse landscape)
+    ippAddInteger(attrs, IPP_TAG_PRINTER, IPP_TAG_ENUM,
+                 "landscape-orientation-requested-preferred", 5);
   }
-  else if (ppd->landscape > 0) /* (+90) */
+  else if (ppd->landscape > 0) // (+90)
   {
-    /* Rotate counter-clockwise (landscape) */
-    ippAddInteger(attrs, IPP_TAG_PRINTER, IPP_TAG_ENUM, "landscape-orientation-requested-preferred", 4);
+    // Rotate counter-clockwise (landscape)
+    ippAddInteger(attrs, IPP_TAG_PRINTER, IPP_TAG_ENUM,
+                 "landscape-orientation-requested-preferred", 4);
   }
 
-  /* media-col-database, media-col-default, media-col-ready, media-default,
-     media-ready */
-  attr = ippAddCollections(attrs, IPP_TAG_PRINTER, "media-col-database", pc->num_sizes, NULL);
+  // media-col-database, media-col-default, media-col-ready, media-default,
+  // media-ready
+  attr = ippAddCollections(attrs, IPP_TAG_PRINTER, "media-col-database",
+                          pc->num_sizes, NULL);
   if (strncasecmp(ppd_size->name, "Custom", 6) == 0)
   {
-    /* media-col-default - Custom size */
+    // media-col-default - Custom size
     int w = (int)(ppd_size->width / 72.0 * 2540.0);
     int l = (int)(ppd_size->length / 72.0 * 2540.0);
     if (w >= pc->custom_min_width && w <= pc->custom_max_width &&
@@ -806,29 +875,32 @@ ppdLoadAttributes(
       ippAddCollection(attrs, IPP_TAG_PRINTER, "media-col-default", col);
       ippAddCollection(attrs, IPP_TAG_PRINTER, "media-col-ready", col);
       ippDelete(col);
-      ippAddString(attrs, IPP_TAG_PRINTER, IPP_TAG_KEYWORD, "media-default", NULL, buf);
-      ippAddString(attrs, IPP_TAG_PRINTER, IPP_TAG_KEYWORD, "media-ready", NULL, buf);
+      ippAddString(attrs, IPP_TAG_PRINTER, IPP_TAG_KEYWORD, "media-default",
+                  NULL, buf);
+      ippAddString(attrs, IPP_TAG_PRINTER, IPP_TAG_KEYWORD, "media-ready",
+                  NULL, buf);
       have_custom_size = 1;
     }
   }
+
   for (i = 0, pwg_size = pc->sizes; i < pc->num_sizes; i ++, pwg_size ++)
   {
     if ((ptr = strchr(pwg_size->map.ppd, '.')) != NULL)
     {
-      /* Page size variant, use original size's PWG name but PPD's
-        dimensions and margins.
-
-        This way we can associate extra size for overspraying when
-         printing borderless with the original page size, for example
-         for cfFilterPWGToRaster() to correct original-sized PWG
-         Raster to overspray-sized CUPS Raster (for HPLIP for
-         example). Filters can also switch to overspray size if the
-         original size plus zero margins is requested for a job */
+      // Page size variant, use original size's PWG name but PPD's
+      // dimensions and margins.
+      //
+      // This way we can associate extra size for overspraying when
+      // printing borderless with the original page size, for example
+      // for cfFilterPWGToRaster() to correct original-sized PWG
+      // Raster to overspray-sized CUPS Raster (for HPLIP for
+      // example). Filters can also switch to overspray size if the
+      // original size plus zero margins is requested for a job
       pwg_size_t *size;
       memmove(buf, pwg_size->map.ppd, ptr - pwg_size->map.ppd);
       buf[ptr - pwg_size->map.ppd] = '\0';
       for (j = 0, size = pc->sizes; j < pc->num_sizes; j ++, size ++)
-       /* Find entry of original size */
+       // Find entry of original size
        if (strcasecmp(buf, size->map.ppd) == 0)
        {
          ptr = size->map.pwg;
@@ -839,12 +911,14 @@ ppdLoadAttributes(
     }
     else
       ptr = pwg_size->map.pwg;
-    col = create_media_col(ptr, NULL, NULL, pwg_size->width, pwg_size->length, pwg_size->bottom, pwg_size->left, pwg_size->right, pwg_size->top);
+    col = create_media_col(ptr, NULL, NULL, pwg_size->width, pwg_size->length,
+                          pwg_size->bottom, pwg_size->left, pwg_size->right,
+                          pwg_size->top);
     if (is_texttotext)
     {
-      /* Add info about the number of lines and number of columns defined in
-        the PPD for each page size to the appropriate media-col-database
-        entries */
+      // Add info about the number of lines and number of columns defined in
+      // the PPD for each page size to the appropriate media-col-database
+      // entries
       snprintf(buf, sizeof(buf), "%sNumColumns", pwg_size->map.ppd);
       if ((ppd_choice = ppdFindMarkedChoice(ppd, buf)) != NULL &&
          (j = atoi(ppd_choice->choice)) > 0)
@@ -858,8 +932,11 @@ ppdLoadAttributes(
     ippDelete(col);
     if (!have_custom_size && pwg_size == default_size)
     {
-      /* media-col-default - Standard size */
-      col = create_media_col(ptr, default_source, default_type, pwg_size->width, pwg_size->length, pwg_size->bottom, pwg_size->left, pwg_size->right, pwg_size->top);
+      // media-col-default - Standard size
+      col = create_media_col(ptr, default_source, default_type,
+                            pwg_size->width, pwg_size->length,
+                            pwg_size->bottom, pwg_size->left,
+                            pwg_size->right, pwg_size->top);
       ippAddCollection(attrs, IPP_TAG_PRINTER, "media-col-default", col);
       ippAddCollection(attrs, IPP_TAG_PRINTER, "media-col-ready", col);
       ippDelete(col);
@@ -868,8 +945,11 @@ ppdLoadAttributes(
     }
   }
 
-  /* media-left-margin-supported */
-  for (i = 0, num_margins = 0, pwg_size = pc->sizes; i < pc->num_sizes && num_margins < (int)(sizeof(margins) / sizeof(margins[0])); i ++, pwg_size ++)
+  // media-left-margin-supported
+  for (i = 0, num_margins = 0, pwg_size = pc->sizes;
+       i < pc->num_sizes &&
+        num_margins < (int)(sizeof(margins) / sizeof(margins[0]));
+       i ++, pwg_size ++)
   {
     for (j = 0; j < num_margins; j ++)
     {
@@ -895,10 +975,14 @@ ppdLoadAttributes(
     }
   }
 
-  ippAddIntegers(attrs, IPP_TAG_PRINTER, IPP_TAG_INTEGER, "media-left-margin-supported", num_margins, margins);
+  ippAddIntegers(attrs, IPP_TAG_PRINTER, IPP_TAG_INTEGER,
+                "media-left-margin-supported", num_margins, margins);
 
-  /* media-right-margin-supported */
-  for (i = 0, num_margins = 0, pwg_size = pc->sizes; i < pc->num_sizes && num_margins < (int)(sizeof(margins) / sizeof(margins[0])); i ++, pwg_size ++)
+  // media-right-margin-supported
+  for (i = 0, num_margins = 0, pwg_size = pc->sizes;
+       i < pc->num_sizes &&
+        num_margins < (int)(sizeof(margins) / sizeof(margins[0]));
+       i ++, pwg_size ++)
   {
     for (j = 0; j < num_margins; j ++)
     {
@@ -924,10 +1008,14 @@ ppdLoadAttributes(
     }
   }
 
-  ippAddIntegers(attrs, IPP_TAG_PRINTER, IPP_TAG_INTEGER, "media-right-margin-supported", num_margins, margins);
+  ippAddIntegers(attrs, IPP_TAG_PRINTER, IPP_TAG_INTEGER,
+                "media-right-margin-supported", num_margins, margins);
 
-  /* media-supported */
-  attr = ippAddStrings(attrs, IPP_TAG_PRINTER, IPP_TAG_KEYWORD, "media-supported", pc->num_sizes + (ppd->variable_sizes ? 2 : 0), NULL, NULL);
+  // media-supported
+  attr = ippAddStrings(attrs, IPP_TAG_PRINTER, IPP_TAG_KEYWORD,
+                      "media-supported",
+                      pc->num_sizes + (ppd->variable_sizes ? 2 : 0),
+                      NULL, NULL);
   for (i = 0, pwg_size = pc->sizes; i < pc->num_sizes; i ++, pwg_size ++)
     ippSetString(attrs, &attr, i, pwg_size->map.pwg);
   if (ppd->variable_sizes)
@@ -936,8 +1024,9 @@ ppdLoadAttributes(
     ippSetString(attrs, &attr, pc->num_sizes + 1, pc->custom_max_keyword);
   }
 
-  /* media-size-supported */
-  attr = ippAddCollections(attrs, IPP_TAG_PRINTER, "media-size-supported", pc->num_sizes + (ppd->variable_sizes ? 1 : 0), NULL);
+  // media-size-supported
+  attr = ippAddCollections(attrs, IPP_TAG_PRINTER, "media-size-supported",
+                          pc->num_sizes + (ppd->variable_sizes ? 1 : 0), NULL);
   for (i = 0, pwg_size = pc->sizes; i < pc->num_sizes; i ++, pwg_size ++)
   {
     col = create_media_size(pwg_size->width, pwg_size->length);
@@ -952,20 +1041,26 @@ ppdLoadAttributes(
     ippDelete(col);
   }
 
-  /* media-source-supported */
+  // media-source-supported
   if (pc->num_sources > 0)
   {
-    attr = ippAddStrings(attrs, IPP_TAG_PRINTER, IPP_TAG_KEYWORD, "media-source-supported", pc->num_sources, NULL,  NULL);
+    attr = ippAddStrings(attrs, IPP_TAG_PRINTER, IPP_TAG_KEYWORD,
+                        "media-source-supported", pc->num_sources,
+                        NULL,  NULL);
     for (i = 0, pwg_map = pc->sources; i < pc->num_sources; i ++, pwg_map ++)
       ippSetString(attrs, &attr, i, pwg_map->pwg);
   }
   else
   {
-    ippAddString(attrs, IPP_TAG_PRINTER, IPP_CONST_TAG(IPP_TAG_KEYWORD), "media-source-supported", NULL, "auto");
+    ippAddString(attrs, IPP_TAG_PRINTER, IPP_CONST_TAG(IPP_TAG_KEYWORD),
+                "media-source-supported", NULL, "auto");
   }
 
-  /* media-top-margin-supported */
-  for (i = 0, num_margins = 0, pwg_size = pc->sizes; i < pc->num_sizes && num_margins < (int)(sizeof(margins) / sizeof(margins[0])); i ++, pwg_size ++)
+  // media-top-margin-supported
+  for (i = 0, num_margins = 0, pwg_size = pc->sizes;
+       i < pc->num_sizes &&
+        num_margins < (int)(sizeof(margins) / sizeof(margins[0]));
+       i ++, pwg_size ++)
   {
     for (j = 0; j < num_margins; j ++)
     {
@@ -991,31 +1086,40 @@ ppdLoadAttributes(
     }
   }
 
-  ippAddIntegers(attrs, IPP_TAG_PRINTER, IPP_TAG_INTEGER, "media-top-margin-supported", num_margins, margins);
+  ippAddIntegers(attrs, IPP_TAG_PRINTER, IPP_TAG_INTEGER,
+                "media-top-margin-supported", num_margins, margins);
 
-  /* media-type-supported */
+  // media-type-supported
   if (pc->num_types > 0)
   {
-    attr = ippAddStrings(attrs, IPP_TAG_PRINTER, IPP_TAG_KEYWORD, "media-type-supported", pc->num_types, NULL,  NULL);
+    attr = ippAddStrings(attrs, IPP_TAG_PRINTER, IPP_TAG_KEYWORD,
+                        "media-type-supported", pc->num_types, NULL,  NULL);
     for (i = 0, pwg_map = pc->types; i < pc->num_types; i ++, pwg_map ++)
       ippSetString(attrs, &attr, i, pwg_map->pwg);
   }
   else
   {
-    ippAddString(attrs, IPP_TAG_PRINTER, IPP_CONST_TAG(IPP_TAG_KEYWORD), "media-type-supported", NULL, "auto");
+    ippAddString(attrs, IPP_TAG_PRINTER, IPP_CONST_TAG(IPP_TAG_KEYWORD),
+                "media-type-supported", NULL, "auto");
   }
 
-  /* orientation-requested-default */
-  ippAddInteger(attrs, IPP_TAG_PRINTER, IPP_TAG_ENUM, "orientation-requested-default", IPP_ORIENT_PORTRAIT);
+  // orientation-requested-default
+  ippAddInteger(attrs, IPP_TAG_PRINTER, IPP_TAG_ENUM,
+               "orientation-requested-default", IPP_ORIENT_PORTRAIT);
 
-  /* orientation-requested-supported */
-  ippAddIntegers(attrs, IPP_TAG_PRINTER, IPP_TAG_ENUM, "orientation-requested-supported", (int)(sizeof(orientation_requested_supported) / sizeof(orientation_requested_supported[0])), orientation_requested_supported);
+  // orientation-requested-supported
+  ippAddIntegers(attrs, IPP_TAG_PRINTER, IPP_TAG_ENUM,
+                "orientation-requested-supported",
+                (int)(sizeof(orientation_requested_supported) /
+                      sizeof(orientation_requested_supported[0])),
+                orientation_requested_supported);
 
-  /* output-bin-supported and output-bin-default */
+  // output-bin-supported and output-bin-default
   def_found = 0;
   if (pc->num_bins > 0)
   {
-    attr = ippAddStrings(attrs, IPP_TAG_PRINTER, IPP_TAG_KEYWORD, "output-bin-supported", pc->num_bins, NULL,  NULL);
+    attr = ippAddStrings(attrs, IPP_TAG_PRINTER, IPP_TAG_KEYWORD,
+                        "output-bin-supported", pc->num_bins, NULL,  NULL);
     for (i = 0, pwg_map = pc->bins; i < pc->num_bins; i ++, pwg_map ++)
     {
       ippSetString(attrs, &attr, i, pwg_map->pwg);
@@ -1055,7 +1159,8 @@ ppdLoadAttributes(
       }
       if (face_up == 0 && order != 0)
        face_up = -order;
-      snprintf(buf, sizeof(buf), "type=unknown;maxcapacity=-2;remaining=-2;status=5;stackingorder=%s;pagedelivery=%s;name=%s",
+      snprintf(buf, sizeof(buf),
+              "type=unknown;maxcapacity=-2;remaining=-2;status=5;stackingorder=%s;pagedelivery=%s;name=%s",
              (order == -1 ? "lastToFirst" :
               (order == 1 ? "firstToLast" :
                "unknown")),
@@ -1075,30 +1180,39 @@ ppdLoadAttributes(
     order = (strcasecmp(default_output_order, "Normal") == 0 ? 1 :
             (strcasecmp(default_output_order, "Reverse") == 0 ? -1 : 1));
     def_output_bin = (order == 1 ? "face-down" : "face-up");
-    ippAddString(attrs, IPP_TAG_PRINTER, IPP_TAG_KEYWORD, "output-bin-supported", NULL, def_output_bin);
-    snprintf(buf, sizeof(buf), "type=unknown;maxcapacity=-2;remaining=-2;status=5;stackingorder=%s;pagedelivery=%s;name=%s",
+    ippAddString(attrs, IPP_TAG_PRINTER, IPP_TAG_KEYWORD,
+                "output-bin-supported", NULL, def_output_bin);
+    snprintf(buf, sizeof(buf),
+            "type=unknown;maxcapacity=-2;remaining=-2;status=5;stackingorder=%s;pagedelivery=%s;name=%s",
             (order == -1 ? "lastToFirst" : "firstToLast"),
             (order == -1 ? "faceUp" : "faceDown"),
             def_output_bin);
     ippAddOctetString(attrs, IPP_TAG_PRINTER,
                      "printer-output-tray", buf, strlen(buf));
   }
-  ippAddString(attrs, IPP_TAG_PRINTER, IPP_TAG_KEYWORD, "output-bin-default", NULL, def_output_bin);
+  ippAddString(attrs, IPP_TAG_PRINTER, IPP_TAG_KEYWORD,
+              "output-bin-default", NULL, def_output_bin);
 
-  /* overrides-supported */
-  ippAddStrings(attrs, IPP_TAG_PRINTER, IPP_CONST_TAG(IPP_TAG_KEYWORD), "overrides-supported", (int)(sizeof(overrides_supported) / sizeof(overrides_supported[0])), NULL, overrides_supported);
+  // overrides-supported
+  ippAddStrings(attrs, IPP_TAG_PRINTER, IPP_CONST_TAG(IPP_TAG_KEYWORD),
+               "overrides-supported",
+               (int)(sizeof(overrides_supported) /
+                     sizeof(overrides_supported[0])),
+               NULL, overrides_supported);
 
-  /* page-ranges-supported */
+  // page-ranges-supported
   ippAddBoolean(attrs, IPP_TAG_PRINTER, "page-ranges-supported", 1);
 
-  /* pages-per-minute */
-  ippAddInteger(attrs, IPP_TAG_PRINTER, IPP_TAG_INTEGER, "pages-per-minute", ppd->throughput);
+  // pages-per-minute
+  ippAddInteger(attrs, IPP_TAG_PRINTER, IPP_TAG_INTEGER, "pages-per-minute",
+               ppd->throughput);
 
-  /* pages-per-minute-color */
+  // pages-per-minute-color
   if (ppd->color_device)
-    ippAddInteger(attrs, IPP_TAG_PRINTER, IPP_TAG_INTEGER, "pages-per-minute-color", ppd->throughput);
+    ippAddInteger(attrs, IPP_TAG_PRINTER, IPP_TAG_INTEGER,
+                 "pages-per-minute-color", ppd->throughput);
 
-  /* print-color-mode-default */
+  // print-color-mode-default
   bool mono =
     (ppd->color_device &&
      (((ppd_choice = ppdFindMarkedChoice(ppd, "ColorModel")) != NULL &&
@@ -1113,123 +1227,169 @@ ppdLoadAttributes(
        strcasestr(ppd_choice->choice, "bw") ||
        strcasestr(ppd_choice->choice, "bi-level") ||
        strcasestr(ppd_choice->choice, "bi_level")))));
-  ippAddString(attrs, IPP_TAG_PRINTER, IPP_TAG_KEYWORD, "print-color-mode-default", NULL, ppd->color_device && !mono ? "auto" : "monochrome");
+  ippAddString(attrs, IPP_TAG_PRINTER, IPP_TAG_KEYWORD,
+              "print-color-mode-default", NULL,
+              ppd->color_device && !mono ? "auto" : "monochrome");
 
-  /* print-color-mode-supported */
+  // print-color-mode-supported
   if (ppd->color_device)
-    ippAddStrings(attrs, IPP_TAG_PRINTER, IPP_CONST_TAG(IPP_TAG_KEYWORD), "print-color-mode-supported", (int)(sizeof(print_color_mode_supported_color) / sizeof(print_color_mode_supported_color[0])), NULL, print_color_mode_supported_color);
+    ippAddStrings(attrs, IPP_TAG_PRINTER, IPP_CONST_TAG(IPP_TAG_KEYWORD),
+                 "print-color-mode-supported",
+                 (int)(sizeof(print_color_mode_supported_color) /
+                       sizeof(print_color_mode_supported_color[0])),
+                 NULL, print_color_mode_supported_color);
   else
-    ippAddStrings(attrs, IPP_TAG_PRINTER, IPP_CONST_TAG(IPP_TAG_KEYWORD), "print-color-mode-supported", (int)(sizeof(print_color_mode_supported) / sizeof(print_color_mode_supported[0])), NULL, print_color_mode_supported);
-
-  /* print-content-optimize-default */
-  ippAddString(attrs, IPP_TAG_PRINTER, IPP_CONST_TAG(IPP_TAG_KEYWORD), "print-content-optimize-default", NULL, "auto");
-
-  /* print-content-optimize-supported */
-  ippAddStrings(attrs, IPP_TAG_PRINTER, IPP_CONST_TAG(IPP_TAG_KEYWORD), "print-content-optimize-supported", (int)(sizeof(print_content_optimize_supported) / sizeof(print_content_optimize_supported[0])), NULL, print_content_optimize_supported);
-
-  /* print-quality-default */
-  ippAddInteger(attrs, IPP_TAG_PRINTER, IPP_TAG_ENUM, "print-quality-default", IPP_QUALITY_NORMAL);
-
-  /* print-quality-supported */
-  ippAddIntegers(attrs, IPP_TAG_PRINTER, IPP_TAG_ENUM, "print-quality-supported", (int)(sizeof(print_quality_supported) / sizeof(print_quality_supported[0])), print_quality_supported);
-
-  /* print-rendering-intent-default */
+    ippAddStrings(attrs, IPP_TAG_PRINTER, IPP_CONST_TAG(IPP_TAG_KEYWORD),
+                 "print-color-mode-supported",
+                 (int)(sizeof(print_color_mode_supported) /
+                       sizeof(print_color_mode_supported[0])),
+                 NULL, print_color_mode_supported);
+
+  // print-content-optimize-default
+  ippAddString(attrs, IPP_TAG_PRINTER, IPP_CONST_TAG(IPP_TAG_KEYWORD),
+              "print-content-optimize-default", NULL, "auto");
+
+  // print-content-optimize-supported
+  ippAddStrings(attrs, IPP_TAG_PRINTER, IPP_CONST_TAG(IPP_TAG_KEYWORD),
+               "print-content-optimize-supported",
+               (int)(sizeof(print_content_optimize_supported) /
+                     sizeof(print_content_optimize_supported[0])),
+               NULL, print_content_optimize_supported);
+
+  // print-quality-default
+  ippAddInteger(attrs, IPP_TAG_PRINTER, IPP_TAG_ENUM, "print-quality-default",
+               IPP_QUALITY_NORMAL);
+
+  // print-quality-supported
+  ippAddIntegers(attrs, IPP_TAG_PRINTER, IPP_TAG_ENUM,
+                "print-quality-supported",
+                (int)(sizeof(print_quality_supported) /
+                      sizeof(print_quality_supported[0])),
+                print_quality_supported);
+
+  // print-rendering-intent-default
   if ((ppd_choice =
        ppdFindMarkedChoice(ppd, "cupsRenderingIntent")) != NULL ||
       (ppd_choice =
        ppdFindMarkedChoice(ppd, "print-rendering-intent")) != NULL)
-    ippAddString(attrs, IPP_TAG_PRINTER, IPP_TAG_KEYWORD, "print-rendering-intent-default", NULL, ppd_choice->choice);
+    ippAddString(attrs, IPP_TAG_PRINTER, IPP_TAG_KEYWORD,
+                "print-rendering-intent-default", NULL, ppd_choice->choice);
   else
-    ippAddString(attrs, IPP_TAG_PRINTER, IPP_CONST_TAG(IPP_TAG_KEYWORD), "print-rendering-intent-default", NULL, "auto");
+    ippAddString(attrs, IPP_TAG_PRINTER, IPP_CONST_TAG(IPP_TAG_KEYWORD),
+                "print-rendering-intent-default", NULL, "auto");
 
-  /* print-rendering-intent-supported */
+  // print-rendering-intent-supported
   if (((ppd_option = ppdFindOption(ppd, "cupsRenderingIntent")) != NULL ||
        (ppd_option = ppdFindOption(ppd, "print-rendering-intent")) != NULL) &&
       ppd_option->num_choices > 0)
   {
     for (i = 0; i < ppd_option->num_choices && i < sizeof(items); i ++)
       items[i] = ppd_option->choices[i].choice;
-    ippAddStrings(attrs, IPP_TAG_PRINTER, IPP_TAG_KEYWORD, "print-rendering-intent-supported", i, NULL, items);
+    ippAddStrings(attrs, IPP_TAG_PRINTER, IPP_TAG_KEYWORD,
+                 "print-rendering-intent-supported", i, NULL, items);
   }
   else
-    ippAddString(attrs, IPP_TAG_PRINTER, IPP_CONST_TAG(IPP_TAG_KEYWORD), "print-rendering-intent-supported", NULL, "auto");
+    ippAddString(attrs, IPP_TAG_PRINTER, IPP_CONST_TAG(IPP_TAG_KEYWORD),
+                "print-rendering-intent-supported", NULL, "auto");
 
-  /* printer-device-id */
+  // printer-device-id
   if ((ppd_attr = ppdFindAttr(ppd, "1284DeviceId", NULL)) != NULL)
   {
-   /*
-    * Use the device ID string from the PPD...
-    */
+    //
+    // Use the device ID string from the PPD...
+    //
 
-    ippAddString(attrs, IPP_TAG_PRINTER, IPP_TAG_TEXT, "printer-device-id", NULL, ppd_attr->value);
+    ippAddString(attrs, IPP_TAG_PRINTER, IPP_TAG_TEXT, "printer-device-id",
+                NULL, ppd_attr->value);
   }
   else
   {
-   /*
-    * Synthesize a device ID string...
-    */
+    //
+    // Synthesize a device ID string...
+    //
 
-    char       device_id[1024];                /* Device ID string */
+    char       device_id[1024];                // Device ID string
 
-    snprintf(device_id, sizeof(device_id), "MFG:%s;MDL:%s;%s", ppd->manufacturer, ppd->modelname, cmd);
+    snprintf(device_id, sizeof(device_id), "MFG:%s;MDL:%s;%s",
+            ppd->manufacturer, ppd->modelname, cmd);
 
-    ippAddString(attrs, IPP_TAG_PRINTER, IPP_TAG_TEXT, "printer-device-id", NULL, device_id);
+    ippAddString(attrs, IPP_TAG_PRINTER, IPP_TAG_TEXT, "printer-device-id",
+                NULL, device_id);
   }
 
-  /* printer-info */
-  ippAddString(attrs, IPP_TAG_PRINTER, IPP_TAG_TEXT, "printer-info", NULL, ppd->nickname);
+  // printer-info
+  ippAddString(attrs, IPP_TAG_PRINTER, IPP_TAG_TEXT, "printer-info", NULL,
+              ppd->nickname);
 
-  /* printer-input-tray */
+  // printer-input-tray
   if (pc->num_sources > 0)
   {
     for (i = 0, attr = NULL; i < pc->num_sources; i ++)
     {
-      char     input_tray[1024];       /* printer-input-tray value */
+      char     input_tray[1024];       // printer-input-tray value
 
-      if (!strcmp(pc->sources[i].pwg, "manual") || strstr(pc->sources[i].pwg, "-man") != NULL)
-        snprintf(input_tray, sizeof(input_tray), "type=sheetFeedManual;mediafeed=0;mediaxfeed=0;maxcapacity=1;level=-2;status=0;name=%s", pc->sources[i].pwg);
+      if (!strcmp(pc->sources[i].pwg, "manual") ||
+         strstr(pc->sources[i].pwg, "-man") != NULL)
+        snprintf(input_tray, sizeof(input_tray),
+                "type=sheetFeedManual;mediafeed=0;mediaxfeed=0;maxcapacity=1;level=-2;status=0;name=%s",
+                pc->sources[i].pwg);
       else
-        snprintf(input_tray, sizeof(input_tray), "type=sheetFeedAutoRemovableTray;mediafeed=0;mediaxfeed=0;maxcapacity=250;level=125;status=0;name=%s", pc->sources[i].pwg);
+        snprintf(input_tray, sizeof(input_tray),
+                "type=sheetFeedAutoRemovableTray;mediafeed=0;mediaxfeed=0;maxcapacity=250;level=125;status=0;name=%s",
+                pc->sources[i].pwg);
 
       if (attr)
         ippSetOctetString(attrs, &attr, i, input_tray, (int)strlen(input_tray));
       else
-        attr = ippAddOctetString(attrs, IPP_TAG_PRINTER, "printer-input-tray", input_tray, (int)strlen(input_tray));
+        attr = ippAddOctetString(attrs, IPP_TAG_PRINTER, "printer-input-tray",
+                                input_tray, (int)strlen(input_tray));
     }
   }
   else
   {
-    static const char *printer_input_tray = "type=sheetFeedAutoRemovableTray;mediafeed=0;mediaxfeed=0;maxcapacity=-2;level=-2;status=0;name=auto";
+    static const char *printer_input_tray =
+      "type=sheetFeedAutoRemovableTray;mediafeed=0;mediaxfeed=0;maxcapacity=-2;level=-2;status=0;name=auto";
 
-    ippAddOctetString(attrs, IPP_TAG_PRINTER, "printer-input-tray", printer_input_tray, (int)strlen(printer_input_tray));
+    ippAddOctetString(attrs, IPP_TAG_PRINTER, "printer-input-tray",
+                     printer_input_tray, (int)strlen(printer_input_tray));
   }
 
-  /* printer-make-andXS-model */
-  ippAddString(attrs, IPP_TAG_PRINTER, IPP_TAG_TEXT, "printer-make-and-model", NULL, ppd->nickname);
+  // printer-make-andXS-model
+  ippAddString(attrs, IPP_TAG_PRINTER, IPP_TAG_TEXT, "printer-make-and-model",
+              NULL, ppd->nickname);
 
-  /* printer-resolution-default */
-  ippAddResolution(attrs, IPP_TAG_PRINTER, "printer-resolution-default", IPP_RES_PER_INCH, xres, yres);
+  // printer-resolution-default
+  ippAddResolution(attrs, IPP_TAG_PRINTER, "printer-resolution-default",
+                  IPP_RES_PER_INCH, xres, yres);
 
-  /* printer-resolution-supported */
-  ippAddResolution(attrs, IPP_TAG_PRINTER, "printer-resolution-supported", IPP_RES_PER_INCH, xres, yres);
+  // printer-resolution-supported
+  ippAddResolution(attrs, IPP_TAG_PRINTER, "printer-resolution-supported",
+                  IPP_RES_PER_INCH, xres, yres);
 
-  /* sides-default */
+  // sides-default
   if (pc->sides_option && pc->sides_2sided_long &&
       ppdIsMarked(ppd, pc->sides_option, pc->sides_2sided_long))
-    ippAddString(attrs, IPP_TAG_PRINTER, IPP_CONST_TAG(IPP_TAG_KEYWORD), "sides-default", NULL, "two-sided-long-edge");
+    ippAddString(attrs, IPP_TAG_PRINTER, IPP_CONST_TAG(IPP_TAG_KEYWORD),
+                "sides-default", NULL, "two-sided-long-edge");
   else if (pc->sides_option && pc->sides_2sided_short &&
           ppdIsMarked(ppd, pc->sides_option, pc->sides_2sided_short))
-    ippAddString(attrs, IPP_TAG_PRINTER, IPP_CONST_TAG(IPP_TAG_KEYWORD), "sides-default", NULL, "two-sided-long-short");
+    ippAddString(attrs, IPP_TAG_PRINTER, IPP_CONST_TAG(IPP_TAG_KEYWORD),
+                "sides-default", NULL, "two-sided-long-short");
   else
-    ippAddString(attrs, IPP_TAG_PRINTER, IPP_CONST_TAG(IPP_TAG_KEYWORD), "sides-default", NULL, "one-sided");
+    ippAddString(attrs, IPP_TAG_PRINTER, IPP_CONST_TAG(IPP_TAG_KEYWORD),
+                "sides-default", NULL, "one-sided");
 
-  /* sides-supported */
+  // sides-supported
   if (pc->sides_option && pc->sides_2sided_long)
-    ippAddStrings(attrs, IPP_TAG_PRINTER, IPP_CONST_TAG(IPP_TAG_KEYWORD), "sides-supported", (int)(sizeof(sides_supported) / sizeof(sides_supported[0])), NULL, sides_supported);
+    ippAddStrings(attrs, IPP_TAG_PRINTER, IPP_CONST_TAG(IPP_TAG_KEYWORD),
+                 "sides-supported",
+                 (int)(sizeof(sides_supported) / sizeof(sides_supported[0])),
+                 NULL, sides_supported);
   else
-    ippAddString(attrs, IPP_TAG_PRINTER, IPP_CONST_TAG(IPP_TAG_KEYWORD), "sides-supported", NULL, "one-sided");
+    ippAddString(attrs, IPP_TAG_PRINTER, IPP_CONST_TAG(IPP_TAG_KEYWORD),
+                "sides-supported", NULL, "one-sided");
 
-  /* Extra attributes for "texttotext" filter */ 
+  // Extra attributes for "texttotext" filter 
   if (is_texttotext)
   {
     if ((ppd_choice = ppdFindMarkedChoice(ppd, "OverLongLines")) != NULL &&
@@ -1296,60 +1456,71 @@ ppdLoadAttributes(
 
   }
 
-  /* Clean up */
+  // Clean up
   cupsArrayDelete(docformats);
   return (attrs);
 }
 
-/*
- * 'create_media_col()' - Create a media-col value.
- */
-
-static ipp_t *                         /* O - media-col collection */
-create_media_col(const char *media,    /* I - Media name */
-                const char *source,    /* I - Media source, if any */
-                const char *type,      /* I - Media type, if any */
-                int        width,      /* I - x-dimension in 2540ths */
-                int        length,     /* I - y-dimension in 2540ths */
-                int        bottom,     /* I - Bottom margin in 2540ths */
-                int        left,       /* I - Left margin in 2540ths */
-                int        right,      /* I - Right margin in 2540ths */
-                int        top)        /* I - Top margin in 2540ths */
+//
+// 'create_media_col()' - Create a media-col value.
+//
+
+static ipp_t *                         // O - media-col collection
+create_media_col(const char *media,    // I - Media name
+                const char *source,    // I - Media source, if any
+                const char *type,      // I - Media type, if any
+                int        width,      // I - x-dimension in 2540ths
+                int        length,     // I - y-dimension in 2540ths
+                int        bottom,     // I - Bottom margin in 2540ths
+                int        left,       // I - Left margin in 2540ths
+                int        right,      // I - Right margin in 2540ths
+                int        top)        // I - Top margin in 2540ths
 {
-  ipp_t                *media_col = ippNew(),  /* media-col value */
+  ipp_t                *media_col = ippNew(),  // media-col value
                *media_size = create_media_size(width, length);
-                                       /* media-size value */
-  char         media_key[256];         /* media-key value */
-  const char   *media_key_suffix = ""; /* media-key suffix */
+                                       // media-size value
+  char         media_key[256];         // media-key value
+  const char   *media_key_suffix = ""; // media-key suffix
 
 
   if (bottom == 0 && left == 0 && right == 0 && top == 0)
     media_key_suffix = "_borderless";
 
   if (type && source)
-    snprintf(media_key, sizeof(media_key), "%s_%s_%s%s", media, source, type, media_key_suffix);
+    snprintf(media_key, sizeof(media_key), "%s_%s_%s%s", media, source,
+            type, media_key_suffix);
   else if (type)
-    snprintf(media_key, sizeof(media_key), "%s__%s%s", media, type, media_key_suffix);
+    snprintf(media_key, sizeof(media_key), "%s__%s%s", media, type,
+            media_key_suffix);
   else if (source)
-    snprintf(media_key, sizeof(media_key), "%s_%s%s", media, source, media_key_suffix);
+    snprintf(media_key, sizeof(media_key), "%s_%s%s", media, source,
+            media_key_suffix);
   else
     snprintf(media_key, sizeof(media_key), "%s%s", media, media_key_suffix);
 
-  ippAddString(media_col, IPP_TAG_PRINTER, IPP_TAG_KEYWORD, "media-key", NULL, media_key);
+  ippAddString(media_col, IPP_TAG_PRINTER, IPP_TAG_KEYWORD, "media-key",
+              NULL, media_key);
   ippAddCollection(media_col, IPP_TAG_PRINTER, "media-size", media_size);
-  ippAddString(media_col, IPP_TAG_PRINTER, IPP_TAG_KEYWORD, "media-size-name", NULL, media);
+  ippAddString(media_col, IPP_TAG_PRINTER, IPP_TAG_KEYWORD,
+              "media-size-name", NULL, media);
   if (bottom >= 0)
-    ippAddInteger(media_col, IPP_TAG_PRINTER, IPP_TAG_INTEGER, "media-bottom-margin", bottom);
+    ippAddInteger(media_col, IPP_TAG_PRINTER, IPP_TAG_INTEGER,
+                 "media-bottom-margin", bottom);
   if (left >= 0)
-    ippAddInteger(media_col, IPP_TAG_PRINTER, IPP_TAG_INTEGER, "media-left-margin", left);
+    ippAddInteger(media_col, IPP_TAG_PRINTER, IPP_TAG_INTEGER,
+                 "media-left-margin", left);
   if (right >= 0)
-    ippAddInteger(media_col, IPP_TAG_PRINTER, IPP_TAG_INTEGER, "media-right-margin", right);
+    ippAddInteger(media_col, IPP_TAG_PRINTER, IPP_TAG_INTEGER,
+                 "media-right-margin", right);
   if (top >= 0)
-    ippAddInteger(media_col, IPP_TAG_PRINTER, IPP_TAG_INTEGER, "media-top-margin", top);
+    ippAddInteger(media_col, IPP_TAG_PRINTER, IPP_TAG_INTEGER,
+                 "media-top-margin", top);
   if (source)
-    ippAddString(media_col, IPP_TAG_PRINTER, IPP_TAG_KEYWORD, "media-source", NULL, source);
+    ippAddString(media_col, IPP_TAG_PRINTER, IPP_TAG_KEYWORD,
+                "media-source", NULL, source);
   if (type)
-    ippAddString(media_col, IPP_TAG_PRINTER, IPP_TAG_KEYWORD, "media-type", NULL, type);
+    ippAddString(media_col, IPP_TAG_PRINTER, IPP_TAG_KEYWORD,
+                "media-type", NULL, type);
 
   ippDelete(media_size);
 
@@ -1357,38 +1528,42 @@ create_media_col(const char *media,     /* I - Media name */
 }
 
 
-/*
- * 'create_media_size()' - Create a media-size value.
- */
+//
+// 'create_media_size()' - Create a media-size value.
+//
 
-static ipp_t *                         /* O - media-col collection */
-create_media_size(int width,           /* I - x-dimension in 2540ths */
-                 int length)           /* I - y-dimension in 2540ths */
+static ipp_t *                         // O - media-col collection
+create_media_size(int width,           // I - x-dimension in 2540ths
+                 int length)           // I - y-dimension in 2540ths
 {
-  ipp_t        *media_size = ippNew();         /* media-size value */
+  ipp_t        *media_size = ippNew();         // media-size value
 
 
-  ippAddInteger(media_size, IPP_TAG_PRINTER, IPP_TAG_INTEGER, "x-dimension", width);
-  ippAddInteger(media_size, IPP_TAG_PRINTER, IPP_TAG_INTEGER, "y-dimension", length);
+  ippAddInteger(media_size, IPP_TAG_PRINTER, IPP_TAG_INTEGER, "x-dimension",
+               width);
+  ippAddInteger(media_size, IPP_TAG_PRINTER, IPP_TAG_INTEGER, "y-dimension",
+               length);
 
   return (media_size);
 }
 
 
-/*
- * 'create_media_size_range()' - Create a media-size range for custom sizes.
- */
+//
+// 'create_media_size_range()' - Create a media-size range for custom sizes.
+//
 
-static ipp_t *                                 /* O - media-col collection */
-create_media_size_ranges(int min_width,                /* I - min x dim in 2540ths */
-                        int min_length,        /* I - nin y dim in 2540ths */
-                        int max_width,         /* I - max x dim in 2540ths */
-                        int max_length)        /* I - max y dim in 2540ths */
+static ipp_t *                                 // O - media-col collection
+create_media_size_ranges(int min_width,                // I - min x dim in 2540ths
+                        int min_length,        // I - nin y dim in 2540ths
+                        int max_width,         // I - max x dim in 2540ths
+                        int max_length)        // I - max y dim in 2540ths
 {
-  ipp_t        *media_size_ranges = ippNew();          /* media-size value */
+  ipp_t        *media_size_ranges = ippNew();          // media-size value
 
-  ippAddRange(media_size_ranges, IPP_TAG_PRINTER, "x-dimension", min_width, max_width);
-  ippAddRange(media_size_ranges, IPP_TAG_PRINTER, "y-dimension", min_length, max_length);
+  ippAddRange(media_size_ranges, IPP_TAG_PRINTER, "x-dimension", min_width,
+             max_width);
+  ippAddRange(media_size_ranges, IPP_TAG_PRINTER, "y-dimension", min_length,
+             max_length);
 
   return (media_size_ranges);
 }
index 9d44d48fdc39183e26106e42e0e31f27a792003b..45433434465094447ae3df87cf00e133e30fee2a 100644 (file)
@@ -1,26 +1,24 @@
-/*
- *   PPD color profile attribute lookup functions for libppd.
- *
- *   Copyright 2007-2011 by Apple Inc.
- *   Copyright 1993-2005 by Easy Software Products.
- *
- *   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 "COPYING"
- *   which should have been included with this file.
- *
- * Contents:
- *
- *   ppdFindColorAttr() - Find a PPD attribute based on the colormodel,
- *                        media, and resolution.
- *   ppdLutLoad()       - Load a LUT from a PPD file.
- *   ppdRGBLoad()       - Load a RGB color profile from a PPD file.
- *   ppdCMYKLoad()      - Load a CMYK color profile from PPD attributes.
- */
-
-/*
- * Include necessary headers.
- */
+//
+//   PPD color profile attribute lookup functions for libppd.
+//
+//   Copyright 2007-2011 by Apple Inc.
+//   Copyright 1993-2005 by Easy Software Products.
+//
+//   Licensed under Apache License v2.0.  See the file "LICENSE" for more
+//   information.
+//
+// Contents:
+//
+//   ppdFindColorAttr() - Find a PPD attribute based on the colormodel,
+//                        media, and resolution.
+//   ppdLutLoad()       - Load a LUT from a PPD file.
+//   ppdRGBLoad()       - Load a RGB color profile from a PPD file.
+//   ppdCMYKLoad()      - Load a CMYK color profile from PPD attributes.
+//
+
+//
+// Include necessary headers.
+//
 
 #include <config.h>
 #include "ppd.h"
 #include <ctype.h>
 
 
-/*
- * 'ppdFindColorAttr()' - Find a PPD attribute based on the colormodel,
- *                        media, and resolution.
- */
-
-ppd_attr_t *                                   /* O - Matching attribute or
-                                                      NULL */
-ppdFindColorAttr(ppd_file_t *ppd,              /* I - PPD file */
-                const char *name,              /* I - Attribute name */
-                const char *colormodel,        /* I - Color model */
-                const char *media,             /* I - Media type */
-                const char *resolution,        /* I - Resolution */
-                char       *spec,              /* O - Final selection string */
-                int        specsize,           /* I - Size of string buffer */
-                cf_logfunc_t log,              /* I - Log function */
-                void       *ld)                /* I - Log function data */
+//
+// 'ppdFindColorAttr()' - Find a PPD attribute based on the colormodel,
+//                        media, and resolution.
+//
+
+ppd_attr_t *                                   // O - Matching attribute or
+                                               //     NULL
+ppdFindColorAttr(ppd_file_t *ppd,              // I - PPD file
+                const char *name,              // I - Attribute name
+                const char *colormodel,        // I - Color model
+                const char *media,             // I - Media type
+                const char *resolution,        // I - Resolution
+                char       *spec,              // O - Final selection string
+                int        specsize,           // I - Size of string buffer
+                cf_logfunc_t log,              // I - Log function
+                void       *ld)                // I - Log function data
 {
-  ppd_attr_t   *attr;                  /* Attribute */
+  ppd_attr_t   *attr;                  // Attribute
 
 
- /*
-  * Range check input...
-  */
+  //
+  // Range check input...
+  //
 
   if (!ppd || !name || !colormodel || !media || !resolution || !spec ||
       specsize < IPP_MAX_NAME)
     return (NULL);
 
- /*
-  * Look for the attribute with the following keywords:
-  *
-  *     ColorModel.MediaType.Resolution
-  *     ColorModel.Resolution
-  *     ColorModel
-  *     MediaType.Resolution
-  *     MediaType
-  *     Resolution
-  *     ""
-  */
+  //
+  // Look for the attribute with the following keywords:
+  //
+  //     ColorModel.MediaType.Resolution
+  //     ColorModel.Resolution
+  //     ColorModel
+  //     MediaType.Resolution
+  //     MediaType
+  //     Resolution
+  //     ""
+  //
 
   snprintf(spec, specsize, "%s.%s.%s", colormodel, media, resolution);
   if (log) log(ld, CF_LOGLEVEL_DEBUG,
@@ -119,36 +117,36 @@ ppdFindColorAttr(ppd_file_t *ppd,         /* I - PPD file */
 }
 
  
-/*
- * 'ppdLutLoad()' - Load a LUT from a PPD file.
- */
-
-cf_lut_t *                             /* O - New lookup table */
-ppdLutLoad(ppd_file_t *ppd,            /* I - PPD file */
-            const char *colormodel,    /* I - Color model */
-            const char *media,         /* I - Media type */
-            const char *resolution,    /* I - Resolution */
-           const char *ink,            /* I - Ink name */
-           cf_logfunc_t log,       /* I - Log function */
-           void       *ld)             /* I - Log function data */
+//
+// 'ppdLutLoad()' - Load a LUT from a PPD file.
+//
+
+cf_lut_t *                             // O - New lookup table
+ppdLutLoad(ppd_file_t *ppd,            // I - PPD file
+            const char *colormodel,    // I - Color model
+            const char *media,         // I - Media type
+            const char *resolution,    // I - Resolution
+           const char *ink,            // I - Ink name
+           cf_logfunc_t log,           // I - Log function
+           void       *ld)             // I - Log function data
 {
-  char         name[PPD_MAX_NAME],     /* Attribute name */
-               spec[PPD_MAX_NAME];     /* Attribute spec */
-  ppd_attr_t   *attr;                  /* Attribute */
-  int          nvals;                  /* Number of values */
-  float                vals[4];                /* Values */
+  char         name[PPD_MAX_NAME],     // Attribute name
+               spec[PPD_MAX_NAME];     // Attribute spec
+  ppd_attr_t   *attr;                  // Attribute
+  int          nvals;                  // Number of values
+  float                vals[4];                // Values
 
 
- /*
-  * Range check input...
-  */
+  //
+  // Range check input...
+  //
 
   if (!ppd || !colormodel || !media || !resolution || !ink)
     return (NULL);
 
- /*
-  * Try to find the LUT values...
-  */
+  //
+  // Try to find the LUT values...
+  //
 
   snprintf(name, sizeof(name), "cups%sDither", ink);
 
@@ -174,36 +172,36 @@ ppdLutLoad(ppd_file_t *ppd,               /* I - PPD file */
 }
 
 
-/*
- * 'ppdRGBLoad()' - Load a RGB color profile from a PPD file.
- */
+//
+// 'ppdRGBLoad()' - Load a RGB color profile from a PPD file.
+//
 
-cf_rgb_t *                             /* O - New color profile */
-ppdRGBLoad(ppd_file_t *ppd,            /* I - PPD file */
-            const char *colormodel,    /* I - Color model */
-            const char *media,         /* I - Media type */
-            const char *resolution,    /* I - Resolution */
-           cf_logfunc_t log,       /* I - Log function */
-           void       *ld)             /* I - Log function data */
+cf_rgb_t *                             // O - New color profile
+ppdRGBLoad(ppd_file_t *ppd,            // I - PPD file
+            const char *colormodel,    // I - Color model
+            const char *media,         // I - Media type
+            const char *resolution,    // I - Resolution
+           cf_logfunc_t log,           // I - Log function
+           void       *ld)             // I - Log function data
 {
-  int          i,                      /* Looping var */
-               cube_size,              /* Size of color lookup cube */
-               num_channels,           /* Number of color channels */
-               num_samples;            /* Number of color samples */
-  cf_sample_t  *samples;               /* Color samples */
-  float                values[7];              /* Color sample values */
-  char         spec[IPP_MAX_NAME];     /* Profile name */
-  ppd_attr_t   *attr;                  /* Attribute from PPD file */
-  cf_rgb_t     *rgbptr;                /* RGB color profile */
-
-
- /*
-  * Find the following attributes:
-  *
-  *    cupsRGBProfile  - Specifies the cube size, number of channels, and
-  *                      number of samples
-  *    cupsRGBSample   - Specifies an RGB to CMYK color sample
-  */
+  int          i,                      // Looping var
+               cube_size,              // Size of color lookup cube
+               num_channels,           // Number of color channels
+               num_samples;            // Number of color samples
+  cf_sample_t  *samples;               // Color samples
+  float                values[7];              // Color sample values
+  char         spec[IPP_MAX_NAME];     // Profile name
+  ppd_attr_t   *attr;                  // Attribute from PPD file
+  cf_rgb_t     *rgbptr;                // RGB color profile
+
+
+  //
+  // Find the following attributes:
+  //
+  //    cupsRGBProfile  - Specifies the cube size, number of channels, and
+  //                      number of samples
+  //    cupsRGBSample   - Specifies an RGB to CMYK color sample
+  //
 
   if ((attr = ppdFindColorAttr(ppd, "cupsRGBProfile", colormodel, media,
                            resolution, spec, sizeof(spec), log, ld)) == NULL)
@@ -232,9 +230,9 @@ ppdRGBLoad(ppd_file_t *ppd,         /* I - PPD file */
     return (NULL);
   }
 
- /*
-  * Allocate memory for the samples and read them...
-  */
+  //
+  // Allocate memory for the samples and read them...
+  //
 
   if ((samples = calloc(num_samples, sizeof(cf_sample_t))) == NULL)
   {
@@ -243,9 +241,9 @@ ppdRGBLoad(ppd_file_t *ppd,         /* I - PPD file */
     return (NULL);
   }
 
- /*
-  * Read all of the samples...
-  */
+  //
+  // Read all of the samples...
+  //
 
   for (i = 0; i < num_samples; i ++)
     if ((attr = ppdFindNextAttr(ppd, "cupsRGBSample", spec)) == NULL)
@@ -278,18 +276,18 @@ ppdRGBLoad(ppd_file_t *ppd,               /* I - PPD file */
        samples[i].colors[3] = (int)(255.0 * values[6] + 0.5);
     }
 
- /*
-  * If everything went OK, create the color profile...
-  */
+  //
+  // If everything went OK, create the color profile...
+  //
 
   if (i == num_samples)
     rgbptr = cfRGBNew(num_samples, samples, cube_size, num_channels);
   else
     rgbptr = NULL;
 
- /*
-  * Free the temporary sample array and return...
-  */
+  //
+  // Free the temporary sample array and return...
+  //
 
   free(samples);
 
@@ -297,79 +295,80 @@ ppdRGBLoad(ppd_file_t *ppd,               /* I - PPD file */
 }
 
 
-/*
- * 'ppdCMYKLoad()' - Load a CMYK color profile from PPD attributes.
- */
+//
+// 'ppdCMYKLoad()' - Load a CMYK color profile from PPD attributes.
+//
 
-cf_cmyk_t *                            /* O - CMYK color separation */
-ppdCMYKLoad(ppd_file_t *ppd,           /* I - PPD file */
-            const char *colormodel,    /* I - ColorModel value */
-            const char *media,         /* I - MediaType value */
-            const char *resolution,    /* I - Resolution value */
-            cf_logfunc_t log,      /* I - Log function */
-            void       *ld)            /* I - Log function data */
+cf_cmyk_t *                            // O - CMYK color separation
+ppdCMYKLoad(ppd_file_t *ppd,           // I - PPD file
+            const char *colormodel,    // I - ColorModel value
+            const char *media,         // I - MediaType value
+            const char *resolution,    // I - Resolution value
+            cf_logfunc_t log,          // I - Log function
+            void       *ld)            // I - Log function data
 {
-  cf_cmyk_t    *cmyk;                  /* CMYK color separation */
-  char         spec[IPP_MAX_NAME];     /* Profile name */
-  ppd_attr_t   *attr;                  /* Attribute from PPD file */
-  int          num_channels;           /* Number of color components */
-  float                gamval,                 /* Gamma correction value */
-               density,                /* Density value */
-               light,                  /* Light ink limit */
-               dark,                   /* Light ink cut-off */
-               lower,                  /* Start of black ink */
-               upper;                  /* End of color ink */
-  int          num_xypoints;           /* Number of X,Y points */
-  float                xypoints[100 * 2],      /* X,Y points */
-               *xyptr;                 /* Current X,Y point */
-
-
- /*
-  * Range check input...
-  */
+  cf_cmyk_t    *cmyk;                  // CMYK color separation
+  char         spec[IPP_MAX_NAME];     // Profile name
+  ppd_attr_t   *attr;                  // Attribute from PPD file
+  int          num_channels;           // Number of color components
+  float                gamval,                 // Gamma correction value
+               density,                // Density value
+               light,                  // Light ink limit
+               dark,                   // Light ink cut-off
+               lower,                  // Start of black ink
+               upper;                  // End of color ink
+  int          num_xypoints;           // Number of X,Y points
+  float                xypoints[100 * 2],      // X,Y points
+               *xyptr;                 // Current X,Y point
+
+
+  //
+  // Range check input...
+  //
 
   if (ppd == NULL || colormodel == NULL || resolution == NULL || media == NULL)
     return (NULL);
 
- /*
-  * Find the following attributes:
-  *
-  *     cupsAllGamma          - Set default curve using gamma + density
-  *     cupsAllXY             - Set default curve using XY points
-  *     cupsBlackGamma        - Set black curve using gamma + density
-  *     cupsBlackGeneration   - Set black generation
-  *     cupsBlackLightDark    - Set black light/dark transition
-  *     cupsBlackXY           - Set black curve using XY points
-  *     cupsCyanGamma         - Set cyan curve using gamma + density
-  *     cupsCyanLightDark     - Set cyan light/dark transition
-  *     cupsCyanXY            - Set cyan curve using XY points
-  *     cupsInkChannels       - Set number of color channels
-  *     cupsInkLimit          - Set total ink limit
-  *     cupsLightBlackGamma   - Set light black curve using gamma + density
-  *     cupsLightBlackXY      - Set light black curve using XY points
-  *     cupsLightCyanGamma    - Set light cyan curve using gamma + density
-  *     cupsLightCyanXY       - Set light cyan curve using XY points
-  *     cupsLightMagentaGamma - Set light magenta curve using gamma + density
-  *     cupsLightMagentaXY    - Set light magenta curve using XY points
-  *     cupsMagentaGamma      - Set magenta curve using gamma + density
-  *     cupsMagentaLightDark  - Set magenta light/dark transition
-  *     cupsMagentaXY         - Set magenta curve using XY points
-  *     cupsYellowGamma       - Set yellow curve using gamma + density
-  *     cupsYellowXY          - Set yellow curve using XY points
-  *
-  * The only required attribute is cupsInkChannels.
-  *
-  * The *XY attributes have precedence over the *Gamma attributes, and
-  * the *Light* attributes have precedence over the corresponding
-  * *LightDark* attributes.
-  */
-
- /*
-  * Get the required cupsInkChannels attribute...
-  */
-
-  if ((attr = ppdFindColorAttr(ppd, "cupsInkChannels", colormodel, media,
-                           resolution, spec, sizeof(spec), log, ld)) == NULL)
+  //
+  // Find the following attributes:
+  //
+  //    cupsAllGamma          - Set default curve using gamma + density
+  //    cupsAllXY             - Set default curve using XY points
+  //    cupsBlackGamma        - Set black curve using gamma + density
+  //    cupsBlackGeneration   - Set black generation
+  //    cupsBlackLightDark    - Set black light/dark transition
+  //    cupsBlackXY           - Set black curve using XY points
+  //    cupsCyanGamma         - Set cyan curve using gamma + density
+  //    cupsCyanLightDark     - Set cyan light/dark transition
+  //    cupsCyanXY            - Set cyan curve using XY points
+  //    cupsInkChannels       - Set number of color channels
+  //    cupsInkLimit          - Set total ink limit
+  //    cupsLightBlackGamma   - Set light black curve using gamma + density
+  //    cupsLightBlackXY      - Set light black curve using XY points
+  //    cupsLightCyanGamma    - Set light cyan curve using gamma + density
+  //    cupsLightCyanXY       - Set light cyan curve using XY points
+  //    cupsLightMagentaGamma - Set light magenta curve using gamma + density
+  //    cupsLightMagentaXY    - Set light magenta curve using XY points
+  //    cupsMagentaGamma      - Set magenta curve using gamma + density
+  //    cupsMagentaLightDark  - Set magenta light/dark transition
+  //    cupsMagentaXY         - Set magenta curve using XY points
+  //    cupsYellowGamma       - Set yellow curve using gamma + density
+  //    cupsYellowXY          - Set yellow curve using XY points
+  //
+  // The only required attribute is cupsInkChannels.
+  //
+  // The *XY attributes have precedence over the *Gamma attributes, and
+  // the *Light* attributes have precedence over the corresponding
+  // *LightDark* attributes.
+  //
+
+  //
+  // Get the required cupsInkChannels attribute...
+  //
+
+  if ((attr =
+       ppdFindColorAttr(ppd, "cupsInkChannels", colormodel, media,
+                       resolution, spec, sizeof(spec), log, ld)) == NULL)
     return (NULL);
 
   num_channels = atoi(attr->value);
@@ -380,17 +379,17 @@ ppdCMYKLoad(ppd_file_t *ppd,              /* I - PPD file */
   if ((cmyk = cfCMYKNew(num_channels)) == NULL)
     return (NULL);
 
- /*
-  * Get the optional cupsInkLimit attribute...
-  */
+  //
+  // Get the optional cupsInkLimit attribute...
+  //
 
   if ((attr = ppdFindColorAttr(ppd, "cupsInkLimit", colormodel, media,
                            resolution, spec, sizeof(spec), log, ld)) != NULL)
     cfCMYKSetInkLimit(cmyk, atof(attr->value));
 
- /*
-  * Get the optional cupsBlackGeneration attribute...
-  */
+  //
+  // Get the optional cupsBlackGeneration attribute...
+  //
 
   if ((attr = ppdFindColorAttr(ppd, "cupsBlackGeneration", colormodel, media,
                            resolution, spec, sizeof(spec), log, ld)) != NULL)
@@ -399,9 +398,9 @@ ppdCMYKLoad(ppd_file_t *ppd,                /* I - PPD file */
       cfCMYKSetBlack(cmyk, lower, upper, log, ld);
   }
 
- /*
-  * Get the optional cupsBlackXY or cupsBlackGamma attributes...
-  */
+  //
+  // Get the optional cupsBlackXY or cupsBlackGamma attributes...
+  //
 
   if (num_channels != 3)
   {
@@ -505,9 +504,9 @@ ppdCMYKLoad(ppd_file_t *ppd,                /* I - PPD file */
 
   if (num_channels > 2)
   {
-   /*
-    * Get the optional cupsCyanXY or cupsCyanGamma attributes...
-    */
+    //
+    // Get the optional cupsCyanXY or cupsCyanGamma attributes...
+    //
 
     if ((attr = ppdFindColorAttr(ppd, "cupsCyanXY", colormodel, media,
                              resolution, spec, sizeof(spec), log, ld)) != NULL)
@@ -553,9 +552,9 @@ ppdCMYKLoad(ppd_file_t *ppd,                /* I - PPD file */
        cfCMYKSetGamma(cmyk, 0, gamval, density, log, ld);
     }
 
-   /*
-    * Get the optional cupsMagentaXY or cupsMagentaGamma attributes...
-    */
+    //
+    // Get the optional cupsMagentaXY or cupsMagentaGamma attributes...
+    //
 
     if ((attr = ppdFindColorAttr(ppd, "cupsMagentaXY", colormodel, media,
                              resolution, spec, sizeof(spec), log, ld)) != NULL)
@@ -581,8 +580,9 @@ ppdCMYKLoad(ppd_file_t *ppd,                /* I - PPD file */
            break;
       }
     }
-    else if ((attr = ppdFindColorAttr(ppd, "cupsMagentaGamma", colormodel, media,
-                                  resolution, spec, sizeof(spec), log, ld)) !=
+    else if ((attr = ppdFindColorAttr(ppd, "cupsMagentaGamma", colormodel,
+                                     media, resolution, spec, sizeof(spec),
+                                     log, ld)) !=
             NULL)
     {
       if (sscanf(attr->value, "%f%f", &gamval, &density) == 2)
@@ -641,9 +641,9 @@ ppdCMYKLoad(ppd_file_t *ppd,                /* I - PPD file */
        }
     }
 
-   /*
-    * Get the optional cupsYellowXY or cupsYellowGamma attributes...
-    */
+    //
+    // Get the optional cupsYellowXY or cupsYellowGamma attributes...
+    //
 
     if ((attr = ppdFindColorAttr(ppd, "cupsYellowXY", colormodel, media,
                              resolution, spec, sizeof(spec), log, ld)) != NULL)
@@ -730,10 +730,10 @@ ppdCMYKLoad(ppd_file_t *ppd,              /* I - PPD file */
     }
   }
 
- /*
-  * Get the optional cupsLightBlackXY, cupsLightBlackGamma, or
-  * cupsBlackLtDk attributes...
-  */
+  //
+  // Get the optional cupsLightBlackXY, cupsLightBlackGamma, or
+  // cupsBlackLtDk attributes...
+  //
 
   if (num_channels == 2 || num_channels == 7)
   {
@@ -801,10 +801,10 @@ ppdCMYKLoad(ppd_file_t *ppd,              /* I - PPD file */
 
   if (num_channels >= 6)
   {
-   /*
-    * Get the optional cupsLightCyanXY, cupsLightCyanGamma, or
-    * cupsCyanLtDk attributes...
-    */
+    //
+    // Get the optional cupsLightCyanXY, cupsLightCyanGamma, or
+    // cupsCyanLtDk attributes...
+    //
 
     if ((attr = ppdFindColorAttr(ppd, "cupsLightCyanXY", colormodel, media,
                              resolution, spec, sizeof(spec), log, ld)) != NULL)
@@ -843,10 +843,10 @@ ppdCMYKLoad(ppd_file_t *ppd,              /* I - PPD file */
                   "No light cyan attribute found for %s!",
                   spec);
 
-   /*
-    * Get the optional cupsLightMagentaXY, cupsLightMagentaGamma, or
-    * cupsMagentaLtDk attributes...
-    */
+    //
+    // Get the optional cupsLightMagentaXY, cupsLightMagentaGamma, or
+    // cupsMagentaLtDk attributes...
+    //
 
     if ((attr = ppdFindColorAttr(ppd, "cupsLightMagentaXY", colormodel, media,
                              resolution, spec, sizeof(spec), log, ld)) != NULL)
@@ -886,9 +886,9 @@ ppdCMYKLoad(ppd_file_t *ppd,                /* I - PPD file */
                   spec);
   }
 
- /*
-  * Return the new profile...
-  */
+  //
+  // Return the new profile...
+  //
 
   return (cmyk);
 }
index ef34402187ed2fdae601cf35b11372e450665c28..a072d48a66cc8d1ddfde69b1bdb4a23897e187d7 100644 (file)
@@ -1,18 +1,18 @@
-/*
- * PPD localization routines for libppd.
- *
- * Copyright 2007-2018 by Apple Inc.
- * Copyright 1997-2007 by Easy Software Products, all rights reserved.
- *
- * Licensed under Apache License v2.0.  See the file "LICENSE" for more
- * information.
- *
- * PostScript is a trademark of Adobe Systems, Inc.
- */
-
-/*
- * Include necessary headers.
- */
+//
+// PPD localization routines for libppd.
+//
+// Copyright 2007-2018 by Apple Inc.
+// Copyright 1997-2007 by Easy Software Products, all rights reserved.
+//
+// Licensed under Apache License v2.0.  See the file "LICENSE" for more
+// information.
+//
+// PostScript is a trademark of Adobe Systems, Inc.
+//
+
+//
+// Include necessary headers.
+//
 
 #include "string-private.h"
 #include "language-private.h"
 #include "debug-internal.h"
 
 
-/*
- * Local functions...
- */
+//
+// Local functions...
+//
 
 static cups_lang_t     *ppd_ll_CC(char *ll_CC, size_t ll_CC_size);
 
 
-/*
- * 'ppdLocalize()' - Localize the PPD file to the current locale.
- *
- * All groups, options, and choices are localized, as are ICC profile
- * descriptions, printer presets, and custom option parameters.  Each
- * localized string uses the UTF-8 character encoding.
- *
- * @since CUPS 1.2/macOS 10.5@
- */
+//
+// 'ppdLocalize()' - Localize the PPD file to the current locale.
+//
+// All groups, options, and choices are localized, as are ICC profile
+// descriptions, printer presets, and custom option parameters.  Each
+// localized string uses the UTF-8 character encoding.
+//
+// @since CUPS 1.2/macOS 10.5@
+//
 
-int                                    /* O - 0 on success, -1 on error */
-ppdLocalize(ppd_file_t *ppd)           /* I - PPD file */
+int                                    // O - 0 on success, -1 on error
+ppdLocalize(ppd_file_t *ppd)           // I - PPD file
 {
-  int          i, j, k;                /* Looping vars */
-  ppd_group_t  *group;                 /* Current group */
-  ppd_option_t *option;                /* Current option */
-  ppd_choice_t *choice;                /* Current choice */
-  ppd_coption_t        *coption;               /* Current custom option */
-  ppd_cparam_t *cparam;                /* Current custom parameter */
-  ppd_attr_t   *attr,                  /* Current attribute */
-               *locattr;               /* Localized attribute */
-  char         ckeyword[PPD_MAX_NAME], /* Custom keyword */
-               ll_CC[6];               /* Language + country locale */
-
-
- /*
-  * Range check input...
-  */
+  int          i, j, k;                // Looping vars
+  ppd_group_t  *group;                 // Current group
+  ppd_option_t *option;                // Current option
+  ppd_choice_t *choice;                // Current choice
+  ppd_coption_t        *coption;               // Current custom option
+  ppd_cparam_t *cparam;                // Current custom parameter
+  ppd_attr_t   *attr,                  // Current attribute
+               *locattr;               // Localized attribute
+  char         ckeyword[PPD_MAX_NAME], // Custom keyword
+               ll_CC[6];               // Language + country locale
+
+
+  //
+  // Range check input...
+  //
 
   DEBUG_printf(("ppdLocalize(ppd=%p)", ppd));
 
   if (!ppd)
     return (-1);
 
- /*
-  * Get the default language...
-  */
+  //
+  // Get the default language...
+  //
 
   ppd_ll_CC(ll_CC, sizeof(ll_CC));
 
- /*
-  * Now lookup all of the groups, options, choices, etc.
-  */
+  //
+  // Now lookup all of the groups, options, choices, etc.
+  //
 
   for (i = ppd->num_groups, group = ppd->groups; i > 0; i --, group ++)
   {
@@ -77,7 +77,8 @@ ppdLocalize(ppd_file_t *ppd)          /* I - PPD file */
                                      ll_CC)) != NULL)
       strlcpy(group->text, locattr->text, sizeof(group->text));
 
-    for (j = group->num_options, option = group->options; j > 0; j --, option ++)
+    for (j = group->num_options, option = group->options; j > 0;
+        j --, option ++)
     {
       if ((locattr = ppdLocalizedAttr(ppd, "Translation", option->keyword,
                                        ll_CC)) != NULL)
@@ -104,9 +105,9 @@ ppdLocalize(ppd_file_t *ppd)                /* I - PPD file */
     }
   }
 
- /*
-  * Translate any custom parameters...
-  */
+  //
+  // Translate any custom parameters...
+  //
 
   for (coption = (ppd_coption_t *)cupsArrayFirst(ppd->coptions);
        coption;
@@ -125,9 +126,9 @@ ppdLocalize(ppd_file_t *ppd)                /* I - PPD file */
     }
   }
 
- /*
-  * Translate ICC profile names...
-  */
+  //
+  // Translate ICC profile names...
+  //
 
   if ((attr = ppdFindAttr(ppd, "APCustomColorMatchingName", NULL)) != NULL)
   {
@@ -149,9 +150,9 @@ ppdLocalize(ppd_file_t *ppd)                /* I - PPD file */
     cupsArrayRestore(ppd->sorted_attrs);
   }
 
- /*
-  * Translate printer presets...
-  */
+  //
+  // Translate printer presets...
+  //
 
   for (attr = ppdFindAttr(ppd, "APPrinterPreset", NULL);
        attr;
@@ -170,32 +171,34 @@ ppdLocalize(ppd_file_t *ppd)              /* I - PPD file */
 }
 
 
-/*
- * 'ppdLocalizeAttr()' - Localize an attribute.
- *
- * This function uses the current locale to find the localized attribute for
- * the given main and option keywords.  If no localized version of the
- * attribute exists for the current locale, the unlocalized version is returned.
- */
-
-ppd_attr_t *                           /* O - Localized attribute or @code NULL@ if none exists */
-ppdLocalizeAttr(ppd_file_t *ppd,       /* I - PPD file */
-               const char *keyword,    /* I - Main keyword */
-               const char *spec)       /* I - Option keyword or @code NULL@ for none */
+//
+// 'ppdLocalizeAttr()' - Localize an attribute.
+//
+// This function uses the current locale to find the localized attribute for
+// the given main and option keywords.  If no localized version of the
+// attribute exists for the current locale, the unlocalized version is returned.
+//
+
+ppd_attr_t *                           // O - Localized attribute or
+                                       //     @code NULL@ if none exists
+ppdLocalizeAttr(ppd_file_t *ppd,       // I - PPD file
+               const char *keyword,    // I - Main keyword
+               const char *spec)       // I - Option keyword or @code NULL@
+                                       //     for none
 {
-  ppd_attr_t   *locattr;               /* Localized attribute */
-  char         ll_CC[6];               /* Language + country locale */
+  ppd_attr_t   *locattr;               // Localized attribute
+  char         ll_CC[6];               // Language + country locale
 
 
- /*
-  * Get the default language...
-  */
+  //
+  // Get the default language...
+  //
 
   ppd_ll_CC(ll_CC, sizeof(ll_CC));
 
- /*
-  * Find the localized attribute...
-  */
+  //
+  // Find the localized attribute...
+  //
 
   if (spec)
     locattr = ppdLocalizedAttr(ppd, keyword, spec, ll_CC);
@@ -209,41 +212,41 @@ ppdLocalizeAttr(ppd_file_t *ppd,  /* I - PPD file */
 }
 
 
-/*
- * 'ppdLocalizeIPPReason()' - Get the localized version of a cupsIPPReason
- *                            attribute.
- *
- * This function uses the current locale to find the corresponding reason
- * text or URI from the attribute value. If "scheme" is NULL or "text",
- * the returned value contains human-readable (UTF-8) text from the translation
- * string or attribute value. Otherwise the corresponding URI is returned.
- *
- * If no value of the requested scheme can be found, NULL is returned.
- *
- * @since CUPS 1.3/macOS 10.5@
- */
-
-const char *                           /* O - Value or NULL if not found */
+//
+// 'ppdLocalizeIPPReason()' - Get the localized version of a cupsIPPReason
+//                            attribute.
+//
+// This function uses the current locale to find the corresponding reason
+// text or URI from the attribute value. If "scheme" is NULL or "text",
+// the returned value contains human-readable (UTF-8) text from the translation
+// string or attribute value. Otherwise the corresponding URI is returned.
+//
+// If no value of the requested scheme can be found, NULL is returned.
+//
+// @since CUPS 1.3/macOS 10.5@
+//
+
+const char *                           // O - Value or NULL if not found
 ppdLocalizeIPPReason(
-    ppd_file_t *ppd,                   /* I - PPD file */
-    const char *reason,                        /* I - IPP reason keyword to look up */
-    const char *scheme,                        /* I - URI scheme or NULL for text */
-    char       *buffer,                        /* I - Value buffer */
-    size_t     bufsize)                        /* I - Size of value buffer */
+    ppd_file_t *ppd,                   // I - PPD file
+    const char *reason,                        // I - IPP reason keyword to look up
+    const char *scheme,                        // I - URI scheme or NULL for text
+    char       *buffer,                        // I - Value buffer
+    size_t     bufsize)                        // I - Size of value buffer
 {
-  cups_lang_t  *lang;                  /* Current language */
-  ppd_attr_t   *locattr;               /* Localized attribute */
-  char         ll_CC[6],               /* Language + country locale */
-               *bufptr,                /* Pointer into buffer */
-               *bufend,                /* Pointer to end of buffer */
-               *valptr;                /* Pointer into value */
-  int          ch;                     /* Hex-encoded character */
-  size_t       schemelen;              /* Length of scheme name */
+  cups_lang_t  *lang;                  // Current language
+  ppd_attr_t   *locattr;               // Localized attribute
+  char         ll_CC[6],               // Language + country locale
+               *bufptr,                // Pointer into buffer
+               *bufend,                // Pointer to end of buffer
+               *valptr;                // Pointer into value
+  int          ch;                     // Hex-encoded character
+  size_t       schemelen;              // Length of scheme name
 
 
- /*
-  * Range check input...
-  */
+  //
+  // Range check input...
+  //
 
   if (buffer)
     *buffer = '\0';
@@ -252,15 +255,15 @@ ppdLocalizeIPPReason(
       !buffer || bufsize < PPD_MAX_TEXT)
     return (NULL);
 
- /*
-  * Get the default language...
-  */
+  //
+  // Get the default language...
+  //
 
   lang = ppd_ll_CC(ll_CC, sizeof(ll_CC));
 
- /*
-  * Find the localized attribute...
-  */
+  //
+  // Find the localized attribute...
+  //
 
   if ((locattr = ppdLocalizedAttr(ppd, "cupsIPPReason", reason,
                                    ll_CC)) == NULL)
@@ -270,16 +273,18 @@ ppdLocalizeIPPReason(
   {
     if (lang && (!scheme || !strcmp(scheme, "text")) && strcmp(reason, "none"))
     {
-     /*
-      * Try to localize a standard printer-state-reason keyword...
-      */
+      //
+      // Try to localize a standard printer-state-reason keyword...
+      //
 
-      char     msgid[1024],            /* State message identifier */
-               *ptr;                   /* Pointer to state suffix */
-      const char *message = NULL;      /* Localized message */
+      char     msgid[1024],            // State message identifier
+               *ptr;                   // Pointer to state suffix
+      const char *message = NULL;      // Localized message
 
       snprintf(msgid, sizeof(msgid), "printer-state-reasons.%s", reason);
-      if ((ptr = strrchr(msgid, '-')) != NULL && (!strcmp(ptr, "-error") || !strcmp(ptr, "-report") || !strcmp(ptr, "-warning")))
+      if ((ptr = strrchr(msgid, '-')) != NULL &&
+         (!strcmp(ptr, "-error") || !strcmp(ptr, "-report") ||
+          !strcmp(ptr, "-warning")))
         *ptr = '\0';
 
       message = _ppdLangString(lang, msgid);
@@ -294,18 +299,18 @@ ppdLocalizeIPPReason(
     return (NULL);
   }
 
- /*
-  * Now find the value we need...
-  */
+  //
+  // Now find the value we need...
+  //
 
   bufend = buffer + bufsize - 1;
 
   if (!scheme || !strcmp(scheme, "text"))
   {
-   /*
-    * Copy a text value (either the translation text or text:... URIs from
-    * the value...
-    */
+    //
+    // Copy a text value (either the translation text or text:... URIs from
+    // the value...
+    //
 
     strlcpy(buffer, locattr->text, bufsize);
 
@@ -313,9 +318,9 @@ ppdLocalizeIPPReason(
     {
       if (!strncmp(valptr, "text:", 5))
       {
-       /*
-        * Decode text: URI and add to the buffer...
-       */
+       //
+        // Decode text: URI and add to the buffer...
+       //
 
        valptr += 5;
 
@@ -324,9 +329,9 @@ ppdLocalizeIPPReason(
          if (*valptr == '%' && isxdigit(valptr[1] & 255) &&
              isxdigit(valptr[2] & 255))
          {
-          /*
-           * Pull a hex-encoded character from the URI...
-           */
+           //
+           // Pull a hex-encoded character from the URI...
+           //
 
             valptr ++;
 
@@ -353,17 +358,17 @@ ppdLocalizeIPPReason(
       }
       else
       {
-       /*
-        * Skip this URI...
-       */
+       //
+        // Skip this URI...
+       //
 
         while (*valptr && !_ppd_isspace(*valptr))
           valptr++;
       }
 
-     /*
-      * Skip whitespace...
-      */
+      //
+      // Skip whitespace...
+      //
 
       while (_ppd_isspace(*valptr))
        valptr ++;
@@ -376,12 +381,12 @@ ppdLocalizeIPPReason(
   }
   else
   {
-   /*
-    * Copy a URI...
-    */
+    //
+    // Copy a URI...
+    //
 
     schemelen = strlen(scheme);
-    if (scheme[schemelen - 1] == ':')  /* Force scheme to be just the name */
+    if (scheme[schemelen - 1] == ':')  // Force scheme to be just the name
       schemelen --;
 
     for (valptr = locattr->value, bufptr = buffer; *valptr && bufptr < bufend;)
@@ -389,9 +394,9 @@ ppdLocalizeIPPReason(
       if ((!strncmp(valptr, scheme, schemelen) && valptr[schemelen] == ':') ||
           (*valptr == '/' && !strcmp(scheme, "file")))
       {
-       /*
-        * Copy URI...
-       */
+       //
+        // Copy URI...
+       //
 
         while (*valptr && !_ppd_isspace(*valptr) && bufptr < bufend)
          *bufptr++ = *valptr++;
@@ -402,17 +407,17 @@ ppdLocalizeIPPReason(
       }
       else
       {
-       /*
-        * Skip this URI...
-       */
+       //
+        // Skip this URI...
+       //
 
        while (*valptr && !_ppd_isspace(*valptr))
          valptr++;
       }
 
-     /*
-      * Skip whitespace...
-      */
+      //
+      // Skip whitespace...
+      //
 
       while (_ppd_isspace(*valptr))
        valptr ++;
@@ -423,42 +428,42 @@ ppdLocalizeIPPReason(
 }
 
 
-/*
- * 'ppdLocalizeMarkerName()' - Get the localized version of a marker-names
- *                             attribute value.
- *
- * This function uses the current locale to find the corresponding name
- * text from the attribute value. If no localized text for the requested
- * name can be found, @code NULL@ is returned.
- *
- * @since CUPS 1.4/macOS 10.6@
- */
+//
+// 'ppdLocalizeMarkerName()' - Get the localized version of a marker-names
+//                             attribute value.
+//
+// This function uses the current locale to find the corresponding name
+// text from the attribute value. If no localized text for the requested
+// name can be found, @code NULL@ is returned.
+//
+// @since CUPS 1.4/macOS 10.6@
+//
 
-const char *                           /* O - Value or @code NULL@ if not found */
+const char *                           // O - Value or @code NULL@ if not found
 ppdLocalizeMarkerName(
-    ppd_file_t *ppd,                   /* I - PPD file */
-    const char *name)                  /* I - Marker name to look up */
+    ppd_file_t *ppd,                   // I - PPD file
+    const char *name)                  // I - Marker name to look up
 {
-  ppd_attr_t   *locattr;               /* Localized attribute */
-  char         ll_CC[6];               /* Language + country locale */
+  ppd_attr_t   *locattr;               // Localized attribute
+  char         ll_CC[6];               // Language + country locale
 
 
- /*
-  * Range check input...
-  */
+  //
+  // Range check input...
+  //
 
   if (!ppd || !name)
     return (NULL);
 
- /*
-  * Get the default language...
-  */
+  //
+  // Get the default language...
+  //
 
   ppd_ll_CC(ll_CC, sizeof(ll_CC));
 
- /*
-  * Find the localized attribute...
-  */
+  //
+  // Find the localized attribute...
+  //
 
   if ((locattr = ppdLocalizedAttr(ppd, "cupsMarkerName", name,
                                    ll_CC)) == NULL)
@@ -468,15 +473,15 @@ ppdLocalizeMarkerName(
 }
 
 
-/*
- * 'ppdFreeLanguages()' - Free an array of languages from ppdGetLanguages.
- */
+//
+// 'ppdFreeLanguages()' - Free an array of languages from ppdGetLanguages.
+//
 
 void
 ppdFreeLanguages(
-    cups_array_t *languages)           /* I - Languages array */
+    cups_array_t *languages)           // I - Languages array
 {
-  char *language;                      /* Current language */
+  char *language;                      // Current language
 
 
   for (language = (char *)cupsArrayFirst(languages);
@@ -488,30 +493,30 @@ ppdFreeLanguages(
 }
 
 
-/*
- * 'ppdGetLanguages()' - Get an array of languages from a PPD file.
- */
+//
+// 'ppdGetLanguages()' - Get an array of languages from a PPD file.
+//
 
-cups_array_t *                         /* O - Languages array */
-ppdGetLanguages(ppd_file_t *ppd)       /* I - PPD file */
+cups_array_t *                         // O - Languages array
+ppdGetLanguages(ppd_file_t *ppd)       // I - PPD file
 {
-  cups_array_t *languages;             /* Languages array */
-  ppd_attr_t   *attr;                  /* cupsLanguages attribute */
-  char         *value,                 /* Copy of attribute value */
-               *start,                 /* Start of current language */
-               *ptr;                   /* Pointer into languages */
+  cups_array_t *languages;             // Languages array
+  ppd_attr_t   *attr;                  // cupsLanguages attribute
+  char         *value,                 // Copy of attribute value
+               *start,                 // Start of current language
+               *ptr;                   // Pointer into languages
 
 
- /*
-  * See if we have a cupsLanguages attribute...
-  */
+  //
+  // See if we have a cupsLanguages attribute...
+  //
 
   if ((attr = ppdFindAttr(ppd, "cupsLanguages", NULL)) == NULL || !attr->value)
     return (NULL);
 
- /*
-  * Yes, load the list...
-  */
+  //
+  // Yes, load the list...
+  //
 
   if ((languages = cupsArrayNew((cups_array_func_t)strcmp, NULL)) == NULL)
     return (NULL);
@@ -524,9 +529,9 @@ ppdGetLanguages(ppd_file_t *ppd)    /* I - PPD file */
 
   for (ptr = value; *ptr;)
   {
-   /*
-    * Skip leading whitespace...
-    */
+    //
+    // Skip leading whitespace...
+    //
 
     while (_ppd_isspace(*ptr))
       ptr ++;
@@ -534,9 +539,9 @@ ppdGetLanguages(ppd_file_t *ppd)    /* I - PPD file */
     if (!*ptr)
       break;
 
-   /*
-    * Find the end of this language name...
-    */
+    //
+    // Find the end of this language name...
+    //
 
     for (start = ptr; *ptr && !_ppd_isspace(*ptr); ptr ++);
 
@@ -549,10 +554,10 @@ ppdGetLanguages(ppd_file_t *ppd)  /* I - PPD file */
     cupsArrayAdd(languages, strdup(start));
   }
 
- /*
-  * Free the temporary string and return either an array with one or more
-  * values or a NULL pointer...
-  */
+  //
+  // Free the temporary string and return either an array with one or more
+  // values or a NULL pointer...
+  //
 
   free(value);
 
@@ -566,18 +571,18 @@ ppdGetLanguages(ppd_file_t *ppd)  /* I - PPD file */
 }
 
 
-/*
- * 'ppdHashName()' - Generate a hash value for a device or profile name.
- *
- * This function is primarily used on macOS, but is generally accessible
- * since cupstestppd needs to check for profile name collisions in PPD files...
- */
+//
+// 'ppdHashName()' - Generate a hash value for a device or profile name.
+//
+// This function is primarily used on macOS, but is generally accessible
+// since cupstestppd needs to check for profile name collisions in PPD files...
+//
 
-unsigned                               /* O - Hash value */
-ppdHashName(const char *name)          /* I - Name to hash */
+unsigned                               // O - Hash value
+ppdHashName(const char *name)          // I - Name to hash
 {
-  unsigned     mult,                   /* Multiplier */
-               hash = 0;               /* Hash value */
+  unsigned     mult,                   // Multiplier
+               hash = 0;               // Hash value
 
 
   for (mult = 1; *name && mult <= 128; mult ++, name ++)
@@ -587,35 +592,35 @@ ppdHashName(const char *name)             /* I - Name to hash */
 }
 
 
-/*
- * 'ppdLocalizedAttr()' - Find a localized attribute.
- */
+//
+// 'ppdLocalizedAttr()' - Find a localized attribute.
+//
 
-ppd_attr_t *                           /* O - Localized attribute or NULL */
-ppdLocalizedAttr(ppd_file_t *ppd,      /* I - PPD file */
-                 const char *keyword,  /* I - Main keyword */
-                 const char *spec,     /* I - Option keyword */
-                 const char *ll_CC)    /* I - Language + country locale */
+ppd_attr_t *                           // O - Localized attribute or NULL
+ppdLocalizedAttr(ppd_file_t *ppd,      // I - PPD file
+                 const char *keyword,  // I - Main keyword
+                 const char *spec,     // I - Option keyword
+                 const char *ll_CC)    // I - Language + country locale
 {
-  char         lkeyword[PPD_MAX_NAME]; /* Localization keyword */
-  ppd_attr_t   *attr;                  /* Current attribute */
+  char         lkeyword[PPD_MAX_NAME]; // Localization keyword
+  ppd_attr_t   *attr;                  // Current attribute
 
 
   DEBUG_printf(("4ppdLocalizedAttr(ppd=%p, keyword=\"%s\", spec=\"%s\", "
                 "ll_CC=\"%s\")", ppd, keyword, spec, ll_CC));
 
- /*
-  * Look for Keyword.ll_CC, then Keyword.ll...
-  */
+  //
+  // Look for Keyword.ll_CC, then Keyword.ll...
+  //
 
   snprintf(lkeyword, sizeof(lkeyword), "%s.%s", ll_CC, keyword);
   if ((attr = ppdFindAttr(ppd, lkeyword, spec)) == NULL)
   {
-   /*
-    * <rdar://problem/22130168>
-    *
-    * Multiple locales need special handling...  Sigh...
-    */
+    //
+    // <rdar://problem/22130168>
+    //
+    // Multiple locales need special handling...  Sigh...
+    //
 
     if (!strcmp(ll_CC, "zh_HK"))
     {
@@ -633,34 +638,34 @@ ppdLocalizedAttr(ppd_file_t *ppd, /* I - PPD file */
     {
       if (!strncmp(ll_CC, "ja", 2))
       {
-       /*
-       * Due to a bug in the CUPS DDK 1.1.0 ppdmerge program, Japanese
-       * PPD files were incorrectly assigned "jp" as the locale name
-       * instead of "ja".  Support both the old (incorrect) and new
-       * locale names for Japanese...
-       */
+       //
+       // Due to a bug in the CUPS DDK 1.1.0 ppdmerge program, Japanese
+       // PPD files were incorrectly assigned "jp" as the locale name
+       // instead of "ja".  Support both the old (incorrect) and new
+       // locale names for Japanese...
+       //
 
        snprintf(lkeyword, sizeof(lkeyword), "jp.%s", keyword);
        attr = ppdFindAttr(ppd, lkeyword, spec);
       }
       else if (!strncmp(ll_CC, "nb", 2))
       {
-       /*
-       * Norway has two languages, "Bokmal" (the primary one)
-       * and "Nynorsk" (new Norwegian); this code maps from the (currently)
-       * recommended "nb" to the previously recommended "no"...
-       */
+       //
+       // Norway has two languages, "Bokmal" (the primary one)
+       // and "Nynorsk" (new Norwegian); this code maps from the (currently)
+       // recommended "nb" to the previously recommended "no"...
+       //
 
        snprintf(lkeyword, sizeof(lkeyword), "no.%s", keyword);
        attr = ppdFindAttr(ppd, lkeyword, spec);
       }
       else if (!strncmp(ll_CC, "no", 2))
       {
-       /*
-       * Norway has two languages, "Bokmal" (the primary one)
-       * and "Nynorsk" (new Norwegian); we map "no" to "nb" here as
-       * recommended by the locale folks...
-       */
+       //
+       // Norway has two languages, "Bokmal" (the primary one)
+       // and "Nynorsk" (new Norwegian); we map "no" to "nb" here as
+       // recommended by the locale folks...
+       //
 
        snprintf(lkeyword, sizeof(lkeyword), "nb.%s", keyword);
        attr = ppdFindAttr(ppd, lkeyword, spec);
@@ -674,26 +679,26 @@ ppdLocalizedAttr(ppd_file_t *ppd, /* I - PPD file */
                   attr->spec, attr->text, attr->value ? attr->value : ""));
   else
     DEBUG_puts("5ppdLocalizedAttr: NOT FOUND");
-#endif /* DEBUG */
+#endif // DEBUG
 
   return (attr);
 }
 
 
-/*
- * 'ppd_ll_CC()' - Get the current locale names.
- */
+//
+// 'ppd_ll_CC()' - Get the current locale names.
+//
 
-static cups_lang_t *                   /* O - Current language */
-ppd_ll_CC(char   *ll_CC,               /* O - Country-specific locale name */
-          size_t ll_CC_size)           /* I - Size of country-specific name */
+static cups_lang_t *                   // O - Current language
+ppd_ll_CC(char   *ll_CC,               // O - Country-specific locale name
+          size_t ll_CC_size)           // I - Size of country-specific name
 {
-  cups_lang_t  *lang;                  /* Current language */
+  cups_lang_t  *lang;                  // Current language
 
 
- /*
-  * Get the current locale...
-  */
+  //
+  // Get the current locale...
+  //
 
   if ((lang = cupsLangDefault()) == NULL)
   {
@@ -701,18 +706,18 @@ ppd_ll_CC(char   *ll_CC,          /* O - Country-specific locale name */
     return (NULL);
   }
 
- /*
-  * Copy the locale name...
-  */
+  //
+  // Copy the locale name...
+  //
 
   strlcpy(ll_CC, lang->language, ll_CC_size);
 
   if (strlen(ll_CC) == 2)
   {
-   /*
-    * Map "ll" to primary/origin country locales to have the best
-    * chance of finding a match...
-    */
+    //
+    // Map "ll" to primary/origin country locales to have the best
+    // chance of finding a match...
+    //
 
     if (!strcmp(ll_CC, "cs"))
       strlcpy(ll_CC, "cs_CZ", ll_CC_size);
@@ -722,7 +727,7 @@ ppd_ll_CC(char   *ll_CC,            /* O - Country-specific locale name */
       strlcpy(ll_CC, "ja_JP", ll_CC_size);
     else if (!strcmp(ll_CC, "sv"))
       strlcpy(ll_CC, "sv_SE", ll_CC_size);
-    else if (!strcmp(ll_CC, "zh"))     /* Simplified Chinese */
+    else if (!strcmp(ll_CC, "zh"))     // Simplified Chinese
       strlcpy(ll_CC, "zh_CN", ll_CC_size);
   }
 
index c33075b83db0bb8874b9509ba9ce7ad40337dda6..748530f1fc1e1d937641faedeefcbb5625b659be 100644 (file)
@@ -1,83 +1,83 @@
-/*
- * Option marking routines for libppd.
- *
- * Copyright © 2007-2019 by Apple Inc.
- * Copyright © 1997-2007 by Easy Software Products, all rights reserved.
- *
- * Licensed under Apache License v2.0.  See the file "LICENSE" for more
- * information.
- *
- * PostScript is a trademark of Adobe Systems, Inc.
- */
-
-/*
- * Include necessary headers...
- */
+//
+// Option marking routines for libppd.
+//
+// Copyright © 2007-2019 by Apple Inc.
+// Copyright © 1997-2007 by Easy Software Products, all rights reserved.
+//
+// Licensed under Apache License v2.0.  See the file "LICENSE" for more
+// information.
+//
+// PostScript is a trademark of Adobe Systems, Inc.
+//
+
+//
+// Include necessary headers...
+//
 
 #include "string-private.h"
 #include "ppd.h"
 #include "debug-internal.h"
 
 
-/*
- * Local functions...
- */
+//
+// Local functions...
+//
 
 #ifdef DEBUG
 static void    ppd_debug_marked(ppd_file_t *ppd, const char *title);
 #else
 #  define      ppd_debug_marked(ppd,title)
-#endif /* DEBUG */
+#endif // DEBUG
 static void    ppd_defaults(ppd_file_t *ppd, ppd_group_t *g);
 static void    ppd_mark_choices(ppd_file_t *ppd, const char *s);
 static void    ppd_mark_option(ppd_file_t *ppd, const char *option,
                                const char *choice);
 
 
-/*
- * 'ppdMarkOptions()' - Mark command-line options in a PPD file.
- *
- * This function maps the IPP "finishings", "media", "mirror",
- * "multiple-document-handling", "output-bin", "print-color-mode",
- * "print-quality", "printer-resolution", and "sides" attributes to their
- * corresponding PPD options and choices.
- */
+//
+// 'ppdMarkOptions()' - Mark command-line options in a PPD file.
+//
+// This function maps the IPP "finishings", "media", "mirror",
+// "multiple-document-handling", "output-bin", "print-color-mode",
+// "print-quality", "printer-resolution", and "sides" attributes to their
+// corresponding PPD options and choices.
+//
 
-int                                    /* O - 1 if conflicts exist, 0 otherwise */
+int                                    // O - 1 if conflicts exist, 0 otherwise
 ppdMarkOptions(
-    ppd_file_t    *ppd,                        /* I - PPD file */
-    int           num_options,         /* I - Number of options */
-    cups_option_t *options)            /* I - Options */
+    ppd_file_t    *ppd,                        // I - PPD file
+    int           num_options,         // I - Number of options
+    cups_option_t *options)            // I - Options
 {
-  int          i, j;                   /* Looping vars */
-  char         *ptr,                   /* Pointer into string */
-               s[255];                 /* Temporary string */
-  const char   *val,                   /* Pointer into value */
-               *media,                 /* media option */
-               *output_bin,            /* output-bin option */
-               *page_size,             /* PageSize option */
-               *ppd_keyword,           /* PPD keyword */
-               *print_color_mode,      /* print-color-mode option */
-               *print_quality,         /* print-quality option */
-               *sides;                 /* sides option */
-  cups_option_t        *optptr;                /* Current option */
-  ppd_attr_t   *attr;                  /* PPD attribute */
-  ppd_cache_t  *cache;                 /* PPD cache and mapping data */
-
-
- /*
-  * Check arguments...
-  */
+  int          i, j;                   // Looping vars
+  char         *ptr,                   // Pointer into string
+               s[255];                 // Temporary string
+  const char   *val,                   // Pointer into value
+               *media,                 // media option
+               *output_bin,            // output-bin option
+               *page_size,             // PageSize option
+               *ppd_keyword,           // PPD keyword
+               *print_color_mode,      // print-color-mode option
+               *print_quality,         // print-quality option
+               *sides;                 // sides option
+  cups_option_t        *optptr;                // Current option
+  ppd_attr_t   *attr;                  // PPD attribute
+  ppd_cache_t  *cache;                 // PPD cache and mapping data
+
+
+  //
+  // Check arguments...
+  //
 
   if (!ppd || num_options <= 0 || !options)
     return (0);
 
   ppd_debug_marked(ppd, "Before...");
 
- /*
-  * Do special handling for finishings, media, output-bin, output-mode,
-  * print-color-mode, print-quality, and PageSize...
-  */
+  //
+  // Do special handling for finishings, media, output-bin, output-mode,
+  // print-color-mode, print-quality, and PageSize...
+  //
 
   media         = cupsGetOption("media", num_options, options);
   output_bin    = cupsGetOption("output-bin", num_options, options);
@@ -92,9 +92,9 @@ ppdMarkOptions(
   if ((media || output_bin || print_color_mode || print_quality || sides) &&
       !ppd->cache)
   {
-   /*
-    * Load PPD cache and mapping data as needed...
-    */
+    //
+    // Load PPD cache and mapping data as needed...
+    //
 
     ppd->cache = ppdCacheCreateWithPPD(ppd);
   }
@@ -103,21 +103,21 @@ ppdMarkOptions(
 
   if (media)
   {
-   /*
-    * Loop through the option string, separating it at commas and marking each
-    * individual option as long as the corresponding PPD option (PageSize,
-    * InputSlot, etc.) is not also set.
-    *
-    * For PageSize, we also check for an empty option value since some versions
-    * of macOS use it to specify auto-selection of the media based solely on
-    * the size.
-    */
+    //
+    // Loop through the option string, separating it at commas and marking each
+    // individual option as long as the corresponding PPD option (PageSize,
+    // InputSlot, etc.) is not also set.
+    //
+    // For PageSize, we also check for an empty option value since some versions
+    // of macOS use it to specify auto-selection of the media based solely on
+    // the size.
+    //
 
     for (val = media; *val;)
     {
-     /*
-      * Extract the sub-option from the string...
-      */
+      //
+      // Extract the sub-option from the string...
+      //
 
       for (ptr = s; *val && *val != ',' && (size_t)(ptr - s) < (sizeof(s) - 1);)
        *ptr++ = *val++;
@@ -126,15 +126,16 @@ ppdMarkOptions(
       if (*val == ',')
        val ++;
 
-     /*
-      * Mark it...
-      */
+      //
+      // Mark it...
+      //
 
       if (!page_size || !page_size[0])
       {
         if (!_ppd_strncasecmp(s, "Custom.", 7) || ppdPageSize(ppd, s))
           ppd_mark_option(ppd, "PageSize", s);
-        else if ((ppd_keyword = ppdCacheGetPageSize(cache, NULL, s, NULL)) != NULL)
+        else if ((ppd_keyword = ppdCacheGetPageSize(cache, NULL, s, NULL)) !=
+                NULL)
          ppd_mark_option(ppd, "PageSize", ppd_keyword);
       }
 
@@ -156,13 +157,13 @@ ppdMarkOptions(
         !cupsGetOption("APPrinterPreset", num_options, options) &&
         (print_color_mode || print_quality))
     {
-     /*
-      * Map output-mode and print-quality to a preset...
-      */
+      //
+      // Map output-mode and print-quality to a preset...
+      //
 
-      ppd_pwg_print_color_mode_t       pwg_pcm;/* print-color-mode index */
-      ppd_pwg_print_quality_t  pwg_pq; /* print-quality index */
-      cups_option_t            *preset;/* Current preset option */
+      ppd_pwg_print_color_mode_t       pwg_pcm;// print-color-mode index
+      ppd_pwg_print_quality_t  pwg_pq; // print-quality index
+      cups_option_t            *preset;// Current preset option
 
       if (print_color_mode && !strcmp(print_color_mode, "monochrome"))
        pwg_pcm = PPD_PWG_PRINT_COLOR_MODE_MONOCHROME;
@@ -171,7 +172,8 @@ ppdMarkOptions(
 
       if (print_quality)
       {
-       pwg_pq = (ppd_pwg_print_quality_t)(atoi(print_quality) - IPP_QUALITY_DRAFT);
+       pwg_pq = (ppd_pwg_print_quality_t)(atoi(print_quality) -
+                                          IPP_QUALITY_DRAFT);
        if (pwg_pq < PPD_PWG_PRINT_QUALITY_DRAFT)
          pwg_pq = PPD_PWG_PRINT_QUALITY_DRAFT;
        else if (pwg_pq > PPD_PWG_PRINT_QUALITY_HIGH)
@@ -182,10 +184,10 @@ ppdMarkOptions(
 
       if (cache->num_presets[pwg_pcm][pwg_pq] == 0)
       {
-       /*
-       * Try to find a preset that works so that we maximize the chances of us
-       * getting a good print using IPP attributes.
-       */
+       //
+       // Try to find a preset that works so that we maximize the chances of us
+       // getting a good print using IPP attributes.
+       //
 
        if (cache->num_presets[pwg_pcm][PPD_PWG_PRINT_QUALITY_NORMAL] > 0)
          pwg_pq = PPD_PWG_PRINT_QUALITY_NORMAL;
@@ -200,10 +202,10 @@ ppdMarkOptions(
 
       if (cache->num_presets[pwg_pcm][pwg_pq] > 0)
       {
-       /*
-       * Copy the preset options as long as the corresponding names are not
-       * already defined in the IPP request...
-       */
+       //
+       // Copy the preset options as long as the corresponding names are not
+       // already defined in the IPP request...
+       //
 
        for (i = cache->num_presets[pwg_pcm][pwg_pq],
                 preset = cache->presets[pwg_pcm][pwg_pq];
@@ -219,9 +221,9 @@ ppdMarkOptions(
     if (output_bin && !cupsGetOption("OutputBin", num_options, options) &&
        (ppd_keyword = ppdCacheGetOutputBin(cache, output_bin)) != NULL)
     {
-     /*
-      * Map output-bin to OutputBin...
-      */
+      //
+      // Map output-bin to OutputBin...
+      //
 
       ppd_mark_option(ppd, "OutputBin", ppd_keyword);
     }
@@ -229,9 +231,9 @@ ppdMarkOptions(
     if (sides && cache->sides_option &&
         !cupsGetOption(cache->sides_option, num_options, options))
     {
-     /*
-      * Map sides to duplex option...
-      */
+      //
+      // Map sides to duplex option...
+      //
 
       if (!strcmp(sides, "one-sided") && cache->sides_1sided)
         ppd_mark_option(ppd, cache->sides_option, cache->sides_1sided);
@@ -244,9 +246,9 @@ ppdMarkOptions(
     }
   }
 
- /*
-  * Mark other options...
-  */
+  //
+  // Mark other options...
+  //
 
   for (i = num_options, optptr = options; i > 0; i --, optptr ++)
   {
@@ -261,18 +263,19 @@ ppdMarkOptions(
     {
       ppd_mark_option(ppd, "Resolution", optptr->value);
       ppd_mark_option(ppd, "SetResolution", optptr->value);
-       /* Calcomp, Linotype, QMS, Summagraphics, Tektronix, Varityper */
+       // Calcomp, Linotype, QMS, Summagraphics, Tektronix, Varityper
       ppd_mark_option(ppd, "JCLResolution", optptr->value);
-       /* HP */
+       // HP
       ppd_mark_option(ppd, "CNRes_PGP", optptr->value);
-       /* Canon */
+       // Canon
     }
     else if (!_ppd_strcasecmp(optptr->name, "multiple-document-handling"))
     {
       if (!cupsGetOption("Collate", num_options, options) &&
           ppdFindOption(ppd, "Collate"))
       {
-        if (_ppd_strcasecmp(optptr->value, "separate-documents-uncollated-copies"))
+        if (_ppd_strcasecmp(optptr->value,
+                           "separate-documents-uncollated-copies"))
          ppd_mark_option(ppd, "Collate", "True");
        else
          ppd_mark_option(ppd, "Collate", "False");
@@ -280,15 +283,15 @@ ppdMarkOptions(
     }
     else if (!_ppd_strcasecmp(optptr->name, "finishings"))
     {
-     /*
-      * Lookup cupsIPPFinishings attributes for each value...
-      */
+      //
+      // Lookup cupsIPPFinishings attributes for each value...
+     
 
       for (ptr = optptr->value; *ptr;)
       {
-       /*
-        * Get the next finishings number...
-       */
+       //
+        // Get the next finishings number...
+       //
 
         if (!isdigit(*ptr & 255))
          break;
@@ -296,40 +299,40 @@ ppdMarkOptions(
         if ((j = (int)strtol(ptr, &ptr, 10)) < 3)
          break;
 
-       /*
-        * Skip separator as needed...
-       */
+       //
+        // Skip separator as needed...
+       //
 
         if (*ptr == ',')
          ptr ++;
 
-       /*
-        * Look it up in the PPD file...
-       */
+       //
+        // Look it up in the PPD file...
+       //
 
        sprintf(s, "%d", j);
 
         if ((attr = ppdFindAttr(ppd, "cupsIPPFinishings", s)) == NULL)
          continue;
 
-       /*
-        * Apply "*Option Choice" settings from the attribute value...
-       */
+       //
+        // Apply "*Option Choice" settings from the attribute value...
+       //
 
         ppd_mark_choices(ppd, attr->value);
       }
     }
     else if (!_ppd_strcasecmp(optptr->name, "APPrinterPreset"))
     {
-     /*
-      * Lookup APPrinterPreset value...
-      */
+      //
+      // Lookup APPrinterPreset value...
+      //
 
       if ((attr = ppdFindAttr(ppd, "APPrinterPreset", optptr->value)) != NULL)
       {
-       /*
-        * Apply "*Option Choice" settings from the attribute value...
-       */
+       //
+        // Apply "*Option Choice" settings from the attribute value...
+       //
 
         ppd_mark_choices(ppd, attr->value);
       }
@@ -342,7 +345,7 @@ ppdMarkOptions(
 
   if (print_quality)
   {
-    int pq = atoi(print_quality);       /* print-quaity value */
+    int pq = atoi(print_quality);       // print-quaity value
 
     if (pq == IPP_QUALITY_DRAFT)
       ppd_mark_option(ppd, "cupsPrintQuality", "Draft");
@@ -358,16 +361,16 @@ ppdMarkOptions(
 }
 
 
-/*
- * 'ppdFindChoice()' - Return a pointer to an option choice.
- */
+//
+// 'ppdFindChoice()' - Return a pointer to an option choice.
+//
 
-ppd_choice_t *                         /* O - Choice pointer or @code NULL@ */
-ppdFindChoice(ppd_option_t *o,         /* I - Pointer to option */
-              const char   *choice)    /* I - Name of choice */
+ppd_choice_t *                         // O - Choice pointer or @code NULL@
+ppdFindChoice(ppd_option_t *o,         // I - Pointer to option
+              const char   *choice)    // I - Name of choice
 {
-  int          i;                      /* Looping var */
-  ppd_choice_t *c;                     /* Current choice */
+  int          i;                      // Looping var
+  ppd_choice_t *c;                     // Current choice
 
 
   if (!o || !choice)
@@ -384,16 +387,16 @@ ppdFindChoice(ppd_option_t *o,            /* I - Pointer to option */
 }
 
 
-/*
- * 'ppdFindMarkedChoice()' - Return the marked choice for the specified option.
- */
+//
+// 'ppdFindMarkedChoice()' - Return the marked choice for the specified option.
+//
 
-ppd_choice_t *                         /* O - Pointer to choice or @code NULL@ */
-ppdFindMarkedChoice(ppd_file_t *ppd,   /* I - PPD file */
-                    const char *option)        /* I - Keyword/option name */
+ppd_choice_t *                         // O - Pointer to choice or @code NULL@
+ppdFindMarkedChoice(ppd_file_t *ppd,   // I - PPD file
+                    const char *option)        // I - Keyword/option name
 {
-  ppd_choice_t key,                    /* Search key for choice */
-               *marked;                /* Marked choice */
+  ppd_choice_t key,                    // Search key for choice
+               *marked;                // Marked choice
 
 
   DEBUG_printf(("2ppdFindMarkedChoice(ppd=%p, option=\"%s\")", ppd, option));
@@ -413,28 +416,28 @@ ppdFindMarkedChoice(ppd_file_t *ppd,      /* I - PPD file */
 }
 
 
-/*
- * 'ppdFindOption()' - Return a pointer to the specified option.
- */
+//
+// 'ppdFindOption()' - Return a pointer to the specified option.
+//
 
-ppd_option_t *                         /* O - Pointer to option or @code NULL@ */
-ppdFindOption(ppd_file_t *ppd,         /* I - PPD file data */
-              const char *option)      /* I - Option/Keyword name */
+ppd_option_t *                         // O - Pointer to option or @code NULL@
+ppdFindOption(ppd_file_t *ppd,         // I - PPD file data
+              const char *option)      // I - Option/Keyword name
 {
- /*
-  * Range check input...
-  */
+  //
+  // Range check input...
+  //
 
   if (!ppd || !option)
     return (NULL);
 
   if (ppd->options)
   {
-   /*
-    * Search in the array...
-    */
+    //
+    // Search in the array...
+    //
 
-    ppd_option_t       key;            /* Option search key */
+    ppd_option_t       key;            // Option search key
 
 
     strlcpy(key.keyword, option, sizeof(key.keyword));
@@ -443,13 +446,13 @@ ppdFindOption(ppd_file_t *ppd,            /* I - PPD file data */
   }
   else
   {
-   /*
-    * Search in each group...
-    */
+    //
+    // Search in each group...
+    //
 
-    int                        i, j;           /* Looping vars */
-    ppd_group_t                *group;         /* Current group */
-    ppd_option_t       *optptr;        /* Current option */
+    int                        i, j;           // Looping vars
+    ppd_group_t                *group;         // Current group
+    ppd_option_t       *optptr;        // Current option
 
 
     for (i = ppd->num_groups, group = ppd->groups; i > 0; i --, group ++)
@@ -464,17 +467,17 @@ ppdFindOption(ppd_file_t *ppd,            /* I - PPD file data */
 }
 
 
-/*
- * 'ppdIsMarked()' - Check to see if an option is marked.
- */
+//
+// 'ppdIsMarked()' - Check to see if an option is marked.
+//
 
-int                                    /* O - Non-zero if option is marked */
-ppdIsMarked(ppd_file_t *ppd,           /* I - PPD file data */
-            const char *option,                /* I - Option/Keyword name */
-            const char *choice)                /* I - Choice name */
+int                                    // O - Non-zero if option is marked
+ppdIsMarked(ppd_file_t *ppd,           // I - PPD file data
+            const char *option,                // I - Option/Keyword name
+            const char *choice)                // I - Choice name
 {
-  ppd_choice_t key,                    /* Search key */
-               *c;                     /* Choice pointer */
+  ppd_choice_t key,                    // Search key
+               *c;                     // Choice pointer
 
 
   if (!ppd)
@@ -490,24 +493,24 @@ ppdIsMarked(ppd_file_t *ppd,              /* I - PPD file data */
 }
 
 
-/*
- * 'ppdMarkDefaults()' - Mark all default options in the PPD file.
- */
+//
+// 'ppdMarkDefaults()' - Mark all default options in the PPD file.
+//
 
 void
-ppdMarkDefaults(ppd_file_t *ppd)       /* I - PPD file record */
+ppdMarkDefaults(ppd_file_t *ppd)       // I - PPD file record
 {
-  int          i;                      /* Looping variables */
-  ppd_group_t  *g;                     /* Current group */
-  ppd_choice_t *c;                     /* Current choice */
+  int          i;                      // Looping variables
+  ppd_group_t  *g;                     // Current group
+  ppd_choice_t *c;                     // Current choice
 
 
   if (!ppd)
     return;
 
- /*
-  * Clean out the marked array...
-  */
+  //
+  // Clean out the marked array...
+  //
 
   for (c = (ppd_choice_t *)cupsArrayFirst(ppd->marked);
        c;
@@ -517,65 +520,65 @@ ppdMarkDefaults(ppd_file_t *ppd)  /* I - PPD file record */
     c->marked = 0;
   }
 
- /*
-  * Then repopulate it with the defaults...
-  */
+  //
+  // Then repopulate it with the defaults...
+  //
 
   for (i = ppd->num_groups, g = ppd->groups; i > 0; i --, g ++)
     ppd_defaults(ppd, g);
 
- /*
-  * Finally, tag any conflicts (API compatibility) once at the end.
-  */
+  //
+  // Finally, tag any conflicts (API compatibility) once at the end.
+  //
 
   ppdConflicts(ppd);
 }
 
 
-/*
- * 'ppdMarkOption()' - Mark an option in a PPD file and return the number of
- *                     conflicts.
- */
+//
+// 'ppdMarkOption()' - Mark an option in a PPD file and return the number of
+//                     conflicts.
+//
 
-int                                    /* O - Number of conflicts */
-ppdMarkOption(ppd_file_t *ppd,         /* I - PPD file record */
-              const char *option,      /* I - Keyword */
-              const char *choice)      /* I - Option name */
+int                                    // O - Number of conflicts
+ppdMarkOption(ppd_file_t *ppd,         // I - PPD file record
+              const char *option,      // I - Keyword
+              const char *choice)      // I - Option name
 {
   DEBUG_printf(("ppdMarkOption(ppd=%p, option=\"%s\", choice=\"%s\")",
                ppd, option, choice));
 
- /*
-  * Range check input...
-  */
+  //
+  // Range check input...
+  //
 
   if (!ppd || !option || !choice)
     return (0);
 
- /*
-  * Mark the option...
-  */
+  //
+  // Mark the option...
+  //
 
   ppd_mark_option(ppd, option, choice);
 
- /*
-  * Return the number of conflicts...
-  */
+  //
+  // Return the number of conflicts...
+  //
 
   return (ppdConflicts(ppd));
 }
 
 
-/*
- * 'ppdFirstOption()' - Return the first option in the PPD file.
- *
- * Options are returned from all groups in ascending alphanumeric order.
- *
- * @since CUPS 1.2/macOS 10.5@
- */
+//
+// 'ppdFirstOption()' - Return the first option in the PPD file.
+//
+// Options are returned from all groups in ascending alphanumeric order.
+//
+// @since CUPS 1.2/macOS 10.5@
+//
 
-ppd_option_t *                         /* O - First option or @code NULL@ */
-ppdFirstOption(ppd_file_t *ppd)                /* I - PPD file */
+ppd_option_t *                         // O - First option or @code NULL@
+ppdFirstOption(ppd_file_t *ppd)                // I - PPD file
 {
   if (!ppd)
     return (NULL);
@@ -584,16 +587,16 @@ ppdFirstOption(ppd_file_t *ppd)           /* I - PPD file */
 }
 
 
-/*
- * 'ppdNextOption()' - Return the next option in the PPD file.
- *
- * Options are returned from all groups in ascending alphanumeric order.
- *
- * @since CUPS 1.2/macOS 10.5@
- */
+//
+// 'ppdNextOption()' - Return the next option in the PPD file.
+//
+// Options are returned from all groups in ascending alphanumeric order.
+//
+// @since CUPS 1.2/macOS 10.5@
+//
 
-ppd_option_t *                         /* O - Next option or @code NULL@ */
-ppdNextOption(ppd_file_t *ppd)         /* I - PPD file */
+ppd_option_t *                         // O - Next option or @code NULL@
+ppdNextOption(ppd_file_t *ppd)         // I - PPD file
 {
   if (!ppd)
     return (NULL);
@@ -602,49 +605,49 @@ ppdNextOption(ppd_file_t *ppd)            /* I - PPD file */
 }
 
 
-/*
- * 'ppdParseOptions()' - Parse options from a PPD file.
- *
- * This function looks for strings of the form:
- *
- *     *option choice ... *optionN choiceN
- *     property value ... propertyN valueN
- *
- * It stops when it finds a string that doesn't match this format.
- */
+//
+// 'ppdParseOptions()' - Parse options from a PPD file.
+//
+// This function looks for strings of the form:
+//
+//     *option choice ... *optionN choiceN
+//     property value ... propertyN valueN
+//
+// It stops when it finds a string that doesn't match this format.
+//
 
-int                                    /* O  - Number of options */
+int                                    // O  - Number of options
 ppdParseOptions(
-    const char    *s,                  /* I  - String to parse */
-    int           num_options,         /* I  - Number of options */
-    cups_option_t **options,           /* IO - Options */
-    ppd_parse_t  which)                /* I  - What to parse */
+    const char    *s,                  // I  - String to parse
+    int           num_options,         // I  - Number of options
+    cups_option_t **options,           // IO - Options
+    ppd_parse_t  which)                // I  - What to parse
 {
-  char option[PPD_MAX_NAME * 2 + 1],   /* Current option/property */
-       choice[PPD_MAX_NAME],           /* Current choice/value */
-       *ptr;                           /* Pointer into option or choice */
+  char option[PPD_MAX_NAME * 2 + 1],   // Current option/property
+       choice[PPD_MAX_NAME],           // Current choice/value
+       *ptr;                           // Pointer into option or choice
 
 
   if (!s)
     return (num_options);
 
- /*
-  * Read all of the "*Option Choice" and "property value" pairs from the
-  * string, add them to an options array as we go...
-  */
+  //
+  // Read all of the "*Option Choice" and "property value" pairs from the
+  // string, add them to an options array as we go...
+  //
 
   while (*s)
   {
-   /*
-    * Skip leading whitespace...
-    */
+    //
+    // Skip leading whitespace...
+    //
 
     while (_ppd_isspace(*s))
       s ++;
 
-   /*
-    * Get the option/property name...
-    */
+    //
+    // Get the option/property name...
+    //
 
     ptr = option;
     while (*s && !_ppd_isspace(*s) && ptr < (option + sizeof(option) - 1))
@@ -655,9 +658,9 @@ ppdParseOptions(
 
     *ptr = '\0';
 
-   /*
-    * Get the choice...
-    */
+    //
+    // Get the choice...
+    //
 
     while (_ppd_isspace(*s))
       s ++;
@@ -674,9 +677,9 @@ ppdParseOptions(
 
     *ptr = '\0';
 
-   /*
-    * Add it to the options array...
-    */
+    //
+    // Add it to the options array...
+    //
 
     if (option[0] == '*' && which != PPD_PARSE_PROPERTIES)
       num_options = cupsAddOption(option + 1, choice, num_options, options);
@@ -689,15 +692,15 @@ ppdParseOptions(
 
 
 #ifdef DEBUG
-/*
- * 'ppd_debug_marked()' - Output the marked array to stdout...
- */
+//
+// 'ppd_debug_marked()' - Output the marked array to stdout...
+//
 
 static void
-ppd_debug_marked(ppd_file_t *ppd,              /* I - PPD file data */
-             const char *title)                /* I - Title for list */
+ppd_debug_marked(ppd_file_t *ppd,      // I - PPD file data
+             const char *title)                // I - Title for list
 {
-  ppd_choice_t *c;                     /* Current choice */
+  ppd_choice_t *c;                     // Current choice
 
 
   DEBUG_printf(("2ppdMarkOptions: %s", title));
@@ -707,20 +710,20 @@ ppd_debug_marked(ppd_file_t *ppd,         /* I - PPD file data */
        c = (ppd_choice_t *)cupsArrayNext(ppd->marked))
     DEBUG_printf(("2ppdMarkOptions: %s=%s", c->option->keyword, c->choice));
 }
-#endif /* DEBUG */
+#endif // DEBUG
 
 
-/*
- * 'ppd_defaults()' - Set the defaults for this group and all sub-groups.
- */
+//
+// 'ppd_defaults()' - Set the defaults for this group and all sub-groups.
+//
 
 static void
-ppd_defaults(ppd_file_t  *ppd,         /* I - PPD file */
-             ppd_group_t *g)           /* I - Group to default */
+ppd_defaults(ppd_file_t  *ppd,         // I - PPD file
+             ppd_group_t *g)           // I - Group to default
 {
-  int          i;                      /* Looping var */
-  ppd_option_t *o;                     /* Current option */
-  ppd_group_t  *sg;                    /* Current sub-group */
+  int          i;                      // Looping var
+  ppd_option_t *o;                     // Current option
+  ppd_group_t  *sg;                    // Current sub-group
 
 
   for (i = g->num_options, o = g->options; i > 0; i --, o ++)
@@ -732,18 +735,18 @@ ppd_defaults(ppd_file_t  *ppd,            /* I - PPD file */
 }
 
 
-/*
- * 'ppd_mark_choices()' - Mark one or more option choices from a string.
- */
+//
+// 'ppd_mark_choices()' - Mark one or more option choices from a string.
+//
 
 static void
-ppd_mark_choices(ppd_file_t *ppd,      /* I - PPD file */
-                 const char *s)                /* I - "*Option Choice ..." string */
+ppd_mark_choices(ppd_file_t *ppd,      // I - PPD file
+                 const char *s)                // I - "*Option Choice ..." string
 {
-  int          i,                      /* Looping var */
-               num_options;            /* Number of options */
-  cups_option_t        *options,               /* Options */
-               *option;                /* Current option */
+  int          i,                      // Looping var
+               num_options;            // Number of options
+  cups_option_t        *options,               // Options
+               *option;                // Current option
 
 
   if (!s)
@@ -759,30 +762,30 @@ ppd_mark_choices(ppd_file_t *ppd, /* I - PPD file */
 }
 
 
-/*
- * 'ppd_mark_option()' - Quick mark an option without checking for conflicts.
- */
+//
+// 'ppd_mark_option()' - Quick mark an option without checking for conflicts.
+//
 
 static void
-ppd_mark_option(ppd_file_t *ppd,       /* I - PPD file */
-                const char *option,    /* I - Option name */
-                const char *choice)    /* I - Choice name */
+ppd_mark_option(ppd_file_t *ppd,       // I - PPD file
+                const char *option,    // I - Option name
+                const char *choice)    // I - Choice name
 {
-  int          i, j;                   /* Looping vars */
-  ppd_option_t *o;                     /* Option pointer */
-  ppd_choice_t *c,                     /* Choice pointer */
-               *oldc,                  /* Old choice pointer */
-               key;                    /* Search key for choice */
-  struct lconv *loc;                   /* Locale data */
+  int          i, j;                   // Looping vars
+  ppd_option_t *o;                     // Option pointer
+  ppd_choice_t *c,                     // Choice pointer
+               *oldc,                  // Old choice pointer
+               key;                    // Search key for choice
+  struct lconv *loc;                   // Locale data
 
 
   DEBUG_printf(("7ppd_mark_option(ppd=%p, option=\"%s\", choice=\"%s\")",
                ppd, option, choice));
 
- /*
-  * AP_D_InputSlot is the "default input slot" on macOS, and setting
-  * it clears the regular InputSlot choices...
-  */
+  //
+  // AP_D_InputSlot is the "default input slot" on macOS, and setting
+  // it clears the regular InputSlot choices...
+  //
 
   if (!_ppd_strcasecmp(option, "AP_D_InputSlot"))
   {
@@ -801,9 +804,9 @@ ppd_mark_option(ppd_file_t *ppd,    /* I - PPD file */
     cupsArrayRestore(ppd->options);
   }
 
- /*
-  * Check for custom options...
-  */
+  //
+  // Check for custom options...
+  //
 
   cupsArraySave(ppd->options);
 
@@ -818,30 +821,30 @@ ppd_mark_option(ppd_file_t *ppd,  /* I - PPD file */
 
   if (!_ppd_strncasecmp(choice, "Custom.", 7))
   {
-   /*
-    * Handle a custom option...
-    */
+    //
+    // Handle a custom option...
+    //
 
     if ((c = ppdFindChoice(o, "Custom")) == NULL)
       return;
 
     if (!_ppd_strcasecmp(option, "PageSize"))
     {
-     /*
-      * Handle custom page sizes...
-      */
+      //
+      // Handle custom page sizes...
+      //
 
       ppdPageSize(ppd, choice);
     }
     else
     {
-     /*
-      * Handle other custom options...
-      */
+      //
+      // Handle other custom options...
+      //
 
-      ppd_coption_t    *coption;       /* Custom option */
-      ppd_cparam_t     *cparam;        /* Custom parameter */
-      char             *units;         /* Custom points units */
+      ppd_coption_t    *coption;       // Custom option
+      ppd_cparam_t     *cparam;        // Custom parameter
+      char             *units;         // Custom points units
 
 
       if ((coption = ppdFindCustomOption(ppd, option)) != NULL)
@@ -897,24 +900,24 @@ ppd_mark_option(ppd_file_t *ppd,  /* I - PPD file */
       }
     }
 
-   /*
-    * Make sure that we keep the option marked below...
-    */
+    //
+    // Make sure that we keep the option marked below...
+    //
 
     choice = "Custom";
   }
   else if (choice[0] == '{')
   {
-   /*
-    * Handle multi-value custom options...
-    */
+    //
+    // Handle multi-value custom options...
+    //
 
-    ppd_coption_t      *coption;       /* Custom option */
-    ppd_cparam_t       *cparam;        /* Custom parameter */
-    char               *units;         /* Custom points units */
-    int                        num_vals;       /* Number of values */
-    cups_option_t      *vals,          /* Values */
-                       *val;           /* Value */
+    ppd_coption_t      *coption;       // Custom option
+    ppd_cparam_t       *cparam;        // Custom parameter
+    char               *units;         // Custom points units
+    int                        num_vals;       // Number of values
+    cups_option_t      *vals,          // Values
+                       *val;           // Value
 
 
     if ((c = ppdFindChoice(o, "Custom")) == NULL)
@@ -989,15 +992,15 @@ ppd_mark_option(ppd_file_t *ppd,  /* I - PPD file */
       return;
   }
 
- /*
-  * Option found; mark it and then handle unmarking any other options.
-  */
+  //
+  // Option found; mark it and then handle unmarking any other options.
+  //
 
   if (o->ui != PPD_UI_PICKMANY)
   {
-   /*
-    * Unmark all other choices...
-    */
+    //
+    // Unmark all other choices...
+    //
 
     if ((oldc = (ppd_choice_t *)cupsArrayFind(ppd->marked, c)) != NULL)
     {
@@ -1005,20 +1008,21 @@ ppd_mark_option(ppd_file_t *ppd,        /* I - PPD file */
       cupsArrayRemove(ppd->marked, oldc);
     }
 
-    if (!_ppd_strcasecmp(option, "PageSize") || !_ppd_strcasecmp(option, "PageRegion"))
+    if (!_ppd_strcasecmp(option, "PageSize") ||
+       !_ppd_strcasecmp(option, "PageRegion"))
     {
-     /*
-      * Mark current page size...
-      */
+      //
+      // Mark current page size...
+      //
 
       for (j = 0; j < ppd->num_sizes; j ++)
        ppd->sizes[j].marked = !_ppd_strcasecmp(ppd->sizes[j].name,
                                           choice);
 
-     /*
-      * Unmark the current PageSize or PageRegion setting, as
-      * appropriate...
-      */
+      //
+      // Unmark the current PageSize or PageRegion setting, as
+      // appropriate...
+      //
 
       cupsArraySave(ppd->options);
 
@@ -1051,9 +1055,9 @@ ppd_mark_option(ppd_file_t *ppd,  /* I - PPD file */
     }
     else if (!_ppd_strcasecmp(option, "InputSlot"))
     {
-     /*
-      * Unmark ManualFeed option...
-      */
+      //
+      // Unmark ManualFeed option...
+      //
 
       cupsArraySave(ppd->options);
 
@@ -1072,9 +1076,9 @@ ppd_mark_option(ppd_file_t *ppd,  /* I - PPD file */
     else if (!_ppd_strcasecmp(option, "ManualFeed") &&
             !_ppd_strcasecmp(choice, "True"))
     {
-     /*
-      * Unmark InputSlot option...
-      */
+      //
+      // Unmark InputSlot option...
+      //
 
       cupsArraySave(ppd->options);
 
index 2dce90cb40bb09f8a706bad6f9d985702c3f4096..ba8cf5157071ce21ad0ff0019b8dc6692b094dbe 100644 (file)
@@ -1,39 +1,39 @@
-/*
- * Page size functions for libppd.
- *
- * Copyright 2007-2015 by Apple Inc.
- * Copyright 1997-2007 by Easy Software Products, all rights reserved.
- *
- * Licensed under Apache License v2.0.  See the file "LICENSE" for more
- * information.
- *
- * PostScript is a trademark of Adobe Systems, Inc.
- */
-
-/*
- * Include necessary headers...
- */
+//
+// Page size functions for libppd.
+//
+// Copyright 2007-2015 by Apple Inc.
+// Copyright 1997-2007 by Easy Software Products, all rights reserved.
+//
+// Licensed under Apache License v2.0.  See the file "LICENSE" for more
+// information.
+//
+// PostScript is a trademark of Adobe Systems, Inc.
+//
+
+//
+// Include necessary headers...
+//
 
 #include "string-private.h"
 #include "debug-internal.h"
 #include "ppd.h"
 
 
-/*
- * 'ppdPageSize()' - Get the page size record for the named size.
- */
+//
+// 'ppdPageSize()' - Get the page size record for the named size.
+//
 
-ppd_size_t *                           /* O - Size record for page or NULL */
-ppdPageSize(ppd_file_t *ppd,           /* I - PPD file record */
-            const char *name)          /* I - Size name */
+ppd_size_t *                           // O - Size record for page or NULL
+ppdPageSize(ppd_file_t *ppd,           // I - PPD file record
+            const char *name)          // I - Size name
 {
-  int          i;                      /* Looping var */
-  ppd_size_t   *size;                  /* Current page size */
-  double       w, l;                   /* Width and length of page */
-  char         *nameptr;               /* Pointer into name */
-  struct lconv *loc;                   /* Locale data */
-  ppd_coption_t        *coption;               /* Custom option for page size */
-  ppd_cparam_t *cparam;                /* Custom option parameter */
+  int          i;                      // Looping var
+  ppd_size_t   *size;                  // Current page size
+  double       w, l;                   // Width and length of page
+  char         *nameptr;               // Pointer into name
+  struct lconv *loc;                   // Locale data
+  ppd_coption_t        *coption;               // Custom option for page size
+  ppd_cparam_t *cparam;                // Custom option parameter
 
 
   DEBUG_printf(("2ppdPageSize(ppd=%p, name=\"%s\")", ppd, name));
@@ -48,9 +48,9 @@ ppdPageSize(ppd_file_t *ppd,          /* I - PPD file record */
   {
     if (!strncmp(name, "Custom.", 7) && ppd->variable_sizes)
     {
-     /*
-      * Find the custom page size...
-      */
+      //
+      // Find the custom page size...
+      //
 
       for (i = ppd->num_sizes, size = ppd->sizes; i > 0; i --, size ++)
        if (!strcmp("Custom", size->name))
@@ -62,16 +62,16 @@ ppdPageSize(ppd_file_t *ppd,                /* I - PPD file record */
         return (NULL);
       }
 
-     /*
-      * Variable size; size name can be one of the following:
-      *
-      *    Custom.WIDTHxLENGTHin    - Size in inches
-      *    Custom.WIDTHxLENGTHft    - Size in feet
-      *    Custom.WIDTHxLENGTHcm    - Size in centimeters
-      *    Custom.WIDTHxLENGTHmm    - Size in millimeters
-      *    Custom.WIDTHxLENGTHm     - Size in meters
-      *    Custom.WIDTHxLENGTH[pt]  - Size in points
-      */
+      //
+      // Variable size; size name can be one of the following:
+      //
+      //    Custom.WIDTHxLENGTHin    - Size in inches
+      //    Custom.WIDTHxLENGTHft    - Size in feet
+      //    Custom.WIDTHxLENGTHcm    - Size in centimeters
+      //    Custom.WIDTHxLENGTHmm    - Size in millimeters
+      //    Custom.WIDTHxLENGTHm     - Size in meters
+      //    Custom.WIDTHxLENGTH[pt]  - Size in points
+      //
 
       loc = localeconv();
       w   = _ppdStrScand(name + 7, &nameptr, loc);
@@ -115,9 +115,9 @@ ppdPageSize(ppd_file_t *ppd,                /* I - PPD file record */
       size->right  = (float)(w - ppd->custom_margins[2]);
       size->top    = (float)(l - ppd->custom_margins[3]);
 
-     /*
-      * Update the custom option records for the page size, too...
-      */
+      //
+      // Update the custom option records for the page size, too...
+      //
 
       if ((coption = ppdFindCustomOption(ppd, "PageSize")) != NULL)
       {
@@ -128,9 +128,9 @@ ppdPageSize(ppd_file_t *ppd,                /* I - PPD file record */
          cparam->current.custom_points = (float)l;
       }
 
-     /*
-      * Return the page size...
-      */
+      //
+      // Return the page size...
+      //
 
       DEBUG_printf(("3ppdPageSize: Returning %p (\"%s\", %gx%g)", size,
                     size->name, size->width, size->length));
@@ -139,9 +139,9 @@ ppdPageSize(ppd_file_t *ppd,                /* I - PPD file record */
     }
     else
     {
-     /*
-      * Lookup by name...
-      */
+      //
+      // Lookup by name...
+      //
 
       for (i = ppd->num_sizes, size = ppd->sizes; i > 0; i --, size ++)
        if (!_ppd_strcasecmp(name, size->name))
@@ -155,9 +155,9 @@ ppdPageSize(ppd_file_t *ppd,                /* I - PPD file record */
   }
   else
   {
-   /*
-    * Find default...
-    */
+    //
+    // Find default...
+    //
 
     for (i = ppd->num_sizes, size = ppd->sizes; i > 0; i --, size ++)
       if (size->marked)
@@ -175,34 +175,34 @@ ppdPageSize(ppd_file_t *ppd,              /* I - PPD file record */
 }
 
 
-/*
- * 'ppdPageSizeLimits()' - Return the custom page size limits.
- *
- * This function returns the minimum and maximum custom page sizes and printable
- * areas based on the currently-marked (selected) options.
- *
- * If the specified PPD file does not support custom page sizes, both
- * "minimum" and "maximum" are filled with zeroes.
- *
- * @since CUPS 1.4/macOS 10.6@
- */
-
-int                                    /* O - 1 if custom sizes are supported, 0 otherwise */
-ppdPageSizeLimits(ppd_file_t *ppd,     /* I - PPD file record */
-                  ppd_size_t *minimum, /* O - Minimum custom size */
-                 ppd_size_t *maximum)  /* O - Maximum custom size */
+//
+// 'ppdPageSizeLimits()' - Return the custom page size limits.
+//
+// This function returns the minimum and maximum custom page sizes and printable
+// areas based on the currently-marked (selected) options.
+//
+// If the specified PPD file does not support custom page sizes, both
+// "minimum" and "maximum" are filled with zeroes.
+//
+// @since CUPS 1.4/macOS 10.6@
+//
+
+int                                    // O - 1 if custom sizes are supported, 0 otherwise
+ppdPageSizeLimits(ppd_file_t *ppd,     // I - PPD file record
+                  ppd_size_t *minimum, // O - Minimum custom size
+                 ppd_size_t *maximum)  // O - Maximum custom size
 {
-  ppd_choice_t *qualifier2,            /* Second media qualifier */
-               *qualifier3;            /* Third media qualifier */
-  ppd_attr_t   *attr;                  /* Attribute */
-  float                width,                  /* Min/max width */
-               length;                 /* Min/max length */
-  char         spec[PPD_MAX_NAME];     /* Selector for min/max */
+  ppd_choice_t *qualifier2,            // Second media qualifier
+               *qualifier3;            // Third media qualifier
+  ppd_attr_t   *attr;                  // Attribute
+  float                width,                  // Min/max width
+               length;                 // Min/max length
+  char         spec[PPD_MAX_NAME];     // Selector for min/max
 
 
- /*
-  * Range check input...
-  */
+  //
+  // Range check input...
+  //
 
   if (!ppd || !ppd->variable_sizes || !minimum || !maximum)
   {
@@ -215,9 +215,10 @@ ppdPageSizeLimits(ppd_file_t *ppd, /* I - PPD file record */
     return (0);
   }
 
- /*
-  * See if we have the cupsMediaQualifier2 and cupsMediaQualifier3 attributes...
-  */
+  //
+  // See if we have the cupsMediaQualifier2 and cupsMediaQualifier3
+  // attributes...
+  //
 
   cupsArraySave(ppd->sorted_attrs);
 
@@ -233,18 +234,18 @@ ppdPageSizeLimits(ppd_file_t *ppd,        /* I - PPD file record */
   else
     qualifier3 = NULL;
 
- /*
-  * Figure out the current minimum width and length...
-  */
+  //
+  // Figure out the current minimum width and length...
+  //
 
   width  = ppd->custom_min[0];
   length = ppd->custom_min[1];
 
   if (qualifier2)
   {
-   /*
-    * Try getting cupsMinSize...
-    */
+    //
+    // Try getting cupsMinSize...
+    //
 
     if (qualifier3)
     {
@@ -282,18 +283,18 @@ ppdPageSizeLimits(ppd_file_t *ppd,        /* I - PPD file record */
   minimum->right  = width - ppd->custom_margins[2];
   minimum->top    = length - ppd->custom_margins[3];
 
- /*
-  * Figure out the current maximum width and length...
-  */
+  //
+  // Figure out the current maximum width and length...
+  //
 
   width  = ppd->custom_max[0];
   length = ppd->custom_max[1];
 
   if (qualifier2)
   {
-   /*
-    * Try getting cupsMaxSize...
-    */
+    //
+    // Try getting cupsMaxSize...
+    //
 
     if (qualifier3)
     {
@@ -331,9 +332,9 @@ ppdPageSizeLimits(ppd_file_t *ppd,  /* I - PPD file record */
   maximum->right  = width - ppd->custom_margins[2];
   maximum->top    = length - ppd->custom_margins[3];
 
- /*
-  * Return the min and max...
-  */
+  //
+  // Return the min and max...
+  //
 
   cupsArrayRestore(ppd->sorted_attrs);
 
@@ -341,15 +342,15 @@ ppdPageSizeLimits(ppd_file_t *ppd,        /* I - PPD file record */
 }
 
 
-/*
- * 'ppdPageWidth()' - Get the page width for the given size.
- */
+//
+// 'ppdPageWidth()' - Get the page width for the given size.
+//
 
-float                          /* O - Width of page in points or 0.0 */
-ppdPageWidth(ppd_file_t *ppd,  /* I - PPD file record */
-             const char *name) /* I - Size name */
+float                          // O - Width of page in points or 0.0
+ppdPageWidth(ppd_file_t *ppd,  // I - PPD file record
+             const char *name) // I - Size name
 {
-  ppd_size_t   *size;          /* Page size */
+  ppd_size_t   *size;          // Page size
 
 
   if ((size = ppdPageSize(ppd, name)) == NULL)
@@ -359,15 +360,15 @@ ppdPageWidth(ppd_file_t *ppd,     /* I - PPD file record */
 }
 
 
-/*
- * 'ppdPageLength()' - Get the page length for the given size.
- */
+//
+// 'ppdPageLength()' - Get the page length for the given size.
+//
 
-float                          /* O - Length of page in points or 0.0 */
-ppdPageLength(ppd_file_t *ppd, /* I - PPD file */
-              const char *name)        /* I - Size name */
+float                          // O - Length of page in points or 0.0
+ppdPageLength(ppd_file_t *ppd, // I - PPD file
+              const char *name)        // I - Size name
 {
-  ppd_size_t   *size;          /* Page size */
+  ppd_size_t   *size;          // Page size
 
 
   if ((size = ppdPageSize(ppd, name)) == NULL)
index f1ea670930e5f893ec0ae2cce401bc17fdc4cfe7..883c3e77cdf3fdd5b6dd5c72788b0f3caca72678 100644 (file)
--- a/ppd/ppd.c
+++ b/ppd/ppd.c
@@ -1,18 +1,18 @@
-/*
- * PPD file routines for libppd.
- *
- * Copyright © 2007-2019 by Apple Inc.
- * Copyright © 1997-2007 by Easy Software Products, all rights reserved.
- *
- * Licensed under Apache License v2.0.  See the file "LICENSE" for more
- * information.
- *
- * PostScript is a trademark of Adobe Systems, Inc.
- */
-
-/*
- * Include necessary headers.
- */
+//
+// PPD file routines for libppd.
+//
+// Copyright © 2007-2019 by Apple Inc.
+// Copyright © 1997-2007 by Easy Software Products, all rights reserved.
+//
+// Licensed under Apache License v2.0.  See the file "LICENSE" for more
+// information.
+//
+// PostScript is a trademark of Adobe Systems, Inc.
+//
+
+//
+// Include necessary headers.
+//
 
 #include "string-private.h"
 #include "language-private.h"
 #include "debug-internal.h"
 
 
-/*
- * Definitions...
- */
+//
+// Definitions...
+//
 
-#define PPD_KEYWORD    1               /* Line contained a keyword */
-#define PPD_OPTION     2               /* Line contained an option name */
-#define PPD_TEXT       4               /* Line contained human-readable text */
-#define PPD_STRING     8               /* Line contained a string or code */
+#define PPD_KEYWORD    1               // Line contained a keyword
+#define PPD_OPTION     2               // Line contained an option name
+#define PPD_TEXT       4               // Line contained human-readable text
+#define PPD_STRING     8               // Line contained a string or code
 
-#define PPD_HASHSIZE   512             /* Size of hash */
+#define PPD_HASHSIZE   512             // Size of hash
 
 
-/*
- * Line buffer structure...
- */
+//
+// Line buffer structure...
+//
 
 typedef struct _ppd_line_s
 {
-  char         *buffer;                /* Pointer to buffer */
-  size_t       bufsize;                /* Size of the buffer */
+  char         *buffer;                // Pointer to buffer
+  size_t       bufsize;                // Size of the buffer
 } _ppd_line_t;
 
 
-/*
- * Local globals...
- */
+//
+// Local globals...
+//
 
 static _ppd_threadkey_t ppd_globals_key = _PPD_THREADKEY_INITIALIZER;
-                                       /* Thread local storage key */
+                                       // Thread local storage key
 #ifdef HAVE_PTHREAD_H
 static pthread_once_t  ppd_globals_key_once = PTHREAD_ONCE_INIT;
-                                       /* One-time initialization object */
-#endif /* HAVE_PTHREAD_H */
+                                       // One-time initialization object
+#endif // HAVE_PTHREAD_H
 
 
-/*
- * Local functions...
- */
+//
+// Local functions...
+//
 
 static ppd_attr_t      *ppd_add_attr(ppd_file_t *ppd, const char *name,
                                      const char *spec, const char *text,
@@ -85,10 +85,10 @@ static ppd_option_t *ppd_get_option(ppd_group_t *group, const char *name);
 static ppd_globals_t   *ppd_globals_alloc(void);
 #if defined(HAVE_PTHREAD_H) || defined(_WIN32)
 static void            ppd_globals_free(ppd_globals_t *g);
-#endif /* HAVE_PTHREAD_H || _WIN32 */
+#endif // HAVE_PTHREAD_H || _WIN32
 #ifdef HAVE_PTHREAD_H
 static void            ppd_globals_init(void);
-#endif /* HAVE_PTHREAD_H */
+#endif // HAVE_PTHREAD_H
 static int             ppd_hash_option(ppd_option_t *option);
 static int             ppd_read(cups_file_t *fp, _ppd_line_t *line,
                                 char *keyword, char *option, char *text,
@@ -98,31 +98,31 @@ static int          ppd_update_filters(ppd_file_t *ppd,
                                           ppd_globals_t *pg);
 
 
-/*
- * 'ppdClose()' - Free all memory used by the PPD file.
- */
+//
+// 'ppdClose()' - Free all memory used by the PPD file.
+//
 
 void
-ppdClose(ppd_file_t *ppd)              /* I - PPD file record */
+ppdClose(ppd_file_t *ppd)              // I - PPD file record
 {
-  int                  i;              /* Looping var */
-  ppd_group_t          *group;         /* Current group */
-  char                 **font;         /* Current font */
-  ppd_attr_t           **attr;         /* Current attribute */
-  ppd_coption_t                *coption;       /* Current custom option */
-  ppd_cparam_t         *cparam;        /* Current custom parameter */
+  int                  i;              // Looping var
+  ppd_group_t          *group;         // Current group
+  char                 **font;         // Current font
+  ppd_attr_t           **attr;         // Current attribute
+  ppd_coption_t                *coption;       // Current custom option
+  ppd_cparam_t         *cparam;        // Current custom parameter
 
 
- /*
-  * Range check arguments...
-  */
+  //
+  // Range check arguments...
+  //
 
   if (!ppd)
     return;
 
- /*
-  * Free all strings at the top level...
-  */
+  //
+  // Free all strings at the top level...
+  //
 
   free(ppd->lang_encoding);
   free(ppd->nickname);
@@ -135,9 +135,9 @@ ppdClose(ppd_file_t *ppd)           /* I - PPD file record */
   free(ppd->jcl_pdf);
 #endif
 
- /*
-  * Free any UI groups, subgroups, and options...
-  */
+  //
+  // Free any UI groups, subgroups, and options...
+  //
 
   if (ppd->num_groups > 0)
   {
@@ -150,29 +150,29 @@ ppdClose(ppd_file_t *ppd)         /* I - PPD file record */
   cupsArrayDelete(ppd->options);
   cupsArrayDelete(ppd->marked);
 
- /*
-  * Free any page sizes...
-  */
+  //
+  // Free any page sizes...
+  //
 
   if (ppd->num_sizes > 0)
     free(ppd->sizes);
 
- /*
-  * Free any constraints...
-  */
+  //
+  // Free any constraints...
+  //
 
   if (ppd->num_consts > 0)
     free(ppd->consts);
 
- /*
-  * Free any filters...
-  */
+  //
+  // Free any filters...
+  //
 
   ppd_free_filters(ppd);
 
- /*
-  * Free any fonts...
-  */
+  //
+  // Free any fonts...
+  //
 
   if (ppd->num_fonts > 0)
   {
@@ -182,16 +182,16 @@ ppdClose(ppd_file_t *ppd)         /* I - PPD file record */
     free(ppd->fonts);
   }
 
- /*
-  * Free any profiles...
-  */
+  //
+  // Free any profiles...
+  //
 
   if (ppd->num_profiles > 0)
     free(ppd->profiles);
 
- /*
-  * Free any attributes...
-  */
+  //
+  // Free any attributes...
+  //
 
   if (ppd->num_attrs > 0)
   {
@@ -206,9 +206,9 @@ ppdClose(ppd_file_t *ppd)           /* I - PPD file record */
 
   cupsArrayDelete(ppd->sorted_attrs);
 
- /*
-  * Free custom options...
-  */
+  //
+  // Free custom options...
+  //
 
   for (coption = (ppd_coption_t *)cupsArrayFirst(ppd->coptions);
        coption;
@@ -240,13 +240,13 @@ ppdClose(ppd_file_t *ppd)         /* I - PPD file record */
 
   cupsArrayDelete(ppd->coptions);
 
- /*
-  * Free constraints...
-  */
+  //
+  // Free constraints...
+  //
 
   if (ppd->cups_uiconstraints)
   {
-    ppd_cups_uiconsts_t *consts;       /* Current constraints */
+    ppd_cups_uiconsts_t *consts;       // Current constraints
 
 
     for (consts = (ppd_cups_uiconsts_t *)cupsArrayFirst(ppd->cups_uiconstraints);
@@ -260,31 +260,31 @@ ppdClose(ppd_file_t *ppd)         /* I - PPD file record */
     cupsArrayDelete(ppd->cups_uiconstraints);
   }
 
- /*
-  * Free any PPD cache/mapping data...
-  */
+  //
+  // Free any PPD cache/mapping data...
+  //
 
   if (ppd->cache)
     ppdCacheDestroy(ppd->cache);
 
- /*
-  * Free the whole record...
-  */
+  //
+  // Free the whole record...
+  //
 
   free(ppd);
 }
 
 
-/*
- * 'ppdErrorString()' - Returns the text associated with a status.
- *
- * @since CUPS 1.1.19/macOS 10.3@
- */
+//
+// 'ppdErrorString()' - Returns the text associated with a status.
+//
+// @since CUPS 1.1.19/macOS 10.3@
+//
 
-const char *                           /* O - Status string */
-ppdErrorString(ppd_status_t status)    /* I - PPD status */
+const char *                           // O - Status string
+ppdErrorString(ppd_status_t status)    // I - PPD status
 {
-  static const char * const messages[] =/* Status messages */
+  static const char * const messages[] =// Status messages
                {
                  _("OK"),
                  _("Unable to open PPD file"),
@@ -322,13 +322,13 @@ ppdErrorString(ppd_status_t status)       /* I - PPD status */
 }
 
 
-/*
- * 'ppdGetEncoding()' - Get the CUPS encoding value for the given
- *                       LanguageEncoding.
- */
+//
+// 'ppdGetEncoding()' - Get the CUPS encoding value for the given
+//                      LanguageEncoding.
 
-cups_encoding_t                                /* O - CUPS encoding value */
-ppdGetEncoding(const char *name)       /* I - LanguageEncoding string */
+
+cups_encoding_t                                // O - CUPS encoding value
+ppdGetEncoding(const char *name)       // I - LanguageEncoding string
 {
   if (!_ppd_strcasecmp(name, "ISOLatin1"))
     return (CUPS_ISO8859_1);
@@ -347,57 +347,57 @@ ppdGetEncoding(const char *name)  /* I - LanguageEncoding string */
 }
 
 
-/*
- * 'ppdGlobals()' - Return a pointer to thread local storage
- */
+//
+// 'ppdGlobals()' - Return a pointer to thread local storage
+//
 
-ppd_globals_t *                        /* O - Pointer to global data */
+ppd_globals_t *                        // O - Pointer to global data
 ppdGlobals(void)
 {
-  ppd_globals_t *pg;                   /* Pointer to global data */
+  ppd_globals_t *pg;                   // Pointer to global data
 
 
 #ifdef HAVE_PTHREAD_H
- /*
-  * Initialize the global data exactly once...
-  */
+  //
+  // Initialize the global data exactly once...
+  //
 
   pthread_once(&ppd_globals_key_once, ppd_globals_init);
-#endif /* HAVE_PTHREAD_H */
+#endif // HAVE_PTHREAD_H
 
- /*
-  * See if we have allocated the data yet...
-  */
+  //
+  // See if we have allocated the data yet...
+  //
 
   if ((pg = (ppd_globals_t *)_ppdThreadGetData(ppd_globals_key)) == NULL)
   {
-   /*
-    * No, allocate memory as set the pointer for the key...
-    */
+    //
+    // No, allocate memory as set the pointer for the key...
+    //
 
     if ((pg = ppd_globals_alloc()) != NULL)
       _ppdThreadSetData(ppd_globals_key, pg);
   }
 
- /*
-  * Return the pointer to the data...
-  */
+  //
+  // Return the pointer to the data...
+  //
 
   return (pg);
 }
 
 
-/*
- * 'ppdLastError()' - Return the status from the last ppdOpen*().
- *
- * @since CUPS 1.1.19/macOS 10.3@
- */
+//
+// 'ppdLastError()' - Return the status from the last ppdOpen*().
+//
+// @since CUPS 1.1.19/macOS 10.3@
+//
 
-ppd_status_t                           /* O - Status code */
-ppdLastError(int *line)                        /* O - Line number */
+ppd_status_t                           // O - Status code
+ppdLastError(int *line)                        // O - Line number
 {
   ppd_globals_t        *pg = ppdGlobals();
-                                       /* Global data */
+                                       // Global data
 
 
   if (line)
@@ -407,67 +407,68 @@ ppdLastError(int *line)                   /* O - Line number */
 }
 
 
-/*
- * 'ppdOpenWithLocalization()' - Read a PPD file into memory.
- *
- * @since CUPS 1.2/macOS 10.5@
- */
+//
+// 'ppdOpenWithLocalization()' - Read a PPD file into memory.
+//
+// @since CUPS 1.2/macOS 10.5@
+//
 
-ppd_file_t *                           /* O - PPD file record or @code NULL@ if the PPD file could not be opened. */
+ppd_file_t *                           // O - PPD file record or @code NULL@ if the PPD file could not be opened.
 ppdOpenWithLocalization(
-    cups_file_t                *fp,            /* I - File to read from */
-    ppd_localization_t localization)   /* I - Localization to load */
+    cups_file_t                *fp,            // I - File to read from
+    ppd_localization_t localization)   // I - Localization to load
 {
-  int                  i, j, k;        /* Looping vars */
-  _ppd_line_t          line;           /* Line buffer */
-  ppd_file_t           *ppd;           /* PPD file record */
-  ppd_group_t          *group,         /* Current group */
-                       *subgroup;      /* Current sub-group */
-  ppd_option_t         *option;        /* Current option */
-  ppd_choice_t         *choice;        /* Current choice */
-  ppd_const_t          *constraint;    /* Current constraint */
-  ppd_size_t           *size;          /* Current page size */
-  int                  mask;           /* Line data mask */
+  int                  i, j, k;        // Looping vars
+  _ppd_line_t          line;           // Line buffer
+  ppd_file_t           *ppd;           // PPD file record
+  ppd_group_t          *group,         // Current group
+                       *subgroup;      // Current sub-group
+  ppd_option_t         *option;        // Current option
+  ppd_choice_t         *choice;        // Current choice
+  ppd_const_t          *constraint;    // Current constraint
+  ppd_size_t           *size;          // Current page size
+  int                  mask;           // Line data mask
   char                 keyword[PPD_MAX_NAME],
-                                       /* Keyword from file */
+                                       // Keyword from file
                        name[PPD_MAX_NAME],
-                                       /* Option from file */
+                                       // Option from file
                        text[PPD_MAX_LINE],
-                                       /* Human-readable text from file */
-                       *string,        /* Code/text from file */
-                       *sptr,          /* Pointer into string */
-                       *temp,          /* Temporary string pointer */
-                       **tempfonts;    /* Temporary fonts pointer */
-  float                        order;          /* Order dependency number */
-  ppd_section_t                section;        /* Order dependency section */
-  ppd_profile_t                *profile;       /* Pointer to color profile */
-  char                 **filter;       /* Pointer to filter */
-  struct lconv         *loc;           /* Locale data */
-  int                  ui_keyword;     /* Is this line a UI keyword? */
-  cups_lang_t          *lang;          /* Language data */
-  cups_encoding_t      encoding;       /* Encoding of PPD file */
+                                       // Human-readable text from file
+                       *string,        // Code/text from file
+                       *sptr,          // Pointer into string
+                       *temp,          // Temporary string pointer
+                       **tempfonts;    // Temporary fonts pointer
+  float                        order;          // Order dependency number
+  ppd_section_t                section;        // Order dependency section
+  ppd_profile_t                *profile;       // Pointer to color profile
+  char                 **filter;       // Pointer to filter
+  struct lconv         *loc;           // Locale data
+  int                  ui_keyword;     // Is this line a UI keyword?
+  cups_lang_t          *lang;          // Language data
+  cups_encoding_t      encoding;       // Encoding of PPD file
   ppd_globals_t        *pg = ppdGlobals();
-                                       /* Global data */
+                                       // Global data
   char                 custom_name[PPD_MAX_NAME];
-                                       /* CustomFoo attribute name */
-  ppd_attr_t           *custom_attr;   /* CustomFoo attribute */
-  char                 ll[7],          /* Base language + '.' */
-                       ll_CC[7];       /* Language w/country + '.' */
-  size_t               ll_len = 0,     /* Base language length */
-                       ll_CC_len = 0;  /* Language w/country length */
+                                       // CustomFoo attribute name
+  ppd_attr_t           *custom_attr;   // CustomFoo attribute
+  char                 ll[7],          // Base language + '.'
+                       ll_CC[7];       // Language w/country + '.'
+  size_t               ll_len = 0,     // Base language length
+                       ll_CC_len = 0;  // Language w/country length
   static const char * const ui_keywords[] =
                        {
 #ifdef CUPS_USE_FULL_UI_KEYWORDS_LIST
- /*
-  * Adobe defines some 41 keywords as "UI", meaning that they are
-  * user interface elements and that they should be treated as such
-  * even if the PPD creator doesn't use Open/CloseUI around them.
-  *
-  * Since this can cause previously invisible options to appear and
-  * confuse users, the default is to only treat the PageSize and
-  * PageRegion keywords this way.
-  */
-                         /* Boolean keywords */
+ //
+ // Adobe defines some 41 keywords as "UI", meaning that they are
+ // user interface elements and that they should be treated as such
+ // even if the PPD creator doesn't use Open/CloseUI around them.
+ //
+ // Since this can cause previously invisible options to appear and
+ // confuse users, the default is to only treat the PageSize and
+ // PageRegion keywords this way.
+ //
+
+                         // Boolean keywords
                          "BlackSubstitution",
                          "Booklet",
                          "Collate",
@@ -477,7 +478,7 @@ ppdOpenWithLocalization(
                          "Sorter",
                          "TraySwitch",
 
-                         /* PickOne keywords */
+                         // PickOne keywords
                          "AdvanceMedia",
                          "BindColor",
                          "BindEdge",
@@ -511,12 +512,13 @@ ppdOpenWithLocalization(
                          "StapleWhen",
                          "StapleX",
                          "StapleY"
-#else /* !CUPS_USE_FULL_UI_KEYWORDS_LIST */
+#else // !CUPS_USE_FULL_UI_KEYWORDS_LIST
                          "PageRegion",
                          "PageSize"
-#endif /* CUPS_USE_FULL_UI_KEYWORDS_LIST */
+#endif // CUPS_USE_FULL_UI_KEYWORDS_LIST
                        };
-  static const char * const color_keywords[] = /* Keywords associated with color profiles */
+  static const char * const color_keywords[] = // Keywords associated with
+                                                // color profiles
                        {
                          ".cupsICCProfile",
                          ".ColorModel",
@@ -525,16 +527,16 @@ ppdOpenWithLocalization(
 
   DEBUG_printf(("ppdOpenWithLocalization(fp=%p)", fp));
 
- /*
-  * Default to "OK" status...
-  */
+  //
+  // Default to "OK" status...
+  //
 
   pg->ppd_status = PPD_OK;
   pg->ppd_line   = 0;
 
- /*
-  * Range check input...
-  */
+  //
+  // Range check input...
+  //
 
   if (fp == NULL)
   {
@@ -542,9 +544,9 @@ ppdOpenWithLocalization(
     return (NULL);
   }
 
- /*
-  * If only loading a single localization set up the strings to match...
-  */
+  //
+  // If only loading a single localization set up the strings to match...
+  //
 
   if (localization == PPD_LOCALIZATION_DEFAULT)
   {
@@ -553,27 +555,28 @@ ppdOpenWithLocalization(
 
     snprintf(ll_CC, sizeof(ll_CC), "%.5s.", lang->language);
 
-   /*
-    * <rdar://problem/22130168>
-    * <rdar://problem/27245567>
-    *
-    * Need to use a different base language for some locales...
-    */
+    //
+    // <rdar://problem/22130168>
+    // <rdar://problem/27245567>
+    //
+    // Need to use a different base language for some locales...
+    //
 
     if (!strcmp(lang->language, "zh_HK"))
-    {                                  /* Traditional Chinese + variants */
+    {                                  // Traditional Chinese + variants
       strlcpy(ll_CC, "zh_TW.", sizeof(ll_CC));
       strlcpy(ll, "zh_", sizeof(ll));
     }
     else if (!strncmp(lang->language, "zh", 2))
-      strlcpy(ll, "zh_", sizeof(ll));  /* Any Chinese variant */
+      strlcpy(ll, "zh_", sizeof(ll));  // Any Chinese variant
     else if (!strncmp(lang->language, "jp", 2))
-    {                                  /* Any Japanese variant */
+    {                                  // Any Japanese variant
       strlcpy(ll_CC, "ja", sizeof(ll_CC));
       strlcpy(ll, "jp", sizeof(ll));
     }
-    else if (!strncmp(lang->language, "nb", 2) || !strncmp(lang->language, "no", 2))
-    {                                  /* Any Norwegian variant */
+    else if (!strncmp(lang->language, "nb", 2) ||
+            !strncmp(lang->language, "no", 2))
+    {                                  // Any Norwegian variant
       strlcpy(ll_CC, "nb", sizeof(ll_CC));
       strlcpy(ll, "no", sizeof(ll));
     }
@@ -587,24 +590,25 @@ ppdOpenWithLocalization(
                   ll_CC, ll));
   }
 
- /*
-  * Grab the first line and make sure it reads '*PPD-Adobe: "major.minor"'...
-  */
+  //
+  // Grab the first line and make sure it reads '*PPD-Adobe: "major.minor"'...
+  //
 
   line.buffer  = NULL;
   line.bufsize = 0;
 
   mask = ppd_read(fp, &line, keyword, name, text, &string, 0, pg);
 
-  DEBUG_printf(("2ppdOpenWithLocalization: mask=%x, keyword=\"%s\"...", mask, keyword));
+  DEBUG_printf(("2ppdOpenWithLocalization: mask=%x, keyword=\"%s\"...",
+               mask, keyword));
 
   if (mask == 0 ||
       strcmp(keyword, "PPD-Adobe") ||
       string == NULL || string[0] != '4')
   {
-   /*
-    * Either this is not a PPD file, or it is not a 4.x PPD file.
-    */
+    //
+    // Either this is not a PPD file, or it is not a 4.x PPD file.
+    //
 
     if (pg->ppd_status == PPD_OK)
       pg->ppd_status = PPD_MISSING_PPDADOBE4;
@@ -615,11 +619,12 @@ ppdOpenWithLocalization(
     return (NULL);
   }
 
-  DEBUG_printf(("2ppdOpenWithLocalization: keyword=%s, string=%p", keyword, string));
+  DEBUG_printf(("2ppdOpenWithLocalization: keyword=%s, string=%p",
+               keyword, string));
 
- /*
-  * Allocate memory for the PPD file record...
-  */
+  //
+  // Allocate memory for the PPD file record...
+  //
 
   if ((ppd = calloc(1, sizeof(ppd_file_t))) == NULL)
   {
@@ -638,11 +643,12 @@ ppdOpenWithLocalization(
   ppd->color_device   = 0;
   ppd->colorspace     = PPD_CS_N;
   ppd->landscape      = -90;
-  ppd->coptions       = cupsArrayNew((cups_array_func_t)ppd_compare_coptions, NULL);
+  ppd->coptions       = cupsArrayNew((cups_array_func_t)ppd_compare_coptions,
+                                    NULL);
 
- /*
-  * Read lines from the PPD file and add them to the file record...
-  */
+  //
+  // Read lines from the PPD file and add them to the file record...
+  //
 
   group      = NULL;
   subgroup   = NULL;
@@ -661,9 +667,9 @@ ppdOpenWithLocalization(
     if (strncmp(keyword, "Default", 7) && !string &&
         pg->ppd_conform != PPD_CONFORM_RELAXED)
     {
-     /*
-      * Need a string value!
-      */
+      //
+      // Need a string value!
+      //
 
       pg->ppd_status = PPD_MISSING_VALUE;
 
@@ -672,29 +678,29 @@ ppdOpenWithLocalization(
     else if (!string)
       continue;
 
-   /*
-    * Certain main keywords (as defined by the PPD spec) may be used
-    * without the usual OpenUI/CloseUI stuff.  Presumably this is just
-    * so that Adobe wouldn't completely break compatibility with PPD
-    * files prior to v4.0 of the spec, but it is hopelessly
-    * inconsistent...  Catch these main keywords and automatically
-    * create the corresponding option, as needed...
-    */
+    //
+    // Certain main keywords (as defined by the PPD spec) may be used
+    // without the usual OpenUI/CloseUI stuff.  Presumably this is just
+    // so that Adobe wouldn't completely break compatibility with PPD
+    // files prior to v4.0 of the spec, but it is hopelessly
+    // inconsistent...  Catch these main keywords and automatically
+    // create the corresponding option, as needed...
+    //
 
     if (ui_keyword)
     {
-     /*
-      * Previous line was a UI keyword...
-      */
+      //
+      // Previous line was a UI keyword...
+      //
 
       option     = NULL;
       ui_keyword = 0;
     }
 
-   /*
-    * If we are filtering out keyword localizations, see if this line needs to
-    * be used...
-    */
+    //
+    // If we are filtering out keyword localizations, see if this line needs to
+    // be used...
+    //
 
     if (localization != PPD_LOCALIZATION_ALL &&
         (temp = strchr(keyword, '.')) != NULL &&
@@ -710,16 +716,17 @@ ppdOpenWithLocalization(
           strncmp(ll_CC, keyword, ll_CC_len) &&
           strncmp(ll, keyword, ll_len)))
       {
-       DEBUG_printf(("2ppdOpenWithLocalization: Ignoring localization: \"%s\"\n", keyword));
+       DEBUG_printf(("2ppdOpenWithLocalization: Ignoring localization: \"%s\"\n",
+                     keyword));
        free(string);
        string = NULL;
        continue;
       }
       else if (localization == PPD_LOCALIZATION_ICC_PROFILES)
       {
-       /*
-        * Only load localizations for the color profile related keywords...
-        */
+       //
+        // Only load localizations for the color profile related keywords...
+       //
 
        for (i = 0;
             i < (int)(sizeof(color_keywords) / sizeof(color_keywords[0]));
@@ -749,9 +756,9 @@ ppdOpenWithLocalization(
 
       if (i < (int)(sizeof(ui_keywords) / sizeof(ui_keywords[0])))
       {
-       /*
-        * Create the option in the appropriate group...
-       */
+       //
+        // Create the option in the appropriate group...
+       //
 
         ui_keyword = 1;
 
@@ -764,7 +771,8 @@ ppdOpenWithLocalization(
                                     encoding)) == NULL)
            goto error;
 
-          DEBUG_printf(("2ppdOpenWithLocalization: Adding to group %s...", group->text));
+          DEBUG_printf(("2ppdOpenWithLocalization: Adding to group %s...",
+                       group->text));
           option = ppd_get_option(group, keyword);
          group  = NULL;
        }
@@ -778,9 +786,9 @@ ppdOpenWithLocalization(
           goto error;
        }
 
-       /*
-       * Now fill in the initial information for the option...
-       */
+       //
+       // Now fill in the initial information for the option...
+       //
 
        if (!strncmp(keyword, "JCL", 3))
           option->section = PPD_ORDER_JCL;
@@ -825,9 +833,9 @@ ppdOpenWithLocalization(
       ppd->language_level = atoi(string);
     else if (!strcmp(keyword, "LanguageEncoding"))
     {
-     /*
-      * Say all PPD files are UTF-8, since we convert to UTF-8...
-      */
+      //
+      // Say all PPD files are UTF-8, since we convert to UTF-8...
+      //
 
       ppd->lang_encoding = strdup("UTF-8");
       encoding           = ppdGetEncoding(string);
@@ -846,7 +854,7 @@ ppdOpenWithLocalization(
     {
       if (encoding != CUPS_UTF8)
       {
-        cups_utf8_t    utf8[256];      /* UTF-8 version of NickName */
+        cups_utf8_t    utf8[256];      // UTF-8 version of NickName
 
 
         cupsCharsetToUTF8(utf8, string, sizeof(utf8), encoding);
@@ -864,23 +872,23 @@ ppdOpenWithLocalization(
     else if (!strcmp(keyword, "JCLBegin"))
     {
       ppd->jcl_begin = strdup(string);
-      ppd_decode(ppd->jcl_begin);      /* Decode quoted string */
+      ppd_decode(ppd->jcl_begin);      // Decode quoted string
     }
     else if (!strcmp(keyword, "JCLEnd"))
     {
       ppd->jcl_end = strdup(string);
-      ppd_decode(ppd->jcl_end);                /* Decode quoted string */
+      ppd_decode(ppd->jcl_end);                // Decode quoted string
     }
     else if (!strcmp(keyword, "JCLToPSInterpreter"))
     {
       ppd->jcl_ps = strdup(string);
-      ppd_decode(ppd->jcl_ps);         /* Decode quoted string */
+      ppd_decode(ppd->jcl_ps);         // Decode quoted string
     }
 #if HAVE_CUPS_3_X
     else if (!strcmp(keyword, "JCLToPDFInterpreter"))
     {
       ppd->jcl_pdf = strdup(string);
-      ppd_decode(ppd->jcl_pdf);                /* Decode quoted string */
+      ppd_decode(ppd->jcl_pdf);                // Decode quoted string
     }
 #endif
     else if (!strcmp(keyword, "AccurateScreensSupport"))
@@ -900,7 +908,8 @@ ppdOpenWithLocalization(
       if (ppd->num_profiles == 0)
         profile = malloc(sizeof(ppd_profile_t));
       else
-        profile = realloc(ppd->profiles, sizeof(ppd_profile_t) * (size_t)(ppd->num_profiles + 1));
+        profile = realloc(ppd->profiles, sizeof(ppd_profile_t) *
+                         (size_t)(ppd->num_profiles + 1));
 
       if (!profile)
       {
@@ -934,7 +943,8 @@ ppdOpenWithLocalization(
       if (ppd->num_filters == 0)
         filter = malloc(sizeof(char *));
       else
-        filter = realloc(ppd->filters, sizeof(char *) * (size_t)(ppd->num_filters + 1));
+        filter = realloc(ppd->filters, sizeof(char *) *
+                        (size_t)(ppd->num_filters + 1));
 
       if (filter == NULL)
       {
@@ -947,9 +957,9 @@ ppdOpenWithLocalization(
       filter           += ppd->num_filters;
       ppd->num_filters ++;
 
-     /*
-      * Make a copy of the filter string...
-      */
+      //
+      // Make a copy of the filter string...
+      //
 
       *filter = strdup(string);
     }
@@ -957,14 +967,15 @@ ppdOpenWithLocalization(
       ppd->throughput = atoi(string);
     else if (!strcmp(keyword, "Font"))
     {
-     /*
-      * Add this font to the list of available fonts...
-      */
+      //
+      // Add this font to the list of available fonts...
+      //
 
       if (ppd->num_fonts == 0)
         tempfonts = (char **)malloc(sizeof(char *));
       else
-        tempfonts = (char **)realloc(ppd->fonts, sizeof(char *) * (size_t)(ppd->num_fonts + 1));
+        tempfonts = (char **)realloc(ppd->fonts, sizeof(char *) *
+                                    (size_t)(ppd->num_fonts + 1));
 
       if (tempfonts == NULL)
       {
@@ -979,17 +990,17 @@ ppdOpenWithLocalization(
     }
     else if (!strncmp(keyword, "ParamCustom", 11))
     {
-      ppd_coption_t    *coption;       /* Custom option */
-      ppd_cparam_t     *cparam;        /* Custom parameter */
-      int              corder;         /* Order number */
-      char             ctype[33],      /* Data type */
-                       cminimum[65],   /* Minimum value */
-                       cmaximum[65];   /* Maximum value */
+      ppd_coption_t    *coption;       // Custom option
+      ppd_cparam_t     *cparam;        // Custom parameter
+      int              corder;         // Order number
+      char             ctype[33],      // Data type
+                       cminimum[65],   // Minimum value
+                       cmaximum[65];   // Maximum value
 
 
-     /*
-      * Get the custom option and parameter...
-      */
+      //
+      // Get the custom option and parameter...
+      //
 
       if ((coption = ppd_get_coption(ppd, keyword + 11)) == NULL)
       {
@@ -1012,9 +1023,9 @@ ppdOpenWithLocalization(
         goto error;
       }
 
-     /*
-      * Get the parameter data...
-      */
+      //
+      // Get the parameter data...
+      //
 
       if (!string ||
           sscanf(string, "%d%32s%64s%64s", &corder, ctype, cminimum,
@@ -1042,8 +1053,10 @@ ppdOpenWithLocalization(
       else if (!strcmp(ctype, "invcurve"))
       {
         cparam->type = PPD_CUSTOM_INVCURVE;
-       cparam->minimum.custom_invcurve = (float)_ppdStrScand(cminimum, NULL, loc);
-       cparam->maximum.custom_invcurve = (float)_ppdStrScand(cmaximum, NULL, loc);
+       cparam->minimum.custom_invcurve = (float)_ppdStrScand(cminimum, NULL,
+                                                             loc);
+       cparam->maximum.custom_invcurve = (float)_ppdStrScand(cmaximum, NULL,
+                                                             loc);
       }
       else if (!strcmp(ctype, "passcode"))
       {
@@ -1060,8 +1073,10 @@ ppdOpenWithLocalization(
       else if (!strcmp(ctype, "points"))
       {
         cparam->type = PPD_CUSTOM_POINTS;
-       cparam->minimum.custom_points = (float)_ppdStrScand(cminimum, NULL, loc);
-       cparam->maximum.custom_points = (float)_ppdStrScand(cmaximum, NULL, loc);
+       cparam->minimum.custom_points = (float)_ppdStrScand(cminimum, NULL,
+                                                           loc);
+       cparam->maximum.custom_points = (float)_ppdStrScand(cmaximum, NULL,
+                                                           loc);
       }
       else if (!strcmp(ctype, "real"))
       {
@@ -1082,9 +1097,9 @@ ppdOpenWithLocalization(
        goto error;
       }
 
-     /*
-      * Now special-case for CustomPageSize...
-      */
+      //
+      // Now special-case for CustomPageSize...
+      //
 
       if (!strcmp(coption->keyword, "PageSize"))
       {
@@ -1107,13 +1122,13 @@ ppdOpenWithLocalization(
     }
     else if (!strncmp(keyword, "Custom", 6) && !strcmp(name, "True") && !option)
     {
-      ppd_option_t     *custom_option; /* Custom option */
+      ppd_option_t     *custom_option; // Custom option
 
       DEBUG_puts("2ppdOpenWithLocalization: Processing Custom option...");
 
-     /*
-      * Get the option and custom option...
-      */
+      //
+      // Get the option and custom option...
+      //
 
       if (!ppd_get_coption(ppd, keyword + 6))
       {
@@ -1129,9 +1144,9 @@ ppdOpenWithLocalization(
 
       if (custom_option)
       {
-       /*
-       * Add the "custom" option...
-       */
+       //
+       // Add the "custom" option...
+       //
 
         if ((choice = ppdFindChoice(custom_option, "Custom")) == NULL)
          if ((choice = ppd_add_choice(custom_option, "Custom")) == NULL)
@@ -1152,15 +1167,15 @@ ppdOpenWithLocalization(
          ppd_decode(choice->code);
       }
 
-     /*
-      * Now process custom page sizes specially...
-      */
+      //
+      // Now process custom page sizes specially...
+      //
 
       if (!strcmp(keyword, "CustomPageSize"))
       {
-       /*
-       * Add a "Custom" page size entry...
-       */
+       //
+       // Add a "Custom" page size entry...
+       //
 
        ppd->variable_sizes = 1;
 
@@ -1195,18 +1210,20 @@ ppdOpenWithLocalization(
       else if (!strcmp(string, "Plus90"))
         ppd->landscape = 90;
     }
-    else if (!strcmp(keyword, "Emulators") && string && ppd->num_emulations == 0)
+    else if (!strcmp(keyword, "Emulators") && string &&
+            ppd->num_emulations == 0)
     {
-     /*
-      * Issue #5562: Samsung printer drivers incorrectly use Emulators keyword
-      *              to configure themselves
-      *
-      * The Emulators keyword was loaded but never used by anything in CUPS,
-      * and has no valid purpose in CUPS.  The old code was removed due to a
-      * memory leak (Issue #5475), so the following (new) code supports a single
-      * name for the Emulators keyword, allowing these drivers to work until we
-      * remove PPD and driver support entirely in a future version of CUPS.
-      */
+      //
+      // Issue #5562: Samsung printer drivers incorrectly use Emulators keyword
+      //              to configure themselves
+      //
+      // The Emulators keyword was loaded but never used by anything
+      // in CUPS, and has no valid purpose in CUPS.  The old code was
+      // removed due to a memory leak (Issue #5475), so the following
+      // (new) code supports a single name for the Emulators keyword,
+      // allowing these drivers to work until we remove PPD and driver
+      // support entirely in a future version of CUPS.
+      //
 
       ppd->num_emulations = 1;
       ppd->emulations     = calloc(1, sizeof(ppd_emul_t));
@@ -1215,9 +1232,9 @@ ppdOpenWithLocalization(
     }
     else if (!strcmp(keyword, "JobPatchFile"))
     {
-     /*
-      * CUPS STR #3421: Check for "*JobPatchFile: int: string"
-      */
+      //
+      // CUPS STR #3421: Check for "*JobPatchFile: int: string"
+      //
 
       if (isdigit(*string & 255))
       {
@@ -1225,9 +1242,9 @@ ppdOpenWithLocalization(
 
         if (*sptr == ':')
         {
-         /*
-          * Found "*JobPatchFile: int: string"...
-          */
+         //
+          // Found "*JobPatchFile: int: string"...
+         //
 
           pg->ppd_status = PPD_BAD_VALUE;
 
@@ -1237,9 +1254,9 @@ ppdOpenWithLocalization(
 
       if (!name[0] && pg->ppd_conform == PPD_CONFORM_STRICT)
       {
-       /*
-        * Found "*JobPatchFile: string"...
-        */
+       //
+        // Found "*JobPatchFile: string"...
+       //
 
         pg->ppd_status = PPD_MISSING_OPTION_KEYWORD;
 
@@ -1266,9 +1283,9 @@ ppdOpenWithLocalization(
     }
     else if (!strcmp(keyword, "OpenUI"))
     {
-     /*
-      * Don't allow nesting of options...
-      */
+      //
+      // Don't allow nesting of options...
+      //
 
       if (option && pg->ppd_conform == PPD_CONFORM_STRICT)
       {
@@ -1277,20 +1294,21 @@ ppdOpenWithLocalization(
        goto error;
       }
 
-     /*
-      * Add an option record to the current sub-group, group, or file...
-      */
+      //
+      // Add an option record to the current sub-group, group, or file...
+      //
 
-      DEBUG_printf(("2ppdOpenWithLocalization: name=\"%s\" (%d)", name, (int)strlen(name)));
+      DEBUG_printf(("2ppdOpenWithLocalization: name=\"%s\" (%d)",
+                   name, (int)strlen(name)));
 
       if (name[0] == '*')
-        _ppd_strcpy(name, name + 1); /* Eliminate leading asterisk */
+        _ppd_strcpy(name, name + 1); // Eliminate leading asterisk
 
       for (i = (int)strlen(name) - 1; i > 0 && _ppd_isspace(name[i]); i --)
-        name[i] = '\0'; /* Eliminate trailing spaces */
+        name[i] = '\0'; // Eliminate trailing spaces
 
-      DEBUG_printf(("2ppdOpenWithLocalization: OpenUI of %s in group %s...", name,
-                    group ? group->text : "(null)"));
+      DEBUG_printf(("2ppdOpenWithLocalization: OpenUI of %s in group %s...",
+                   name, group ? group->text : "(null)"));
 
       if (subgroup != NULL)
         option = ppd_get_option(subgroup, name);
@@ -1300,7 +1318,8 @@ ppdOpenWithLocalization(
                                   encoding)) == NULL)
          goto error;
 
-        DEBUG_printf(("2ppdOpenWithLocalization: Adding to group %s...", group->text));
+        DEBUG_printf(("2ppdOpenWithLocalization: Adding to group %s...",
+                     group->text));
         option = ppd_get_option(group, name);
        group  = NULL;
       }
@@ -1314,9 +1333,9 @@ ppdOpenWithLocalization(
        goto error;
       }
 
-     /*
-      * Now fill in the initial information for the option...
-      */
+      //
+      // Now fill in the initial information for the option...
+      //
 
       if (string && !strcmp(string, "PickMany"))
         option->ui = PPD_UI_PICKMANY;
@@ -1369,10 +1388,10 @@ ppdOpenWithLocalization(
       free(string);
       string = NULL;
 
-     /*
-      * Add a custom option choice if we have already seen a CustomFoo
-      * attribute...
-      */
+      //
+      // Add a custom option choice if we have already seen a CustomFoo
+      // attribute...
+      //
 
       if (!_ppd_strcasecmp(name, "PageRegion"))
         strlcpy(custom_name, "CustomPageSize", sizeof(custom_name));
@@ -1399,9 +1418,9 @@ ppdOpenWithLocalization(
     }
     else if (!strcmp(keyword, "JCLOpenUI"))
     {
-     /*
-      * Don't allow nesting of options...
-      */
+      //
+      // Don't allow nesting of options...
+      //
 
       if (option && pg->ppd_conform == PPD_CONFORM_STRICT)
       {
@@ -1410,18 +1429,18 @@ ppdOpenWithLocalization(
        goto error;
       }
 
-     /*
-      * Find the JCL group, and add if needed...
-      */
+      //
+      // Find the JCL group, and add if needed...
+      //
 
       group = ppd_get_group(ppd, "JCL", _("JCL"), pg, encoding);
 
       if (group == NULL)
        goto error;
 
-     /*
-      * Add an option record to the current JCLs...
-      */
+      //
+      // Add an option record to the current JCLs...
+      //
 
       if (name[0] == '*')
         _ppd_strcpy(name, name + 1);
@@ -1435,9 +1454,9 @@ ppdOpenWithLocalization(
        goto error;
       }
 
-     /*
-      * Now fill in the initial information for the option...
-      */
+      //
+      // Now fill in the initial information for the option...
+      //
 
       if (string && !strcmp(string, "PickMany"))
         option->ui = PPD_UI_PICKMANY;
@@ -1476,10 +1495,10 @@ ppdOpenWithLocalization(
       free(string);
       string = NULL;
 
-     /*
-      * Add a custom option choice if we have already seen a CustomFoo
-      * attribute...
-      */
+      //
+      // Add a custom option choice if we have already seen a CustomFoo
+      // attribute...
+      //
 
       snprintf(custom_name, sizeof(custom_name), "Custom%.34s", name);
 
@@ -1502,7 +1521,8 @@ ppdOpenWithLocalization(
     }
     else if (!strcmp(keyword, "CloseUI"))
     {
-      if ((!option || option->section == PPD_ORDER_JCL) && pg->ppd_conform == PPD_CONFORM_STRICT)
+      if ((!option || option->section == PPD_ORDER_JCL) &&
+         pg->ppd_conform == PPD_CONFORM_STRICT)
       {
         pg->ppd_status = PPD_BAD_CLOSE_UI;
 
@@ -1516,7 +1536,8 @@ ppdOpenWithLocalization(
     }
     else if (!strcmp(keyword, "JCLCloseUI"))
     {
-      if ((!option || option->section != PPD_ORDER_JCL) && pg->ppd_conform == PPD_CONFORM_STRICT)
+      if ((!option || option->section != PPD_ORDER_JCL) &&
+         pg->ppd_conform == PPD_CONFORM_STRICT)
       {
         pg->ppd_status = PPD_BAD_CLOSE_UI;
 
@@ -1530,9 +1551,9 @@ ppdOpenWithLocalization(
     }
     else if (!strcmp(keyword, "OpenGroup"))
     {
-     /*
-      * Open a new group...
-      */
+      //
+      // Open a new group...
+      //
 
       if (group != NULL)
       {
@@ -1548,24 +1569,24 @@ ppdOpenWithLocalization(
        goto error;
       }
 
-     /*
-      * Separate the group name from the text (name/text)...
-      */
+      //
+      // Separate the group name from the text (name/text)...
+      //
 
       if ((sptr = strchr(string, '/')) != NULL)
         *sptr++ = '\0';
       else
         sptr = string;
 
-     /*
-      * Fix up the text...
-      */
+      //
+      // Fix up the text...
+      //
 
       ppd_decode(sptr);
 
-     /*
-      * Find/add the group...
-      */
+      //
+      // Find/add the group...
+      //
 
       group = ppd_get_group(ppd, string, sptr, pg, encoding);
 
@@ -1614,9 +1635,9 @@ ppdOpenWithLocalization(
         ppd_group_t    *gtemp;
 
 
-       /*
-        * Only valid for Non-UI options...
-       */
+       //
+        // Only valid for Non-UI options...
+       //
 
         for (i = ppd->num_groups, gtemp = ppd->groups; i > 0; i --, gtemp ++)
           if (gtemp->text[0] == '\0')
@@ -1645,22 +1666,22 @@ ppdOpenWithLocalization(
       if (string == NULL)
         continue;
 
-     /*
-      * Drop UI text, if any, from value...
-      */
+      //
+      // Drop UI text, if any, from value...
+      //
 
       if (strchr(string, '/') != NULL)
         *strchr(string, '/') = '\0';
 
-     /*
-      * Assign the default value as appropriate...
-      */
+      //
+      // Assign the default value as appropriate...
+      //
 
       if (!strcmp(keyword, "DefaultColorSpace"))
       {
-       /*
-        * Set default colorspace...
-       */
+       //
+        // Set default colorspace...
+       //
 
        if (!strcmp(string, "CMY"))
           ppd->colorspace = PPD_CS_CMY;
@@ -1677,28 +1698,31 @@ ppdOpenWithLocalization(
       }
       else if (option && !strcmp(keyword + 7, option->keyword))
       {
-       /*
-        * Set the default as part of the current option...
-       */
+       //
+        // Set the default as part of the current option...
+       //
 
-        DEBUG_printf(("2ppdOpenWithLocalization: Setting %s to %s...", keyword, string));
+        DEBUG_printf(("2ppdOpenWithLocalization: Setting %s to %s...",
+                     keyword, string));
 
         strlcpy(option->defchoice, string, sizeof(option->defchoice));
 
-        DEBUG_printf(("2ppdOpenWithLocalization: %s is now %s...", keyword, option->defchoice));
+        DEBUG_printf(("2ppdOpenWithLocalization: %s is now %s...",
+                     keyword, option->defchoice));
       }
       else
       {
-       /*
-        * Lookup option and set if it has been defined...
-       */
+       //
+        // Lookup option and set if it has been defined...
+       //
 
-        ppd_option_t   *toption;       /* Temporary option */
+        ppd_option_t   *toption;       // Temporary option
 
 
         if ((toption = ppdFindOption(ppd, keyword + 7)) != NULL)
        {
-         DEBUG_printf(("2ppdOpenWithLocalization: Setting %s to %s...", keyword, string));
+         DEBUG_printf(("2ppdOpenWithLocalization: Setting %s to %s...",
+                       keyword, string));
          strlcpy(toption->defchoice, string, sizeof(toption->defchoice));
        }
       }
@@ -1715,7 +1739,8 @@ ppdOpenWithLocalization(
       if (ppd->num_consts == 0)
        constraint = calloc(2, sizeof(ppd_const_t));
       else
-       constraint = realloc(ppd->consts, (size_t)(ppd->num_consts + 2) * sizeof(ppd_const_t));
+       constraint = realloc(ppd->consts, (size_t)(ppd->num_consts + 2) *
+                            sizeof(ppd_const_t));
 
       if (constraint == NULL)
       {
@@ -1732,14 +1757,14 @@ ppdOpenWithLocalization(
                      constraint->choice1, constraint->option2,
                     constraint->choice2))
       {
-        default : /* Error */
+        default : // Error
            pg->ppd_status = PPD_BAD_UI_CONSTRAINTS;
            goto error;
 
-       case 2 : /* Two options... */
-          /*
-           * Check for broken constraints like "* Option"...
-           */
+       case 2 : // Two options...
+           //
+           // Check for broken constraints like "* Option"...
+           //
 
            if (pg->ppd_conform == PPD_CONFORM_STRICT &&
                (!strcmp(constraint->option1, "*") ||
@@ -1749,10 +1774,10 @@ ppdOpenWithLocalization(
              goto error;
            }
 
-          /*
-           * The following strcpy's are safe, as optionN and
-           * choiceN are all the same size (size defined by PPD spec...)
-           */
+           //
+           // The following strcpy's are safe, as optionN and
+           // choiceN are all the same size (size defined by PPD spec...)
+           //
 
            if (constraint->option1[0] == '*')
              _ppd_strcpy(constraint->option1, constraint->option1 + 1);
@@ -1774,10 +1799,10 @@ ppdOpenWithLocalization(
             constraint->choice2[0] = '\0';
            break;
 
-       case 3 : /* Two options, one choice... */
-          /*
-           * Check for broken constraints like "* Option"...
-           */
+       case 3 : // Two options, one choice...
+           //
+           // Check for broken constraints like "* Option"...
+           //
 
            if (pg->ppd_conform == PPD_CONFORM_STRICT &&
                (!strcmp(constraint->option1, "*") ||
@@ -1788,10 +1813,10 @@ ppdOpenWithLocalization(
              goto error;
            }
 
-          /*
-           * The following _ppd_strcpy's are safe, as optionN and
-           * choiceN are all the same size (size defined by PPD spec...)
-           */
+           //
+           // The following _ppd_strcpy's are safe, as optionN and
+           // choiceN are all the same size (size defined by PPD spec...)
+           //
 
            if (constraint->option1[0] == '*')
              _ppd_strcpy(constraint->option1, constraint->option1 + 1);
@@ -1828,10 +1853,10 @@ ppdOpenWithLocalization(
            }
            break;
 
-       case 4 : /* Two options, two choices... */
-          /*
-           * Check for broken constraints like "* Option"...
-           */
+       case 4 : // Two options, two choices...
+           //
+           // Check for broken constraints like "* Option"...
+           //
 
            if (pg->ppd_conform == PPD_CONFORM_STRICT &&
                (!strcmp(constraint->option1, "*") ||
@@ -1875,18 +1900,19 @@ ppdOpenWithLocalization(
            break;
       }
 
-     /*
-      * Don't add this one as an attribute...
-      */
+      //
+      // Don't add this one as an attribute...
+      //
 
       free(string);
       string = NULL;
     }
     else if (!strcmp(keyword, "PaperDimension"))
     {
-      if (!_ppd_strcasecmp(name, "custom") || !_ppd_strncasecmp(name, "custom.", 7))
+      if (!_ppd_strcasecmp(name, "custom") ||
+         !_ppd_strncasecmp(name, "custom.", 7))
       {
-        char cname[PPD_MAX_NAME];      /* Rewrite with a leading underscore */
+        char cname[PPD_MAX_NAME];      // Rewrite with a leading underscore
         snprintf(cname, sizeof(cname), "_%.39s", name);
         strlcpy(name, cname, sizeof(name));
       }
@@ -1896,9 +1922,9 @@ ppdOpenWithLocalization(
 
       if (size == NULL)
       {
-       /*
-        * Unable to add or find size!
-       */
+       //
+        // Unable to add or find size!
+       //
 
         pg->ppd_status = PPD_ALLOC_ERROR;
 
@@ -1915,7 +1941,7 @@ ppdOpenWithLocalization(
     {
       if (!_ppd_strcasecmp(name, "custom") || !_ppd_strncasecmp(name, "custom.", 7))
       {
-        char cname[PPD_MAX_NAME];      /* Rewrite with a leading underscore */
+        char cname[PPD_MAX_NAME];      // Rewrite with a leading underscore
         snprintf(cname, sizeof(cname), "_%.39s", name);
         strlcpy(name, cname, sizeof(name));
       }
@@ -1925,9 +1951,9 @@ ppdOpenWithLocalization(
 
       if (size == NULL)
       {
-       /*
-        * Unable to add or find size!
-       */
+       //
+        // Unable to add or find size!
+       //
 
         pg->ppd_status = PPD_ALLOC_ERROR;
 
@@ -1951,24 +1977,24 @@ ppdOpenWithLocalization(
 
       if (!_ppd_strcasecmp(name, "custom") || !_ppd_strncasecmp(name, "custom.", 7))
       {
-        char cname[PPD_MAX_NAME];      /* Rewrite with a leading underscore */
+        char cname[PPD_MAX_NAME];      // Rewrite with a leading underscore
         snprintf(cname, sizeof(cname), "_%.39s", name);
         strlcpy(name, cname, sizeof(name));
       }
 
       if (!strcmp(keyword, "PageSize"))
       {
-       /*
-        * Add a page size...
-       */
+       //
+        // Add a page size...
+       //
 
         if (ppdPageSize(ppd, name) == NULL)
          ppd_add_size(ppd, name);
       }
 
-     /*
-      * Add the option choice...
-      */
+      //
+      // Add the option choice...
+      //
 
       if ((choice = ppd_add_choice(option, name)) == NULL)
       {
@@ -1988,15 +2014,15 @@ ppdOpenWithLocalization(
         strlcpy(choice->text, name, sizeof(choice->text));
 
       if (option->section == PPD_ORDER_JCL)
-        ppd_decode(string);            /* Decode quoted string */
+        ppd_decode(string);            // Decode quoted string
 
       choice->code = string;
-      string       = NULL;             /* Don't add as an attribute below */
+      string       = NULL;             // Don't add as an attribute below
     }
 
-   /*
-    * Add remaining lines with keywords and string values as attributes...
-    */
+    //
+    // Add remaining lines with keywords and string values as attributes...
+    //
 
     if (string &&
         (mask & (PPD_KEYWORD | PPD_STRING)) == (PPD_KEYWORD | PPD_STRING))
@@ -2005,9 +2031,9 @@ ppdOpenWithLocalization(
       free(string);
   }
 
- /*
-  * Check for a missing CloseUI/JCLCloseUI...
-  */
+  //
+  // Check for a missing CloseUI/JCLCloseUI...
+  //
 
   if (option && pg->ppd_conform == PPD_CONFORM_STRICT)
   {
@@ -2015,9 +2041,9 @@ ppdOpenWithLocalization(
     goto error;
   }
 
- /*
-  * Check for a missing CloseGroup...
-  */
+  //
+  // Check for a missing CloseGroup...
+  //
 
   if (group && pg->ppd_conform == PPD_CONFORM_STRICT)
   {
@@ -2027,30 +2053,30 @@ ppdOpenWithLocalization(
 
   free(line.buffer);
 
- /*
-  * Reset language preferences...
-  */
+  //
+  // Reset language preferences...
+  //
 
 #ifdef DEBUG
   if (!cupsFileEOF(fp))
     DEBUG_printf(("1ppdOpenWithLocalization: Premature EOF at %lu...\n",
                   (unsigned long)cupsFileTell(fp)));
-#endif /* DEBUG */
+#endif // DEBUG
 
   if (pg->ppd_status != PPD_OK)
   {
-   /*
-    * Had an error reading the PPD file, cannot continue!
-    */
+    //
+    // Had an error reading the PPD file, cannot continue!
+    //
 
     ppdClose(ppd);
 
     return (NULL);
   }
 
- /*
-  * Update the filters array as needed...
-  */
+  //
+  // Update the filters array as needed...
+  //
 
   if (!ppd_update_filters(ppd, pg))
   {
@@ -2059,10 +2085,10 @@ ppdOpenWithLocalization(
     return (NULL);
   }
 
- /*
-  * Create the sorted options array and set the option back-pointer for
-  * each choice and custom option...
-  */
+  //
+  // Create the sorted options array and set the option back-pointer for
+  // each choice and custom option...
+  //
 
   ppd->options = cupsArrayNew2((cups_array_func_t)ppd_compare_options, NULL,
                                (cups_ahash_func_t)ppd_hash_option,
@@ -2076,7 +2102,7 @@ ppdOpenWithLocalization(
          j > 0;
         j --, option ++)
     {
-      ppd_coption_t    *coption;       /* Custom option */
+      ppd_coption_t    *coption;       // Custom option
 
 
       cupsArrayAdd(ppd->options, option);
@@ -2089,23 +2115,23 @@ ppdOpenWithLocalization(
     }
   }
 
- /*
-  * Create an array to track the marked choices...
-  */
+  //
+  // Create an array to track the marked choices...
+  //
 
   ppd->marked = cupsArrayNew((cups_array_func_t)ppd_compare_choices, NULL);
 
- /*
-  * Return the PPD file structure...
-  */
+  //
+  // Return the PPD file structure...
+  //
 
   return (ppd);
 
- /*
-  * Common exit point for errors to save code size...
-  */
+  //
+  // Common exit point for errors to save code size...
+  //
 
 error:
+ error:
 
   free(string);
   free(line.buffer);
@@ -2116,33 +2142,33 @@ ppdOpenWithLocalization(
 }
 
 
-/*
- * 'ppdOpen()' - Read a PPD file into memory.
- */
+//
+// 'ppdOpen()' - Read a PPD file into memory.
+//
 
-ppd_file_t *                           /* O - PPD file record */
-ppdOpen(FILE *fp)                      /* I - File to read from */
+ppd_file_t *                           // O - PPD file record
+ppdOpen(FILE *fp)                      // I - File to read from
 {
-  ppd_file_t   *ppd;                   /* PPD file record */
-  cups_file_t  *cf;                    /* CUPS file */
+  ppd_file_t   *ppd;                   // PPD file record
+  cups_file_t  *cf;                    // CUPS file
 
 
- /*
-  * Reopen the stdio file as a CUPS file...
-  */
+  //
+  // Reopen the stdio file as a CUPS file...
+  //
 
   if ((cf = cupsFileOpenFd(fileno(fp), "r")) == NULL)
     return (NULL);
 
- /*
-  * Load the PPD file using the newer API...
-  */
+  //
+  // Load the PPD file using the newer API...
+  //
 
   ppd = ppdOpenWithLocalization(cf, PPD_LOCALIZATION_DEFAULT);
 
- /*
-  * Close the CUPS file and return the PPD...
-  */
+  //
+  // Close the CUPS file and return the PPD...
+  //
 
   cupsFileClose(cf);
 
@@ -2150,41 +2176,44 @@ ppdOpen(FILE *fp)                       /* I - File to read from */
 }
 
 
-/*
- * 'ppdOpen2()' - Read a PPD file into memory.
- *
- * @since CUPS 1.2/macOS 10.5@
- */
+//
+// 'ppdOpen2()' - Read a PPD file into memory.
+//
+// @since CUPS 1.2/macOS 10.5@
+//
 
-ppd_file_t *                           /* O - PPD file record or @code NULL@ if the PPD file could not be opened. */
-ppdOpen2(cups_file_t *fp)              /* I - File to read from */
+ppd_file_t *                           // O - PPD file record or @code NULL@
+                                       //     if the PPD file could not be
+                                       //     opened.
+ppdOpen2(cups_file_t *fp)              // I - File to read from
 {
   return ppdOpenWithLocalization(fp, PPD_LOCALIZATION_DEFAULT);
 }
 
 
-/*
- * 'ppdOpenFd()' - Read a PPD file into memory.
- */
+//
+// 'ppdOpenFd()' - Read a PPD file into memory.
+//
 
-ppd_file_t *                           /* O - PPD file record or @code NULL@ if the PPD file could not be opened. */
-ppdOpenFd(int fd)                      /* I - File to read from */
+ppd_file_t *                           // O - PPD file record or @code NULL@
+                                       //     if the PPD file could not be
+                                       //     opened.
+ppdOpenFd(int fd)                      // I - File to read from
 {
-  cups_file_t          *fp;            /* CUPS file pointer */
-  ppd_file_t           *ppd;           /* PPD file record */
-  ppd_globals_t        *pg = ppdGlobals();
-                                       /* Global data */
+  cups_file_t          *fp;            // CUPS file pointer
+  ppd_file_t           *ppd;           // PPD file record
+  ppd_globals_t        *pg = ppdGlobals();     // Global data
 
 
- /*
-  * Set the line number to 0...
-  */
+  //
+  // Set the line number to 0...
+  //
 
   pg->ppd_line = 0;
 
- /*
-  * Range check input...
-  */
+  //
+  // Range check input...
+  //
 
   if (fd < 0)
   {
@@ -2193,9 +2222,9 @@ ppdOpenFd(int fd)                 /* I - File to read from */
     return (NULL);
   }
 
- /*
-  * Try to open the file and parse it...
-  */
+  //
+  // Try to open the file and parse it...
+  //
 
   if ((fp = cupsFileOpenFd(fd, "r")) != NULL)
   {
@@ -2213,29 +2242,31 @@ ppdOpenFd(int fd)                       /* I - File to read from */
 }
 
 
-/*
- * 'ppdOpenFileWithLocalization()' - Read a PPD file into memory.
- */
+//
+// 'ppdOpenFileWithLocalization()' - Read a PPD file into memory.
+//
 
-ppd_file_t *                           /* O - PPD file record or @code NULL@ if the PPD file could not be opened. */
-ppdOpenFileWithLocalization(const char           *filename,    /* I - File to read from */
-            ppd_localization_t  localization)  /* I - Localization to load */
+ppd_file_t *                           // O - PPD file record or @code NULL@
+                                       //     if the PPD file could not be
+                                       //     opened.
+ppdOpenFileWithLocalization(
+    const char         *filename,      // I - File to read from
+    ppd_localization_t  localization)  // I - Localization to load
 {
-  cups_file_t          *fp;            /* File pointer */
-  ppd_file_t           *ppd;           /* PPD file record */
-  ppd_globals_t        *pg = ppdGlobals();
-                                       /* Global data */
+  cups_file_t          *fp;            // File pointer
+  ppd_file_t           *ppd;           // PPD file record
+  ppd_globals_t        *pg = ppdGlobals();     // Global data
 
 
- /*
-  * Set the line number to 0...
-  */
+  //
+  // Set the line number to 0...
+  //
 
   pg->ppd_line = 0;
 
- /*
-  * Range check input...
-  */
+  //
+  // Range check input...
+  //
 
   if (filename == NULL)
   {
@@ -2244,9 +2275,9 @@ ppdOpenFileWithLocalization(const char              *filename,    /* I - File to read from */
     return (NULL);
   }
 
- /*
-  * Try to open the file and parse it...
-  */
+  //
+  // Try to open the file and parse it...
+  //
 
   if ((fp = cupsFileOpen(filename, "r")) != NULL)
   {
@@ -2264,72 +2295,74 @@ ppdOpenFileWithLocalization(const char            *filename,    /* I - File to read from */
 }
 
 
-/*
- * 'ppdOpenFile()' - Read a PPD file into memory.
- */
+//
+// 'ppdOpenFile()' - Read a PPD file into memory.
+//
 
-ppd_file_t *                           /* O - PPD file record or @code NULL@ if the PPD file could not be opened. */
-ppdOpenFile(const char *filename)      /* I - File to read from */
+ppd_file_t *                           // O - PPD file record or @code NULL@
+                                       //     if the PPD file could not be
+                                       //     opened.
+ppdOpenFile(const char *filename)      // I - File to read from
 {
   return ppdOpenFileWithLocalization(filename, PPD_LOCALIZATION_DEFAULT);
 }
 
 
-/*
- * 'ppdSetConformance()' - Set the conformance level for PPD files.
- *
- * @since CUPS 1.1.20/macOS 10.4@
- */
+//
+// 'ppdSetConformance()' - Set the conformance level for PPD files.
+//
+// @since CUPS 1.1.20/macOS 10.4@
+//
 
 void
-ppdSetConformance(ppd_conform_t c)     /* I - Conformance level */
+ppdSetConformance(ppd_conform_t c)     // I - Conformance level
 {
-  ppd_globals_t        *pg = ppdGlobals();
-                                       /* Global data */
+  ppd_globals_t        *pg = ppdGlobals();     // Global data
 
 
   pg->ppd_conform = c;
 }
 
 
-/*
- * 'ppd_add_attr()' - Add an attribute to the PPD data.
- */
+//
+// 'ppd_add_attr()' - Add an attribute to the PPD data.
+//
 
-static ppd_attr_t *                    /* O - New attribute */
-ppd_add_attr(ppd_file_t *ppd,          /* I - PPD file data */
-             const char *name,         /* I - Attribute name */
-             const char *spec,         /* I - Specifier string, if any */
-            const char *text,          /* I - Text string, if any */
-            const char *value)         /* I - Value of attribute */
+static ppd_attr_t *                    // O - New attribute
+ppd_add_attr(ppd_file_t *ppd,          // I - PPD file data
+             const char *name,         // I - Attribute name
+             const char *spec,         // I - Specifier string, if any
+            const char *text,          // I - Text string, if any
+            const char *value)         // I - Value of attribute
 {
-  ppd_attr_t   **ptr,                  /* New array */
-               *temp;                  /* New attribute */
+  ppd_attr_t   **ptr,                  // New array
+               *temp;                  // New attribute
 
 
- /*
-  * Range check input...
-  */
+  //
+  // Range check input...
+  //
 
   if (ppd == NULL || name == NULL || spec == NULL)
     return (NULL);
 
- /*
-  * Create the array as needed...
-  */
+  //
+  // Create the array as needed...
+  //
 
   if (!ppd->sorted_attrs)
     ppd->sorted_attrs = cupsArrayNew((cups_array_func_t)ppd_compare_attrs,
                                      NULL);
 
- /*
-  * Allocate memory for the new attribute...
-  */
+  //
+  // Allocate memory for the new attribute...
+  //
 
   if (ppd->num_attrs == 0)
     ptr = malloc(sizeof(ppd_attr_t *));
   else
-    ptr = realloc(ppd->attrs, (size_t)(ppd->num_attrs + 1) * sizeof(ppd_attr_t *));
+    ptr = realloc(ppd->attrs, (size_t)(ppd->num_attrs + 1) *
+                 sizeof(ppd_attr_t *));
 
   if (ptr == NULL)
     return (NULL);
@@ -2344,44 +2377,45 @@ ppd_add_attr(ppd_file_t *ppd,           /* I - PPD file data */
 
   ppd->num_attrs ++;
 
- /*
-  * Copy data over...
-  */
+  //
+  // Copy data over...
+  //
 
   strlcpy(temp->name, name, sizeof(temp->name));
   strlcpy(temp->spec, spec, sizeof(temp->spec));
   strlcpy(temp->text, text, sizeof(temp->text));
   temp->value = (char *)value;
 
- /*
-  * Add the attribute to the sorted array...
-  */
+  //
+  // Add the attribute to the sorted array...
+  //
 
   cupsArrayAdd(ppd->sorted_attrs, temp);
 
- /*
-  * Return the attribute...
-  */
+  //
+  // Return the attribute...
+  //
 
   return (temp);
 }
 
 
-/*
- * 'ppd_add_choice()' - Add a choice to an option.
- */
+//
+// 'ppd_add_choice()' - Add a choice to an option.
+//
 
-static ppd_choice_t *                  /* O - Named choice */
-ppd_add_choice(ppd_option_t *option,   /* I - Option */
-               const char   *name)     /* I - Name of choice */
+static ppd_choice_t *                  // O - Named choice
+ppd_add_choice(ppd_option_t *option,   // I - Option
+               const char   *name)     // I - Name of choice
 {
-  ppd_choice_t *choice;                /* Choice */
+  ppd_choice_t *choice;                // Choice
 
 
   if (option->num_choices == 0)
     choice = malloc(sizeof(ppd_choice_t));
   else
-    choice = realloc(option->choices, sizeof(ppd_choice_t) * (size_t)(option->num_choices + 1));
+    choice = realloc(option->choices, sizeof(ppd_choice_t) *
+                    (size_t)(option->num_choices + 1));
 
   if (choice == NULL)
     return (NULL);
@@ -2397,21 +2431,22 @@ ppd_add_choice(ppd_option_t *option,    /* I - Option */
 }
 
 
-/*
- * 'ppd_add_size()' - Add a page size.
- */
+//
+// 'ppd_add_size()' - Add a page size.
+//
 
-static ppd_size_t *                    /* O - Named size */
-ppd_add_size(ppd_file_t *ppd,          /* I - PPD file */
-             const char *name)         /* I - Name of size */
+static ppd_size_t *                    // O - Named size
+ppd_add_size(ppd_file_t *ppd,          // I - PPD file
+             const char *name)         // I - Name of size
 {
-  ppd_size_t   *size;                  /* Size */
+  ppd_size_t   *size;                  // Size
 
 
   if (ppd->num_sizes == 0)
     size = malloc(sizeof(ppd_size_t));
   else
-    size = realloc(ppd->sizes, sizeof(ppd_size_t) * (size_t)(ppd->num_sizes + 1));
+    size = realloc(ppd->sizes, sizeof(ppd_size_t) *
+                  (size_t)(ppd->num_sizes + 1));
 
   if (size == NULL)
     return (NULL);
@@ -2427,63 +2462,63 @@ ppd_add_size(ppd_file_t *ppd,           /* I - PPD file */
 }
 
 
-/*
- * 'ppd_compare_attrs()' - Compare two attributes.
- */
+//
+// 'ppd_compare_attrs()' - Compare two attributes.
+//
 
-static int                             /* O - Result of comparison */
-ppd_compare_attrs(ppd_attr_t *a,       /* I - First attribute */
-                  ppd_attr_t *b)       /* I - Second attribute */
+static int                             // O - Result of comparison
+ppd_compare_attrs(ppd_attr_t *a,       // I - First attribute
+                  ppd_attr_t *b)       // I - Second attribute
 {
   return (_ppd_strcasecmp(a->name, b->name));
 }
 
 
-/*
- * 'ppd_compare_choices()' - Compare two choices...
- */
+//
+// 'ppd_compare_choices()' - Compare two choices...
+//
 
-static int                             /* O - Result of comparison */
-ppd_compare_choices(ppd_choice_t *a,   /* I - First choice */
-                    ppd_choice_t *b)   /* I - Second choice */
+static int                             // O - Result of comparison
+ppd_compare_choices(ppd_choice_t *a,   // I - First choice
+                    ppd_choice_t *b)   // I - Second choice
 {
   return (strcmp(a->option->keyword, b->option->keyword));
 }
 
 
-/*
- * 'ppd_compare_coptions()' - Compare two custom options.
- */
+//
+// 'ppd_compare_coptions()' - Compare two custom options.
+//
 
-static int                             /* O - Result of comparison */
-ppd_compare_coptions(ppd_coption_t *a, /* I - First option */
-                     ppd_coption_t *b) /* I - Second option */
+static int                             // O - Result of comparison
+ppd_compare_coptions(ppd_coption_t *a, // I - First option
+                     ppd_coption_t *b) // I - Second option
 {
   return (_ppd_strcasecmp(a->keyword, b->keyword));
 }
 
 
-/*
- * 'ppd_compare_options()' - Compare two options.
- */
+//
+// 'ppd_compare_options()' - Compare two options.
+//
 
-static int                             /* O - Result of comparison */
-ppd_compare_options(ppd_option_t *a,   /* I - First option */
-                    ppd_option_t *b)   /* I - Second option */
+static int                             // O - Result of comparison
+ppd_compare_options(ppd_option_t *a,   // I - First option
+                    ppd_option_t *b)   // I - Second option
 {
   return (_ppd_strcasecmp(a->keyword, b->keyword));
 }
 
 
-/*
- * 'ppd_decode()' - Decode a string value...
- */
+//
+// 'ppd_decode()' - Decode a string value...
+//
 
-static int                             /* O - Length of decoded string */
-ppd_decode(char *string)               /* I - String to decode */
+static int                             // O - Length of decoded string
+ppd_decode(char *string)               // I - String to decode
 {
-  char *inptr,                         /* Input pointer */
-       *outptr;                        /* Output pointer */
+  char *inptr,                         // Input pointer
+       *outptr;                        // Output pointer
 
 
   inptr  = string;
@@ -2492,9 +2527,9 @@ ppd_decode(char *string)          /* I - String to decode */
   while (*inptr != '\0')
     if (*inptr == '<' && isxdigit(inptr[1] & 255))
     {
-     /*
-      * Convert hex to 8-bit values...
-      */
+      //
+      // Convert hex to 8-bit values...
+      //
 
       inptr ++;
       while (isxdigit(*inptr & 255))
@@ -2532,15 +2567,15 @@ ppd_decode(char *string)                /* I - String to decode */
 }
 
 
-/*
- * 'ppd_free_filters()' - Free the filters array.
- */
+//
+// 'ppd_free_filters()' - Free the filters array.
+//
 
 static void
-ppd_free_filters(ppd_file_t *ppd)      /* I - PPD file */
+ppd_free_filters(ppd_file_t *ppd)      // I - PPD file
 {
-  int  i;                              /* Looping var */
-  char **filter;                       /* Current filter */
+  int  i;                              // Looping var
+  char **filter;                       // Current filter
 
 
   if (ppd->num_filters > 0)
@@ -2556,16 +2591,16 @@ ppd_free_filters(ppd_file_t *ppd)       /* I - PPD file */
 }
 
 
-/*
- * 'ppd_free_group()' - Free a single UI group.
- */
+//
+// 'ppd_free_group()' - Free a single UI group.
+//
 
 static void
-ppd_free_group(ppd_group_t *group)     /* I - Group to free */
+ppd_free_group(ppd_group_t *group)     // I - Group to free
 {
-  int          i;                      /* Looping var */
-  ppd_option_t *option;                /* Current option */
-  ppd_group_t  *subgroup;              /* Current sub-group */
+  int          i;                      // Looping var
+  ppd_option_t *option;                // Current option
+  ppd_group_t  *subgroup;              // Current sub-group
 
 
   if (group->num_options > 0)
@@ -2590,15 +2625,15 @@ ppd_free_group(ppd_group_t *group)      /* I - Group to free */
 }
 
 
-/*
- * 'ppd_free_option()' - Free a single option.
- */
+//
+// 'ppd_free_option()' - Free a single option.
+//
 
 static void
-ppd_free_option(ppd_option_t *option)  /* I - Option to free */
+ppd_free_option(ppd_option_t *option)  // I - Option to free
 {
-  int          i;                      /* Looping var */
-  ppd_choice_t *choice;                /* Current choice */
+  int          i;                      // Looping var
+  ppd_choice_t *choice;                // Current choice
 
 
   if (option->num_choices > 0)
@@ -2615,27 +2650,27 @@ ppd_free_option(ppd_option_t *option)   /* I - Option to free */
 }
 
 
-/*
- * 'ppd_get_coption()' - Get a custom option record.
- */
+//
+// 'ppd_get_coption()' - Get a custom option record.
+//
 
-static ppd_coption_t   *               /* O - Custom option... */
-ppd_get_coption(ppd_file_t *ppd,       /* I - PPD file */
-                const char *name)      /* I - Name of option */
+static ppd_coption_t   *               // O - Custom option...
+ppd_get_coption(ppd_file_t *ppd,       // I - PPD file
+                const char *name)      // I - Name of option
 {
-  ppd_coption_t        *copt;                  /* New custom option */
+  ppd_coption_t        *copt;                  // New custom option
 
 
- /*
-  * See if the option already exists...
-  */
+  //
+  // See if the option already exists...
+  //
 
   if ((copt = ppdFindCustomOption(ppd, name)) != NULL)
     return (copt);
 
- /*
-  * Not found, so create the custom option record...
-  */
+  //
+  // Not found, so create the custom option record...
+  //
 
   if ((copt = calloc(1, sizeof(ppd_coption_t))) == NULL)
     return (NULL);
@@ -2646,36 +2681,36 @@ ppd_get_coption(ppd_file_t *ppd,        /* I - PPD file */
 
   cupsArrayAdd(ppd->coptions, copt);
 
- /*
-  * Return the new record...
-  */
+  //
+  // Return the new record...
+  //
 
   return (copt);
 }
 
 
-/*
- * 'ppd_get_cparam()' - Get a custom parameter record.
- */
+//
+// 'ppd_get_cparam()' - Get a custom parameter record.
+//
 
-static ppd_cparam_t *                  /* O - Extended option... */
-ppd_get_cparam(ppd_coption_t *opt,     /* I - PPD file */
-               const char    *param,   /* I - Name of parameter */
-              const char    *text)     /* I - Human-readable text */
+static ppd_cparam_t *                  // O - Extended option...
+ppd_get_cparam(ppd_coption_t *opt,     // I - PPD file
+               const char    *param,   // I - Name of parameter
+              const char    *text)     // I - Human-readable text
 {
-  ppd_cparam_t *cparam;                /* New custom parameter */
+  ppd_cparam_t *cparam;                // New custom parameter
 
 
- /*
-  * See if the parameter already exists...
-  */
+  //
+  // See if the parameter already exists...
+  //
 
   if ((cparam = ppdFindCustomParam(opt, param)) != NULL)
     return (cparam);
 
- /*
-  * Not found, so create the custom parameter record...
-  */
+  //
+  // Not found, so create the custom parameter record...
+  //
 
   if ((cparam = calloc(1, sizeof(ppd_cparam_t))) == NULL)
     return (NULL);
@@ -2684,33 +2719,33 @@ ppd_get_cparam(ppd_coption_t *opt,      /* I - PPD file */
   strlcpy(cparam->name, param, sizeof(cparam->name));
   strlcpy(cparam->text, text[0] ? text : param, sizeof(cparam->text));
 
- /*
-  * Add this record to the array...
-  */
+  //
+  // Add this record to the array...
+  //
 
   cupsArrayAdd(opt->params, cparam);
 
- /*
-  * Return the new record...
-  */
+  //
+  // Return the new record...
+  //
 
   return (cparam);
 }
 
 
-/*
- * 'ppd_get_group()' - Find or create the named group as needed.
- */
+//
+// 'ppd_get_group()' - Find or create the named group as needed.
+//
 
-static ppd_group_t *                   /* O - Named group */
-ppd_get_group(ppd_file_t      *ppd,    /* I - PPD file */
-              const char      *name,   /* I - Name of group */
-             const char      *text,    /* I - Text for group */
-              ppd_globals_t  *pg,      /* I - Global data */
-             cups_encoding_t encoding) /* I - Encoding of text */
+static ppd_group_t *                   // O - Named group
+ppd_get_group(ppd_file_t      *ppd,    // I - PPD file
+              const char      *name,   // I - Name of group
+             const char      *text,    // I - Text for group
+              ppd_globals_t   *pg,     // I - Global data
+             cups_encoding_t encoding) // I - Encoding of text
 {
-  int          i;                      /* Looping var */
-  ppd_group_t  *group;                 /* Group */
+  int          i;                      // Looping var
+  ppd_group_t  *group;                 // Group
 
 
   DEBUG_printf(("7ppd_get_group(ppd=%p, name=\"%s\", text=\"%s\", cg=%p)",
@@ -2724,7 +2759,8 @@ ppd_get_group(ppd_file_t      *ppd,       /* I - PPD file */
   {
     DEBUG_printf(("8ppd_get_group: Adding group %s...", name));
 
-    if (pg->ppd_conform == PPD_CONFORM_STRICT && strlen(text) >= sizeof(group->text))
+    if (pg->ppd_conform == PPD_CONFORM_STRICT &&
+       strlen(text) >= sizeof(group->text))
     {
       pg->ppd_status = PPD_ILLEGAL_TRANSLATION;
 
@@ -2734,7 +2770,8 @@ ppd_get_group(ppd_file_t      *ppd,       /* I - PPD file */
     if (ppd->num_groups == 0)
       group = malloc(sizeof(ppd_group_t));
     else
-      group = realloc(ppd->groups, (size_t)(ppd->num_groups + 1) * sizeof(ppd_group_t));
+      group = realloc(ppd->groups, (size_t)(ppd->num_groups + 1) *
+                     sizeof(ppd_group_t));
 
     if (group == NULL)
     {
@@ -2758,16 +2795,16 @@ ppd_get_group(ppd_file_t      *ppd,     /* I - PPD file */
 }
 
 
-/*
- * 'ppd_get_option()' - Find or create the named option as needed.
- */
+//
+// 'ppd_get_option()' - Find or create the named option as needed.
+//
 
-static ppd_option_t *                  /* O - Named option */
-ppd_get_option(ppd_group_t *group,     /* I - Group */
-               const char  *name)      /* I - Name of option */
+static ppd_option_t *                  // O - Named option
+ppd_get_option(ppd_group_t *group,     // I - Group
+               const char  *name)      // I - Name of option
 {
-  int          i;                      /* Looping var */
-  ppd_option_t *option;                /* Option */
+  int          i;                      // Looping var
+  ppd_option_t *option;                // Option
 
 
   DEBUG_printf(("7ppd_get_option(group=%p(\"%s\"), name=\"%s\")",
@@ -2782,7 +2819,8 @@ ppd_get_option(ppd_group_t *group,        /* I - Group */
     if (group->num_options == 0)
       option = malloc(sizeof(ppd_option_t));
     else
-      option = realloc(group->options, (size_t)(group->num_options + 1) * sizeof(ppd_option_t));
+      option = realloc(group->options, (size_t)(group->num_options + 1) *
+                      sizeof(ppd_option_t));
 
     if (option == NULL)
       return (NULL);
@@ -2799,56 +2837,56 @@ ppd_get_option(ppd_group_t *group,      /* I - Group */
 }
 
 
-/*
- * 'ppd_globals_alloc()' - Allocate and initialize global data.
- */
+//
+// 'ppd_globals_alloc()' - Allocate and initialize global data.
+//
 
-static ppd_globals_t *         /* O - Pointer to global data */
+static ppd_globals_t *         // O - Pointer to global data
 ppd_globals_alloc(void)
 {
   return ((ppd_globals_t *)calloc(1, sizeof(ppd_globals_t)));
 }
 
 
-/*
- * 'ppd_globals_free()' - Free global data.
- */
+//
+// 'ppd_globals_free()' - Free global data.
+//
 
 #if defined(HAVE_PTHREAD_H) || defined(_WIN32)
 static void
-ppd_globals_free(ppd_globals_t *pg)    /* I - Pointer to global data */
+ppd_globals_free(ppd_globals_t *pg)    // I - Pointer to global data
 {
   free(pg);
 }
-#endif /* HAVE_PTHREAD_H || _WIN32 */
+#endif // HAVE_PTHREAD_H || _WIN32
 
 
 #ifdef HAVE_PTHREAD_H
-/*
- * 'ppd_globals_init()' - Initialize per-thread globals...
- */
+//
+// 'ppd_globals_init()' - Initialize per-thread globals...
+//
 
 static void
 ppd_globals_init(void)
 {
- /*
-  * Register the global data for this thread...
-  */
+  //
+  // Register the global data for this thread...
+  //
 
   pthread_key_create(&ppd_globals_key, (void (*)(void *))ppd_globals_free);
 }
-#endif /* HAVE_PTHREAD_H */
+#endif // HAVE_PTHREAD_H
 
 
-/*
- * 'ppd_hash_option()' - Generate a hash of the option name...
- */
+//
+// 'ppd_hash_option()' - Generate a hash of the option name...
+//
 
-static int                             /* O - Hash index */
-ppd_hash_option(ppd_option_t *option)  /* I - Option */
+static int                             // O - Hash index
+ppd_hash_option(ppd_option_t *option)  // I - Option
 {
-  int          hash = 0;               /* Hash index */
-  const char   *k;                     /* Pointer into keyword */
+  int          hash = 0;               // Hash index
+  const char   *k;                     // Pointer into keyword
 
 
   for (hash = option->keyword[0], k = option->keyword + 1; *k;)
@@ -2858,38 +2896,38 @@ ppd_hash_option(ppd_option_t *option)   /* I - Option */
 }
 
 
-/*
- * 'ppd_read()' - Read a line from a PPD file, skipping comment lines as
- *                necessary.
- */
-
-static int                             /* O - Bitmask of fields read */
-ppd_read(cups_file_t    *fp,           /* I - File to read from */
-         _ppd_line_t    *line,         /* I - Line buffer */
-         char           *keyword,      /* O - Keyword from line */
-        char           *option,        /* O - Option from line */
-         char           *text,         /* O - Human-readable text from line */
-        char           **string,       /* O - Code/string data */
-         int            ignoreblank,   /* I - Ignore blank lines? */
-        ppd_globals_t *pg)             /* I - Global data */
+//
+// 'ppd_read()' - Read a line from a PPD file, skipping comment lines as
+//                necessary.
+//
+
+static int                             // O - Bitmask of fields read
+ppd_read(cups_file_t    *fp,           // I - File to read from
+         _ppd_line_t    *line,         // I - Line buffer
+         char           *keyword,      // O - Keyword from line
+        char           *option,        // O - Option from line
+         char           *text,         // O - Human-readable text from line
+        char           **string,       // O - Code/string data
+         int            ignoreblank,   // I - Ignore blank lines?
+        ppd_globals_t *pg)             // I - Global data
 {
-  int          ch,                     /* Character from file */
-               col,                    /* Column in line */
-               colon,                  /* Colon seen? */
-               endquote,               /* Waiting for an end quote */
-               mask,                   /* Mask to be returned */
-               startline,              /* Start line */
-               textlen;                /* Length of text */
-  char         *keyptr,                /* Keyword pointer */
-               *optptr,                /* Option pointer */
-               *textptr,               /* Text pointer */
-               *strptr,                /* Pointer into string */
-               *lineptr;               /* Current position in line buffer */
-
-
- /*
-  * Now loop until we have a valid line...
-  */
+  int          ch,                     // Character from file
+               col,                    // Column in line
+               colon,                  // Colon seen?
+               endquote,               // Waiting for an end quote
+               mask,                   // Mask to be returned
+               startline,              // Start line
+               textlen;                // Length of text
+  char         *keyptr,                // Keyword pointer
+               *optptr,                // Option pointer
+               *textptr,               // Text pointer
+               *strptr,                // Pointer into string
+               *lineptr;               // Current position in line buffer
+
+
+  //
+  // Now loop until we have a valid line...
+  //
 
   *string   = NULL;
   col       = 0;
@@ -2906,9 +2944,9 @@ ppd_read(cups_file_t    *fp,              /* I - File to read from */
 
   do
   {
-   /*
-    * Read the line...
-    */
+    //
+    // Read the line...
+    //
 
     lineptr  = line->buffer;
     endquote = 0;
@@ -2918,19 +2956,19 @@ ppd_read(cups_file_t    *fp,            /* I - File to read from */
     {
       if (lineptr >= (line->buffer + line->bufsize - 1))
       {
-       /*
-        * Expand the line buffer...
-       */
+       //
+        // Expand the line buffer...
+       //
 
-        char *temp;                    /* Temporary line pointer */
+        char *temp;                    // Temporary line pointer
 
 
         line->bufsize += 1024;
        if (line->bufsize > 262144)
        {
-        /*
-         * Don't allow lines longer than 256k!
-         */
+         //
+         // Don't allow lines longer than 256k!
+         //
 
           pg->ppd_line   = startline;
           pg->ppd_status = PPD_LINE_TOO_LONG;
@@ -2953,18 +2991,18 @@ ppd_read(cups_file_t    *fp,            /* I - File to read from */
 
       if (ch == '\r' || ch == '\n')
       {
-       /*
-       * Line feed or carriage return...
-       */
+       //
+       // Line feed or carriage return...
+       //
 
         pg->ppd_line ++;
        col = 0;
 
        if (ch == '\r')
        {
-        /*
-          * Check for a trailing line feed...
-         */
+         //
+          // Check for a trailing line feed...
+         //
 
          if ((ch = cupsFilePeekChar(fp)) == EOF)
          {
@@ -2977,20 +3015,20 @@ ppd_read(cups_file_t    *fp,            /* I - File to read from */
        }
 
        if (lineptr == line->buffer && ignoreblank)
-          continue;                    /* Skip blank lines */
+          continue;                    // Skip blank lines
 
        ch = '\n';
 
-       if (!endquote)                  /* Continue for multi-line text */
+       if (!endquote)                  // Continue for multi-line text
           break;
 
        *lineptr++ = '\n';
       }
       else if (ch < ' ' && ch != '\t' && pg->ppd_conform == PPD_CONFORM_STRICT)
       {
-       /*
-        * Other control characters...
-       */
+       //
+       // Other control characters...
+       //
 
         pg->ppd_line   = startline;
         pg->ppd_status = PPD_ILLEGAL_CHARACTER;
@@ -2999,18 +3037,18 @@ ppd_read(cups_file_t    *fp,            /* I - File to read from */
       }
       else if (ch != 0x1a)
       {
-       /*
-       * Any other character...
-       */
+       //
+       // Any other character...
+       //
 
        *lineptr++ = (char)ch;
        col ++;
 
        if (col > (PPD_MAX_LINE - 1))
        {
-        /*
-          * Line is too long...
-         */
+         //
+          // Line is too long...
+         //
 
           pg->ppd_line   = startline;
           pg->ppd_status = PPD_LINE_TOO_LONG;
@@ -3028,9 +3066,9 @@ ppd_read(cups_file_t    *fp,              /* I - File to read from */
 
     if (endquote)
     {
-     /*
-      * Didn't finish this quoted string...
-      */
+      //
+      // Didn't finish this quoted string...
+      //
 
       while ((ch = cupsFileGetChar(fp)) != EOF)
         if (ch == '\"')
@@ -3042,9 +3080,9 @@ ppd_read(cups_file_t    *fp,              /* I - File to read from */
 
          if (ch == '\r')
          {
-          /*
-            * Check for a trailing line feed...
-           */
+           //
+            // Check for a trailing line feed...
+           //
 
            if ((ch = cupsFilePeekChar(fp)) == EOF)
              break;
@@ -3052,11 +3090,12 @@ ppd_read(cups_file_t    *fp,            /* I - File to read from */
              cupsFileGetChar(fp);
          }
        }
-       else if (ch < ' ' && ch != '\t' && pg->ppd_conform == PPD_CONFORM_STRICT)
+       else if (ch < ' ' && ch != '\t' &&
+                pg->ppd_conform == PPD_CONFORM_STRICT)
        {
-        /*
-          * Other control characters...
-         */
+         //
+          // Other control characters...
+         //
 
           pg->ppd_line   = startline;
           pg->ppd_status = PPD_ILLEGAL_CHARACTER;
@@ -3069,9 +3108,9 @@ ppd_read(cups_file_t    *fp,              /* I - File to read from */
 
          if (col > (PPD_MAX_LINE - 1))
          {
-          /*
-            * Line is too long...
-           */
+           //
+            // Line is too long...
+           //
 
             pg->ppd_line   = startline;
             pg->ppd_status = PPD_LINE_TOO_LONG;
@@ -3083,25 +3122,25 @@ ppd_read(cups_file_t    *fp,            /* I - File to read from */
 
     if (ch != '\n')
     {
-     /*
-      * Didn't finish this line...
-      */
+      //
+      // Didn't finish this line...
+      //
 
       while ((ch = cupsFileGetChar(fp)) != EOF)
        if (ch == '\r' || ch == '\n')
        {
-        /*
-         * Line feed or carriage return...
-         */
+         //
+         // Line feed or carriage return...
+         //
 
           pg->ppd_line ++;
          col = 0;
 
          if (ch == '\r')
          {
-          /*
-            * Check for a trailing line feed...
-           */
+           //
+            // Check for a trailing line feed...
+           //
 
            if ((ch = cupsFilePeekChar(fp)) == EOF)
              break;
@@ -3111,11 +3150,12 @@ ppd_read(cups_file_t    *fp,            /* I - File to read from */
 
          break;
        }
-       else if (ch < ' ' && ch != '\t' && pg->ppd_conform == PPD_CONFORM_STRICT)
+       else if (ch < ' ' && ch != '\t' &&
+                pg->ppd_conform == PPD_CONFORM_STRICT)
        {
-        /*
-          * Other control characters...
-         */
+         //
+          // Other control characters...
+         //
 
           pg->ppd_line   = startline;
           pg->ppd_status = PPD_ILLEGAL_CHARACTER;
@@ -3128,9 +3168,9 @@ ppd_read(cups_file_t    *fp,              /* I - File to read from */
 
          if (col > (PPD_MAX_LINE - 1))
          {
-          /*
-            * Line is too long...
-           */
+           //
+            // Line is too long...
+           //
 
             pg->ppd_line   = startline;
             pg->ppd_status = PPD_LINE_TOO_LONG;
@@ -3147,12 +3187,12 @@ ppd_read(cups_file_t    *fp,            /* I - File to read from */
 
     DEBUG_printf(("9ppd_read: LINE=\"%s\"", line->buffer));
 
-   /*
-    * The dynamically created PPDs for older style macOS
-    * drivers include a large blob of data inserted as comments
-    * at the end of the file.  As an optimization we can stop
-    * reading the PPD when we get to the start of this data.
-    */
+    //
+    // The dynamically created PPDs for older style macOS
+    // drivers include a large blob of data inserted as comments
+    // at the end of the file.  As an optimization we can stop
+    // reading the PPD when we get to the start of this data.
+    //
 
     if (!strcmp(line->buffer, "*%APLWORKSET START"))
       return (0);
@@ -3160,9 +3200,9 @@ ppd_read(cups_file_t    *fp,              /* I - File to read from */
     if (ch == EOF && lineptr == line->buffer)
       return (0);
 
-   /*
-    * Now parse it...
-    */
+    //
+    // Now parse it...
+    //
 
     mask    = 0;
     lineptr = line->buffer + 1;
@@ -3172,16 +3212,16 @@ ppd_read(cups_file_t    *fp,            /* I - File to read from */
     text[0]    = '\0';
     *string    = NULL;
 
-    if ((!line->buffer[0] ||           /* Blank line */
-         !strncmp(line->buffer, "*%", 2) || /* Comment line */
-         !strcmp(line->buffer, "*End")) && /* End of multi-line string */
-        ignoreblank)                   /* Ignore these? */
+    if ((!line->buffer[0] ||               // Blank line
+         !strncmp(line->buffer, "*%", 2) || // Comment line
+         !strcmp(line->buffer, "*End")) &&  // End of multi-line string
+        ignoreblank)                       // Ignore these?
     {
       startline = pg->ppd_line + 1;
       continue;
     }
 
-    if (!strcmp(line->buffer, "*"))    /* (Bad) comment line */
+    if (!strcmp(line->buffer, "*"))    // (Bad) comment line
     {
       if (pg->ppd_conform == PPD_CONFORM_RELAXED)
       {
@@ -3197,11 +3237,11 @@ ppd_read(cups_file_t    *fp,            /* I - File to read from */
       }
     }
 
-    if (line->buffer[0] != '*')                /* All lines start with an asterisk */
+    if (line->buffer[0] != '*')                // All lines start with an asterisk
     {
-     /*
-      * Allow lines consisting of just whitespace...
-      */
+      //
+      // Allow lines consisting of just whitespace...
+      //
 
       for (lineptr = line->buffer; *lineptr; lineptr ++)
         if (*lineptr && !_ppd_isspace(*lineptr))
@@ -3218,9 +3258,9 @@ ppd_read(cups_file_t    *fp,              /* I - File to read from */
         return (0);
     }
 
-   /*
-    * Get a keyword...
-    */
+    //
+    // Get a keyword...
+    //
 
     keyptr = keyword;
 
@@ -3245,9 +3285,9 @@ ppd_read(cups_file_t    *fp,              /* I - File to read from */
 
     if (_ppd_isspace(*lineptr))
     {
-     /*
-      * Get an option name...
-      */
+      //
+      // Get an option name...
+      //
 
       while (_ppd_isspace(*lineptr))
         lineptr ++;
@@ -3282,9 +3322,9 @@ ppd_read(cups_file_t    *fp,              /* I - File to read from */
 
       if (*lineptr == '/')
       {
-       /*
-        * Get human-readable text...
-       */
+       //
+        // Get human-readable text...
+       //
 
         lineptr ++;
 
@@ -3326,9 +3366,9 @@ ppd_read(cups_file_t    *fp,              /* I - File to read from */
 
     if (*lineptr == ':')
     {
-     /*
-      * Get string after triming leading and trailing whitespace...
-      */
+      //
+      // Get string after triming leading and trailing whitespace...
+      //
 
       lineptr ++;
       while (_ppd_isspace(*lineptr))
@@ -3340,9 +3380,9 @@ ppd_read(cups_file_t    *fp,              /* I - File to read from */
 
       if (*strptr == '\"')
       {
-       /*
-        * Quoted string by itself, remove quotes...
-       */
+       //
+        // Quoted string by itself, remove quotes...
+       //
 
         *strptr = '\0';
        lineptr ++;
@@ -3359,36 +3399,36 @@ ppd_read(cups_file_t    *fp,            /* I - File to read from */
 }
 
 
-/*
- * 'ppd_update_filters()' - Update the filters array as needed.
- *
- * This function re-populates the filters array with cupsFilter2 entries that
- * have been stripped of the destination MIME media types and any maxsize hints.
- *
- * (All for backwards-compatibility)
- */
+//
+// 'ppd_update_filters()' - Update the filters array as needed.
+//
+// This function re-populates the filters array with cupsFilter2 entries that
+// have been stripped of the destination MIME media types and any maxsize hints.
+//
+// (All for backwards-compatibility)
+//
 
-static int                             /* O - 1 on success, 0 on failure */
-ppd_update_filters(ppd_file_t     *ppd,        /* I - PPD file */
-                   ppd_globals_t *pg)  /* I - Global data */
+static int                             // O - 1 on success, 0 on failure
+ppd_update_filters(ppd_file_t    *ppd, // I - PPD file
+                   ppd_globals_t *pg)  // I - Global data
 {
-  ppd_attr_t   *attr;                  /* Current cupsFilter2 value */
-  char         srcsuper[16],           /* Source MIME media type */
+  ppd_attr_t   *attr;                  // Current cupsFilter2 value
+  char         srcsuper[16],           // Source MIME media type
                srctype[256],
-               dstsuper[16],           /* Destination MIME media type */
+               dstsuper[16],           // Destination MIME media type
                dsttype[256],
-               *ptr,                   /* Pointer into command to run */
-               buffer[2048],           /* Re-written cupsFilter value */
-               **filter;               /* Current filter */
-  int          cost;                   /* Cost of filter */
-  char         program[1024] = { 0 };  /* Command to run */
+               *ptr,                   // Pointer into command to run
+               buffer[2048],           // Re-written cupsFilter value
+               **filter;               // Current filter
+  int          cost;                   // Cost of filter
+  char         program[1024] = { 0 };  // Command to run
 
 
   DEBUG_printf(("4ppd_update_filters(ppd=%p, cg=%p)", ppd, pg));
 
- /*
-  * See if we have any cupsFilter2 lines...
-  */
+  //
+  // See if we have any cupsFilter2 lines...
+  //
 
   if ((attr = ppdFindAttr(ppd, "cupsFilter2", NULL)) == NULL)
   {
@@ -3396,20 +3436,20 @@ ppd_update_filters(ppd_file_t     *ppd, /* I - PPD file */
     return (1);
   }
 
- /*
-  * Yes, free the cupsFilter-defined filters and re-build...
-  */
+  //
+  // Yes, free the cupsFilter-defined filters and re-build...
+  //
 
   ppd_free_filters(ppd);
 
   do
   {
-   /*
-    * Parse the cupsFilter2 string:
-    *
-    *   src/type dst/type cost program
-    *   src/type dst/type cost maxsize(n) program
-    */
+    //
+    // Parse the cupsFilter2 string:
+    //
+    //   src/type dst/type cost program
+    //   src/type dst/type cost maxsize(n) program
+    //
 
     DEBUG_printf(("5ppd_update_filters: cupsFilter2=\"%s\"", attr->value));
 
@@ -3439,19 +3479,19 @@ ppd_update_filters(ppd_file_t     *ppd, /* I - PPD file */
       DEBUG_printf(("5ppd_update_filters: New program=\"%s\"", program));
     }
 
-   /*
-    * Convert to cupsFilter format:
-    *
-    *   src/type cost program
-    */
+    //
+    // Convert to cupsFilter format:
+    //
+    //   src/type cost program
+    //
 
     snprintf(buffer, sizeof(buffer), "%s/%s %d %s", srcsuper, srctype, cost,
              program);
     DEBUG_printf(("5ppd_update_filters: Adding \"%s\".", buffer));
 
-   /*
-    * Add a cupsFilter-compatible string to the filters array.
-    */
+    //
+    // Add a cupsFilter-compatible string to the filters array.
+    //
 
     if (ppd->num_filters == 0)
       filter = malloc(sizeof(char *));
index e434b50cae3ffd89ae376a6013fc542b7d5a5ef7..a7a92d11f6d8728594c6c7e5c20fc803aa0b59e3 100644 (file)
--- a/ppd/ppd.h
+++ b/ppd/ppd.h
-/*
- * PostScript Printer Description definitions for libppd.
- *
- * PPD FILES ARE DEPRECATED. libppd IS ONLY INTENDED FOR LEGACY IMPORT OF
- * CLASSIC CUPS DRIVERS AND POSTSCRIPT PRINTER PPD FILES.
- *
- * Copyright © 2007-2019 by Apple Inc.
- * Copyright © 1997-2007 by Easy Software Products, all rights reserved.
- *
- * Licensed under Apache License v2.0.  See the file "LICENSE" for more
- * information.
- *
- * PostScript is a trademark of Adobe Systems, Inc.
- */
+//
+// Main PPD file handling API definitions for libppd.
+//
+// PPD FILES ARE DEPRECATED. libppd IS ONLY INTENDED FOR LEGACY IMPORT OF
+// CLASSIC CUPS DRIVERS AND POSTSCRIPT PRINTER PPD FILES.
+//
+// Copyright © 2007-2019 by Apple Inc.
+// Copyright © 1997-2007 by Easy Software Products, all rights reserved.
+//
+// Licensed under Apache License v2.0.  See the file "LICENSE" for more
+// information.
+//
+// PostScript is a trademark of Adobe Systems, Inc.
+//
 
 #ifndef _PPD_PPD_H_
 #  define _PPD_PPD_H_
 
-/*
- * Include necessary headers...
- */
-
-/* We do not depend on libcupsfilters here, we only share the call scheme
-   for log functions, so that the same log functions can be used with all
-   libraries of the cups-filters project */
-#  include <cupsfilters/log.h>
+//
+// Include necessary headers...
+//
 
 #  include <stdio.h>
 #  include <stdbool.h>
 #  include <cups/raster.h>
+#  include <cupsfilters/log.h>
 #  include <cupsfilters/driver.h>
 
 
-/*
- * C++ magic...
- */
+//
+// C++ magic...
+//
 
 #  ifdef __cplusplus
 extern "C" {
-#  endif /* __cplusplus */
+#  endif // __cplusplus
+
+//
+// Constants...
+//
 
-/*
- * Constants...
- */
+#  define PPD_CACHE_VERSION    20      // Version number in cache file
 
-#  define PPD_CACHE_VERSION    20      /* Version number in cache file */
 
+//
+// PPD version...
+//
 
-/*
- * PPD version...
- */
+#  define PPD_VERSION  4.3             // Kept in sync with Adobe version
+                                       // number
 
-#  define PPD_VERSION  4.3             /* Kept in sync with Adobe version
-                                          number */
 
+//
+// PPD size limits (defined in Adobe spec)
+//
 
-/*
- * PPD size limits (defined in Adobe spec)
- */
+#  define PPD_MAX_NAME 41              // Maximum size of name + 1 for nul
+#  define PPD_MAX_TEXT 81              // Maximum size of text + 1 for nul
+#  define PPD_MAX_LINE 256             // Maximum size of line + 1 for nul
 
-#  define PPD_MAX_NAME 41              /* Maximum size of name + 1 for nul */
-#  define PPD_MAX_TEXT 81              /* Maximum size of text + 1 for nul */
-#  define PPD_MAX_LINE 256             /* Maximum size of line + 1 for nul */
 
+// **** New in cups-filters 2.0.0: Ovetaken from cups-driverd ****
 
-/**** New in cups-filters 2.0.0: Ovetaken from cups-driverd ****/
-/*
- * PPD collection entry data
- */
+//
+// PPD collection entry data
+//
 
-#  define PPD_SYNC     0x50504441      /* Sync word for ppds.dat (PPDA) */
-#  define PPD_MAX_LANG 32              /* Maximum languages */
-#  define PPD_MAX_PROD 32              /* Maximum products */
-#  define PPD_MAX_VERS 32              /* Maximum versions */
+#  define PPD_SYNC     0x50504441      // Sync word for ppds.dat (PPDA)
+#  define PPD_MAX_LANG 32              // Maximum languages
+#  define PPD_MAX_PROD 32              // Maximum products
+#  define PPD_MAX_VERS 32              // Maximum versions
 
-#  define PPD_TYPE_POSTSCRIPT  0       /* PostScript PPD */
-#  define PPD_TYPE_PDF         1       /* PDF PPD */
-#  define PPD_TYPE_RASTER      2       /* CUPS raster PPD */
-#  define PPD_TYPE_FAX         3       /* Facsimile/MFD PPD */
-#  define PPD_TYPE_UNKNOWN     4       /* Other/hybrid PPD */
-#  define PPD_TYPE_DRV         5       /* Driver info file */
-#  define PPD_TYPE_ARCHIVE     6       /* Archive file */
+#  define PPD_TYPE_POSTSCRIPT  0       // PostScript PPD
+#  define PPD_TYPE_PDF         1       // PDF PPD
+#  define PPD_TYPE_RASTER      2       // CUPS raster PPD
+#  define PPD_TYPE_FAX         3       // Facsimile/MFD PPD
+#  define PPD_TYPE_UNKNOWN     4       // Other/hybrid PPD
+#  define PPD_TYPE_DRV         5       // Driver info file
+#  define PPD_TYPE_ARCHIVE     6       // Archive file
 
 
-/*
- * Types and structures...
- */
+//
+// Types and structures...
+//
 
 typedef int (*cups_interpret_cb_t)(cups_page_header2_t *header, int preferred_bits);
-                                       /**** cupsRasterInterpretPPD callback
-                                             function
-                                        *
-                                        * This function is called by
-                                        * @link cupsRasterInterpretPPD@ to
-                                        * validate (and update, as needed)
-                                        * the page header attributes. The
-                                        * "preferred_bits" argument provides
-                                        * the value of the
-                                        * @code cupsPreferredBitsPerColor@
-                                        * key from the PostScript page device
-                                        * dictionary and is 0 if undefined.
-                                        ****/
-
-typedef enum ppd_ui_e                  /**** UI Types ****/
-{
-  PPD_UI_BOOLEAN,                      /* True or False option */
-  PPD_UI_PICKONE,                      /* Pick one from a list */
-  PPD_UI_PICKMANY                      /* Pick zero or more from a list */
+                                       /**** cupsRasterInterpretPPD callback
+                                       //      function ****
+                                       //
+                                       // This function is called by
+                                       // @link cupsRasterInterpretPPD@ to
+                                       // validate (and update, as needed)
+                                       // the page header attributes. The
+                                       // "preferred_bits" argument provides
+                                       // the value of the
+                                       // @code cupsPreferredBitsPerColor@
+                                       // key from the PostScript page device
+                                       // dictionary and is 0 if undefined.
+                                       //
+
+typedef enum ppd_ui_e                  // **** UI Types ****
+{
+  PPD_UI_BOOLEAN,                      // True or False option
+  PPD_UI_PICKONE,                      // Pick one from a list
+  PPD_UI_PICKMANY                      // Pick zero or more from a list
 } ppd_ui_t;
 
-typedef enum ppd_section_e             /**** Order dependency sections ****/
-{
-  PPD_ORDER_ANY,                       /* Option code can be anywhere in the
-                                          file */
-  PPD_ORDER_DOCUMENT,                  /* ... must be in the DocumentSetup
-                                          section */
-  PPD_ORDER_EXIT,                      /* ... must be sent prior to the
-                                          document */
-  PPD_ORDER_JCL,                       /* ... must be sent as a JCL command */
-  PPD_ORDER_PAGE,                      /* ... must be in the PageSetup
-                                          section */
-  PPD_ORDER_PROLOG                     /* ... must be in the Prolog section */
+typedef enum ppd_section_e             // *** Order dependency sections ****
+{
+  PPD_ORDER_ANY,                       // Option code can be anywhere in the
+                                       // file
+  PPD_ORDER_DOCUMENT,                  // ... must be in the DocumentSetup
+                                       //     section
+  PPD_ORDER_EXIT,                      // ... must be sent prior to the
+                                       //     document
+  PPD_ORDER_JCL,                       // ... must be sent as a JCL command
+  PPD_ORDER_PAGE,                      // ... must be in the PageSetup
+                                       //     section
+  PPD_ORDER_PROLOG                     // ... must be in the Prolog section
 } ppd_section_t;
 
-typedef enum ppd_cs_e                  /**** Colorspaces ****/
+typedef enum ppd_cs_e                  // **** Colorspaces ****
 {
-  PPD_CS_CMYK = -4,                    /* CMYK colorspace */
-  PPD_CS_CMY,                          /* CMY colorspace */
-  PPD_CS_GRAY = 1,                     /* Grayscale colorspace */
-  PPD_CS_RGB = 3,                      /* RGB colorspace */
-  PPD_CS_RGBK,                         /* RGBK (K = gray) colorspace */
-  PPD_CS_N                             /* DeviceN colorspace */
+  PPD_CS_CMYK = -4,                    // CMYK colorspace
+  PPD_CS_CMY,                          // CMY colorspace
+  PPD_CS_GRAY = 1,                     // Grayscale colorspace
+  PPD_CS_RGB = 3,                      // RGB colorspace
+  PPD_CS_RGBK,                         // RGBK (K = gray) colorspace
+  PPD_CS_N                             // DeviceN colorspace
 } ppd_cs_t;
 
-typedef enum ppd_status_e              /**** Status Codes ****/
-{
-  PPD_OK = 0,                          /* OK */
-  PPD_FILE_OPEN_ERROR,                 /* Unable to open PPD file */
-  PPD_NULL_FILE,                       /* NULL PPD file pointer */
-  PPD_ALLOC_ERROR,                     /* Memory allocation error */
-  PPD_MISSING_PPDADOBE4,               /* Missing PPD-Adobe-4.x header */
-  PPD_MISSING_VALUE,                   /* Missing value string */
-  PPD_INTERNAL_ERROR,                  /* Internal error */
-  PPD_BAD_OPEN_GROUP,                  /* Bad OpenGroup */
-  PPD_NESTED_OPEN_GROUP,               /* OpenGroup without a CloseGroup
-                                          first */
-  PPD_BAD_OPEN_UI,                     /* Bad OpenUI/JCLOpenUI */
-  PPD_NESTED_OPEN_UI,                  /* OpenUI/JCLOpenUI without a
-                                          CloseUI/JCLCloseUI first */
-  PPD_BAD_ORDER_DEPENDENCY,            /* Bad OrderDependency */
-  PPD_BAD_UI_CONSTRAINTS,              /* Bad UIConstraints */
-  PPD_MISSING_ASTERISK,                        /* Missing asterisk in column 0 */
-  PPD_LINE_TOO_LONG,                   /* Line longer than 255 chars */
-  PPD_ILLEGAL_CHARACTER,               /* Illegal control character */
-  PPD_ILLEGAL_MAIN_KEYWORD,            /* Illegal main keyword string */
-  PPD_ILLEGAL_OPTION_KEYWORD,          /* Illegal option keyword string */
-  PPD_ILLEGAL_TRANSLATION,             /* Illegal translation string */
-  PPD_ILLEGAL_WHITESPACE,              /* Illegal whitespace character */
-  PPD_BAD_CUSTOM_PARAM,                        /* Bad custom parameter */
-  PPD_MISSING_OPTION_KEYWORD,          /* Missing option keyword */
-  PPD_BAD_VALUE,                       /* Bad value string */
-  PPD_MISSING_CLOSE_GROUP,             /* Missing CloseGroup */
-  PPD_BAD_CLOSE_UI,                    /* Bad CloseUI/JCLCloseUI */
-  PPD_MISSING_CLOSE_UI,                        /* Missing CloseUI/JCLCloseUI */
-  PPD_MAX_STATUS                       /* @private@ */
+typedef enum ppd_status_e              // **** Status Codes ****
+{
+  PPD_OK = 0,                          // OK
+  PPD_FILE_OPEN_ERROR,                 // Unable to open PPD file
+  PPD_NULL_FILE,                       // NULL PPD file pointer
+  PPD_ALLOC_ERROR,                     // Memory allocation error
+  PPD_MISSING_PPDADOBE4,               // Missing PPD-Adobe-4.x header
+  PPD_MISSING_VALUE,                   // Missing value string
+  PPD_INTERNAL_ERROR,                  // Internal error
+  PPD_BAD_OPEN_GROUP,                  // Bad OpenGroup
+  PPD_NESTED_OPEN_GROUP,               // OpenGroup without a CloseGroup
+                                       // first
+  PPD_BAD_OPEN_UI,                     // Bad OpenUI/JCLOpenUI
+  PPD_NESTED_OPEN_UI,                  // OpenUI/JCLOpenUI without a
+                                       // CloseUI/JCLCloseUI first
+  PPD_BAD_ORDER_DEPENDENCY,            // Bad OrderDependency
+  PPD_BAD_UI_CONSTRAINTS,              // Bad UIConstraints
+  PPD_MISSING_ASTERISK,                        // Missing asterisk in column 0
+  PPD_LINE_TOO_LONG,                   // Line longer than 255 chars
+  PPD_ILLEGAL_CHARACTER,               // Illegal control character
+  PPD_ILLEGAL_MAIN_KEYWORD,            // Illegal main keyword string
+  PPD_ILLEGAL_OPTION_KEYWORD,          // Illegal option keyword string
+  PPD_ILLEGAL_TRANSLATION,             // Illegal translation string
+  PPD_ILLEGAL_WHITESPACE,              // Illegal whitespace character
+  PPD_BAD_CUSTOM_PARAM,                        // Bad custom parameter
+  PPD_MISSING_OPTION_KEYWORD,          // Missing option keyword
+  PPD_BAD_VALUE,                       // Bad value string
+  PPD_MISSING_CLOSE_GROUP,             // Missing CloseGroup
+  PPD_BAD_CLOSE_UI,                    // Bad CloseUI/JCLCloseUI
+  PPD_MISSING_CLOSE_UI,                        // Missing CloseUI/JCLCloseUI
+  PPD_MAX_STATUS                       // @private@
 } ppd_status_t;
 
-enum ppd_conform_e                     /**** Conformance Levels ****/
+enum ppd_conform_e                     // **** Conformance Levels ****
 {
-  PPD_CONFORM_RELAXED,                 /* Relax whitespace and control char */
-  PPD_CONFORM_STRICT                   /* Require strict conformance */
+  PPD_CONFORM_RELAXED,                 // Relax whitespace and control char
+  PPD_CONFORM_STRICT                   // Require strict conformance
 };
 
 typedef enum ppd_conform_e ppd_conform_t;
-                                       /**** Conformance Levels ****/
+                                       // **** Conformance Levels ****
 
-typedef struct ppd_attr_s              /**** PPD Attribute Structure ****/
+typedef struct ppd_attr_s              // **** PPD Attribute Structure ****
 {
-  char         name[PPD_MAX_NAME];     /* Name of attribute (cupsXYZ) */
-  char         spec[PPD_MAX_NAME];     /* Specifier string, if any */
-  char         text[PPD_MAX_TEXT];     /* Human-readable text, if any */
-  char         *value;                 /* Value string */
+  char         name[PPD_MAX_NAME];     // Name of attribute (cupsXYZ)
+  char         spec[PPD_MAX_NAME];     // Specifier string, if any
+  char         text[PPD_MAX_TEXT];     // Human-readable text, if any
+  char         *value;                 // Value string
 } ppd_attr_t;
 
 typedef struct ppd_option_s ppd_option_t;
-                                       /**** Options ****/
+                                       // **** Options ****
 
-typedef struct ppd_choice_s            /**** Option choices ****/
+typedef struct ppd_choice_s            // **** Option choices ****
 {
-  char         marked;                 /* 0 if not selected, 1 otherwise */
-  char         choice[PPD_MAX_NAME];   /* Computer-readable option name */
-  char         text[PPD_MAX_TEXT];     /* Human-readable option name */
-  char         *code;                  /* Code to send for this option */
-  ppd_option_t *option;                /* Pointer to parent option structure */
+  char         marked;                 // 0 if not selected, 1 otherwise
+  char         choice[PPD_MAX_NAME];   // Computer-readable option name
+  char         text[PPD_MAX_TEXT];     // Human-readable option name
+  char         *code;                  // Code to send for this option
+  ppd_option_t *option;                // Pointer to parent option structure
 } ppd_choice_t;
 
-struct ppd_option_s                    /**** Options ****/
-{
-  char         conflicted;             /* 0 if no conflicts exist, 1
-                                          otherwise */
-  char         keyword[PPD_MAX_NAME];  /* Option keyword name ("PageSize",
-                                          etc.) */
-  char         defchoice[PPD_MAX_NAME];/* Default option choice */
-  char         text[PPD_MAX_TEXT];     /* Human-readable text */
-  ppd_ui_t     ui;                     /* Type of UI option */
-  ppd_section_t        section;                /* Section for command */
-  float                order;                  /* Order number */
-  int          num_choices;            /* Number of option choices */
-  ppd_choice_t *choices;               /* Option choices */
+struct ppd_option_s                    // **** Options ****
+{
+  char         conflicted;             // 0 if no conflicts exist, 1
+                                       // otherwise
+  char         keyword[PPD_MAX_NAME];  // Option keyword name ("PageSize",
+                                       // etc.)
+  char         defchoice[PPD_MAX_NAME];// Default option choice
+  char         text[PPD_MAX_TEXT];     // Human-readable text
+  ppd_ui_t     ui;                     // Type of UI option
+  ppd_section_t        section;                // Section for command
+  float                order;                  // Order number
+  int          num_choices;            // Number of option choices
+  ppd_choice_t *choices;               // Option choices
 };
 
-typedef struct ppd_group_s             /**** Groups ****/
+typedef struct ppd_group_s             // **** Groups ****
 {
-  /**** Group text strings are limited to 39 chars + nul in order to
-   **** preserve binary compatibility and allow applications to get
-   **** the group's keyword name.
-   ****/
+  /**** Group text strings are limited to 39 chars + nul in order to
+  // **** preserve binary compatibility and allow applications to get
+  // **** the group's keyword name.
+
   char         text[PPD_MAX_TEXT - PPD_MAX_NAME];
-                                       /* Human-readable group name */
-  char         name[PPD_MAX_NAME];     /* Group name @since CUPS 1.1.18/macOS
-                                          10.3@ */
-  int          num_options;            /* Number of options */
-  ppd_option_t *options;               /* Options */
-  int          num_subgroups;          /* Number of sub-groups */
-  struct ppd_group_s *subgroups;       /* Sub-groups (max depth = 1) */
+                                       // Human-readable group name
+  char         name[PPD_MAX_NAME];     // Group name @since CUPS 1.1.18/macOS
+                                       // 10.3@
+  int          num_options;            // Number of options
+  ppd_option_t *options;               // Options
+  int          num_subgroups;          // Number of sub-groups
+  struct ppd_group_s *subgroups;       // Sub-groups (max depth = 1)
 } ppd_group_t;
 
-typedef struct ppd_const_s             /**** Constraints ****/
+typedef struct ppd_const_s             // **** Constraints ****
 {
-  char         option1[PPD_MAX_NAME];  /* First keyword */
-  char         choice1[PPD_MAX_NAME];  /* First option/choice (blank for all) */
-  char         option2[PPD_MAX_NAME];  /* Second keyword */
-  char         choice2[PPD_MAX_NAME];  /* Second option/choice (blank for all) */
+  char         option1[PPD_MAX_NAME];  // First keyword
+  char         choice1[PPD_MAX_NAME];  // First option/choice (blank for all)
+  char         option2[PPD_MAX_NAME];  // Second keyword
+  char         choice2[PPD_MAX_NAME];  // Second option/choice (blank for all)
 } ppd_const_t;
 
-typedef struct ppd_size_s              /**** Page Sizes ****/
+typedef struct ppd_size_s              // **** Page Sizes ****
 {
-  int          marked;                 /* Page size selected? */
-  char         name[PPD_MAX_NAME];     /* Media size option */
-  float                width;                  /* Width of media in points */
-  float                length;                 /* Length of media in points */
-  float                left;                   /* Left printable margin in points */
-  float                bottom;                 /* Bottom printable margin in points */
-  float                right;                  /* Right printable margin in points */
-  float                top;                    /* Top printable margin in points */
+  int          marked;                 // Page size selected?
+  char         name[PPD_MAX_NAME];     // Media size option
+  float                width;                  // Width of media in points
+  float                length;                 // Length of media in points
+  float                left;                   // Left printable margin in points
+  float                bottom;                 // Bottom printable margin in points
+  float                right;                  // Right printable margin in points
+  float                top;                    // Top printable margin in points
 } ppd_size_t;
 
-typedef struct ppd_emul_s              /**** Emulators ****/
+typedef struct ppd_emul_s              // **** Emulators ****
 {
-  char         name[PPD_MAX_NAME];     /* Emulator name */
-  char         *start;                 /* Code to switch to this emulation */
-  char         *stop;                  /* Code to stop this emulation */
+  char         name[PPD_MAX_NAME];     // Emulator name
+  char         *start;                 // Code to switch to this emulation
+  char         *stop;                  // Code to stop this emulation
 } ppd_emul_t;
 
-typedef struct ppd_profile_s           /**** sRGB Color Profiles ****/
+typedef struct ppd_profile_s           // **** sRGB Color Profiles ****
 {
   char         resolution[PPD_MAX_NAME];
-                                       /* Resolution or "-" */
+                                       // Resolution or "-"
   char         media_type[PPD_MAX_NAME];
-                                       /* Media type or "-" */
-  float                density;                /* Ink density to use */
-  float                gamma;                  /* Gamma correction to use */
-  float                matrix[3][3];           /* Transform matrix */
+                                       // Media type or "-"
+  float                density;                // Ink density to use
+  float                gamma;                  // Gamma correction to use
+  float                matrix[3][3];           // Transform matrix
 } ppd_profile_t;
 
-/**** New in CUPS 1.2/macOS 10.5 ****/
-typedef enum ppd_cptype_e              /**** Custom Parameter Type ****/
-{
-  PPD_CUSTOM_UNKNOWN = -1,             /* Unknown type (error) */
-  PPD_CUSTOM_CURVE,                    /* Curve value for f(x) = x^value */
-  PPD_CUSTOM_INT,                      /* Integer number value */
-  PPD_CUSTOM_INVCURVE,                 /* Curve value for f(x) = x^(1/value) */
-  PPD_CUSTOM_PASSCODE,                 /* String of (hidden) numbers */
-  PPD_CUSTOM_PASSWORD,                 /* String of (hidden) characters */
-  PPD_CUSTOM_POINTS,                   /* Measurement value in points */
-  PPD_CUSTOM_REAL,                     /* Real number value */
-  PPD_CUSTOM_STRING                    /* String of characters */
+// **** New in CUPS 1.2/macOS 10.5 ****
+typedef enum ppd_cptype_e              // **** Custom Parameter Type ****
+{
+  PPD_CUSTOM_UNKNOWN = -1,             // Unknown type (error)
+  PPD_CUSTOM_CURVE,                    // Curve value for f(x) = x^value
+  PPD_CUSTOM_INT,                      // Integer number value
+  PPD_CUSTOM_INVCURVE,                 // Curve value for f(x) = x^(1/value)
+  PPD_CUSTOM_PASSCODE,                 // String of (hidden) numbers
+  PPD_CUSTOM_PASSWORD,                 // String of (hidden) characters
+  PPD_CUSTOM_POINTS,                   // Measurement value in points
+  PPD_CUSTOM_REAL,                     // Real number value
+  PPD_CUSTOM_STRING                    // String of characters
 } ppd_cptype_t;
 
-typedef union ppd_cplimit_u            /**** Custom Parameter Limit ****/
+typedef union ppd_cplimit_u            // **** Custom Parameter Limit ****
 {
-  float                custom_curve;           /* Gamma value */
-  int          custom_int;             /* Integer value */
-  float                custom_invcurve;        /* Gamma value */
-  int          custom_passcode;        /* Passcode length */
-  int          custom_password;        /* Password length */
-  float                custom_points;          /* Measurement value */
-  float                custom_real;            /* Real value */
-  int          custom_string;          /* String length */
+  float                custom_curve;           // Gamma value
+  int          custom_int;             // Integer value
+  float                custom_invcurve;        // Gamma value
+  int          custom_passcode;        // Passcode length
+  int          custom_password;        // Password length
+  float                custom_points;          // Measurement value
+  float                custom_real;            // Real value
+  int          custom_string;          // String length
 } ppd_cplimit_t;
 
-typedef union ppd_cpvalue_u            /**** Custom Parameter Value ****/
+typedef union ppd_cpvalue_u            // **** Custom Parameter Value ****
 {
-  float                custom_curve;           /* Gamma value */
-  int          custom_int;             /* Integer value */
-  float                custom_invcurve;        /* Gamma value */
-  char         *custom_passcode;       /* Passcode value */
-  char         *custom_password;       /* Password value */
-  float                custom_points;          /* Measurement value */
-  float                custom_real;            /* Real value */
-  char         *custom_string;         /* String value */
+  float                custom_curve;           // Gamma value
+  int          custom_int;             // Integer value
+  float                custom_invcurve;        // Gamma value
+  char         *custom_passcode;       // Passcode value
+  char         *custom_password;       // Password value
+  float                custom_points;          // Measurement value
+  float                custom_real;            // Real value
+  char         *custom_string;         // String value
 } ppd_cpvalue_t;
 
-typedef struct ppd_cparam_s            /**** Custom Parameter ****/
+typedef struct ppd_cparam_s            // **** Custom Parameter ****
 {
-  char         name[PPD_MAX_NAME];     /* Parameter name */
-  char         text[PPD_MAX_TEXT];     /* Human-readable text */
-  int          order;                  /* Order (0 to N) */
-  ppd_cptype_t type;                   /* Parameter type */
-  ppd_cplimit_t        minimum,                /* Minimum value */
-               maximum;                /* Maximum value */
-  ppd_cpvalue_t        current;                /* Current value */
+  char         name[PPD_MAX_NAME];     // Parameter name
+  char         text[PPD_MAX_TEXT];     // Human-readable text
+  int          order;                  // Order (0 to N)
+  ppd_cptype_t type;                   // Parameter type
+  ppd_cplimit_t        minimum,                // Minimum value
+               maximum;                // Maximum value
+  ppd_cpvalue_t        current;                // Current value
 } ppd_cparam_t;
 
-typedef struct ppd_coption_s           /**** Custom Option ****/
+typedef struct ppd_coption_s           // **** Custom Option ****
 {
-  char         keyword[PPD_MAX_NAME];  /* Name of option that is being
-                                          extended... */
-  ppd_option_t *option;                /* Option that is being extended... */
-  int          marked;                 /* Extended option is marked */
-  cups_array_t *params;                /* Parameters */
+  char         keyword[PPD_MAX_NAME];  // Name of option that is being
+                                       // extended...
+  ppd_option_t *option;                // Option that is being extended...
+  int          marked;                 // Extended option is marked
+  cups_array_t *params;                // Parameters
 } ppd_coption_t;
 
-typedef struct ppd_globals_s           /**** CUPS PPD global state data ****/
+typedef struct ppd_globals_s           // **** CUPS PPD global state data ****
 {
-  /* ppd.c */
-  ppd_status_t         ppd_status;     /* Status of last ppdOpen*() */
-  int                  ppd_line;       /* Current line number */
-  ppd_conform_t                ppd_conform;    /* Level of conformance required */
+  // ppd.c
+  ppd_status_t         ppd_status;     // Status of last ppdOpen*()
+  int                  ppd_line;       // Current line number
+  ppd_conform_t                ppd_conform;    // Level of conformance required
 
-  /* ppd-util.c */
+  // ppd-util.c
   char                 ppd_filename[HTTP_MAX_URI];
-                                       /* PPD filename */
+                                       // PPD filename
 } ppd_globals_t;
 
-typedef enum ppd_localization_e        /**** Selector for ppdOpenWithLocalization ****/
+typedef enum ppd_localization_e// **** Selector for ppdOpenWithLocalization ****
 {
-  PPD_LOCALIZATION_DEFAULT,            /* Load only the default localization */
-  PPD_LOCALIZATION_ICC_PROFILES,       /* Load only the color profile
-                                          localization */
-  PPD_LOCALIZATION_NONE,               /* Load no localizations */
-  PPD_LOCALIZATION_ALL                 /* Load all localizations */
+  PPD_LOCALIZATION_DEFAULT,            // Load only the default localization
+  PPD_LOCALIZATION_ICC_PROFILES,       // Load only the color profile
+                                       // localization
+  PPD_LOCALIZATION_NONE,               // Load no localizations
+  PPD_LOCALIZATION_ALL                 // Load all localizations
 } ppd_localization_t;
 
-typedef enum ppd_parse_e               /**** Selector for ppdParseOptions ****/
+typedef enum ppd_parse_e              // **** Selector for ppdParseOptions ****
 {
-  PPD_PARSE_OPTIONS,                   /* Parse only the options */
-  PPD_PARSE_PROPERTIES,                        /* Parse only the properties */
-  PPD_PARSE_ALL                                /* Parse everything */
+  PPD_PARSE_OPTIONS,                   // Parse only the options
+  PPD_PARSE_PROPERTIES,                        // Parse only the properties
+  PPD_PARSE_ALL                                // Parse everything
 } ppd_parse_t;
 
-typedef struct ppd_cups_uiconst_s      /**** Constraint from cupsUIConstraints ****/
+typedef struct ppd_cups_uiconst_s      // **** Constraint from
+                                       //      cupsUIConstraints ****
 {
-  ppd_option_t *option;                /* Constrained option */
-  ppd_choice_t *choice;                /* Constrained choice or @code NULL@ */
-  int          installable;            /* Installable option? */
+  ppd_option_t *option;                // Constrained option
+  ppd_choice_t *choice;                // Constrained choice or @code NULL@
+  int          installable;            // Installable option?
 } ppd_cups_uiconst_t;
 
-typedef struct ppd_cups_uiconsts_s     /**** cupsUIConstraints ****/
+typedef struct ppd_cups_uiconsts_s     // **** cupsUIConstraints ****
 {
-  char         resolver[PPD_MAX_NAME]; /* Resolver name */
-  int          installable,            /* Constrained against any installable
-                                          options? */
-               num_constraints;        /* Number of constraints */
-  ppd_cups_uiconst_t *constraints;     /* Constraints */
+  char         resolver[PPD_MAX_NAME]; // Resolver name
+  int          installable,            // Constrained against any installable
+                                       // options?
+               num_constraints;        // Number of constraints
+  ppd_cups_uiconst_t *constraints;     // Constraints
 } ppd_cups_uiconsts_t;
 
-typedef enum ppd_pwg_print_color_mode_e        /**** PWG print-color-mode indices ****/
+typedef enum ppd_pwg_print_color_mode_e// **** PWG print-color-mode indices ****
 {
-  PPD_PWG_PRINT_COLOR_MODE_MONOCHROME = 0,     /* print-color-mode=monochrome*/
-  PPD_PWG_PRINT_COLOR_MODE_COLOR,              /* print-color-mode=color */
-  /* Other values are not supported by CUPS yet. */
+  PPD_PWG_PRINT_COLOR_MODE_MONOCHROME = 0,     // print-color-mode=monochrome
+  PPD_PWG_PRINT_COLOR_MODE_COLOR,              // print-color-mode=color
+  // Other values are not supported by CUPS yet.
   PPD_PWG_PRINT_COLOR_MODE_MAX
 } ppd_pwg_print_color_mode_t;
 
-typedef enum ppd_pwg_print_quality_e   /**** PWG print-quality values ****/
+typedef enum ppd_pwg_print_quality_e   // **** PWG print-quality values ****
 {
-  PPD_PWG_PRINT_QUALITY_DRAFT = 0,     /* print-quality=3 */
-  PPD_PWG_PRINT_QUALITY_NORMAL,                /* print-quality=4 */
-  PPD_PWG_PRINT_QUALITY_HIGH,          /* print-quality=5 */
+  PPD_PWG_PRINT_QUALITY_DRAFT = 0,     // print-quality=3
+  PPD_PWG_PRINT_QUALITY_NORMAL,                // print-quality=4
+  PPD_PWG_PRINT_QUALITY_HIGH,          // print-quality=5
   PPD_PWG_PRINT_QUALITY_MAX
 } ppd_pwg_print_quality_t;
 
-typedef enum ppd_pwg_print_content_optimize_e /** PWG print-content-optimize **/
+typedef enum ppd_pwg_print_content_optimize_e // * PWG print-content-optimize *
 {
-  PPD_PWG_PRINT_CONTENT_OPTIMIZE_AUTO = 0, /* print-content-optimize=auto */
-  PPD_PWG_PRINT_CONTENT_OPTIMIZE_PHOTO,        /* print-content-optimize=photo */
-  PPD_PWG_PRINT_CONTENT_OPTIMIZE_GRAPHICS,/* print-content-optimize=graphics */
-  PPD_PWG_PRINT_CONTENT_OPTIMIZE_TEXT, /* print-content-optimize=text */
-  PPD_PWG_PRINT_CONTENT_OPTIMIZE_TEXT_AND_GRAPHICS, /* ...=text-and-graphics */
+  PPD_PWG_PRINT_CONTENT_OPTIMIZE_AUTO = 0, // print-content-optimize=auto
+  PPD_PWG_PRINT_CONTENT_OPTIMIZE_PHOTO,        // print-content-optimize=photo
+  PPD_PWG_PRINT_CONTENT_OPTIMIZE_GRAPHICS,// print-content-optimize=graphics
+  PPD_PWG_PRINT_CONTENT_OPTIMIZE_TEXT, // print-content-optimize=text
+  PPD_PWG_PRINT_CONTENT_OPTIMIZE_TEXT_AND_GRAPHICS, // ...=text-and-graphics
   PPD_PWG_PRINT_CONTENT_OPTIMIZE_MAX
 } ppd_pwg_print_content_optimize_t;
 
-typedef struct ppd_pwg_finishings_s    /**** PWG finishings mapping data ****/
+typedef struct ppd_pwg_finishings_s    // **** PWG finishings mapping data ****
 {
-  ipp_finishings_t     value;          /* finishings value */
-  int                  num_options;    /* Number of options to apply */
-  cups_option_t                *options;       /* Options to apply */
+  ipp_finishings_t     value;          // finishings value
+  int                  num_options;    // Number of options to apply
+  cups_option_t                *options;       // Options to apply
 } ppd_pwg_finishings_t;
 
-struct ppd_cache_s                /**** PPD cache and PWG conversion data ****/
-{
-  int          num_bins;               /* Number of output bins */
-  pwg_map_t    *bins;                  /* Output bins */
-  int          num_sizes;              /* Number of media sizes */
-  pwg_size_t   *sizes;                 /* Media sizes */
-  int          custom_max_width,       /* Maximum custom width in 2540ths */
-               custom_max_length,      /* Maximum custom length in 2540ths */
-               custom_min_width,       /* Minimum custom width in 2540ths */
-               custom_min_length;      /* Minimum custom length in 2540ths */
-  char         *custom_max_keyword,    /* Maximum custom size PWG keyword */
-               *custom_min_keyword,    /* Minimum custom size PWG keyword */
-               custom_ppd_size[41];    /* Custom PPD size name */
-  pwg_size_t   custom_size;            /* Custom size record */
-  char         *source_option;         /* PPD option for media source */
-  int          num_sources;            /* Number of media sources */
-  pwg_map_t    *sources;               /* Media sources */
-  int          num_types;              /* Number of media types */
-  pwg_map_t    *types;                 /* Media types */
+struct ppd_cache_s               // **** PPD cache and PWG conversion data ****
+{
+  int          num_bins;               // Number of output bins
+  pwg_map_t    *bins;                  // Output bins
+  int          num_sizes;              // Number of media sizes
+  pwg_size_t   *sizes;                 // Media sizes
+  int          custom_max_width,       // Maximum custom width in 2540ths
+               custom_max_length,      // Maximum custom length in 2540ths
+               custom_min_width,       // Minimum custom width in 2540ths
+               custom_min_length;      // Minimum custom length in 2540ths
+  char         *custom_max_keyword,    // Maximum custom size PWG keyword
+               *custom_min_keyword,    // Minimum custom size PWG keyword
+               custom_ppd_size[41];    // Custom PPD size name
+  pwg_size_t   custom_size;            // Custom size record
+  char         *source_option;         // PPD option for media source
+  int          num_sources;            // Number of media sources
+  pwg_map_t    *sources;               // Media sources
+  int          num_types;              // Number of media types
+  pwg_map_t    *types;                 // Media types
   int          num_presets[PPD_PWG_PRINT_COLOR_MODE_MAX][PPD_PWG_PRINT_QUALITY_MAX];
-                                       /* Number of print-color-mode/
-                                          print-quality options */
+                                       // Number of print-color-mode/
+                                       // print-quality options
   cups_option_t        *presets[PPD_PWG_PRINT_COLOR_MODE_MAX][PPD_PWG_PRINT_QUALITY_MAX];
-                                       /* print-color-mode/
-                                          print-quality options */
+                                       // print-color-mode/
+                                       // print-quality options
   int          num_optimize_presets[PPD_PWG_PRINT_CONTENT_OPTIMIZE_MAX];
-                                       /* Number of print-content-optimize
-                                          options */
+                                       // Number of print-content-optimize
+                                       // options
   cups_option_t        *optimize_presets[PPD_PWG_PRINT_CONTENT_OPTIMIZE_MAX];
-                                       /* print-content-optimize options */
-  char         *sides_option,          /* PPD option for sides */
-               *sides_1sided,          /* Choice for one-sided */
-               *sides_2sided_long,     /* Choice for two-sided-long-edge */
-               *sides_2sided_short;    /* Choice for two-sided-short-edge */
-  char         *product;               /* Product value */
-  cups_array_t *filters,               /* cupsFilter/cupsFilter2 values */
-               *prefilters;            /* cupsPreFilter values */
-  int          single_file;            /* cupsSingleFile value */
-  cups_array_t *finishings;            /* cupsIPPFinishings values */
-  cups_array_t *templates;             /* cupsFinishingTemplate values */
-  int          max_copies,             /* cupsMaxCopies value */
-               account_id,             /* cupsJobAccountId value */
-               accounting_user_id;     /* cupsJobAccountingUserId value */
-  char         *password;              /* cupsJobPassword value */
-  cups_array_t *mandatory;             /* cupsMandatory value */
-  char         *charge_info_uri;       /* cupsChargeInfoURI value */
-  cups_array_t *strings;               /* Localization strings */
-  cups_array_t *support_files;         /* Support files - ICC profiles, etc. */
+                                       // print-content-optimize options
+  char         *sides_option,          // PPD option for sides
+               *sides_1sided,          // Choice for one-sided
+               *sides_2sided_long,     // Choice for two-sided-long-edge
+               *sides_2sided_short;    // Choice for two-sided-short-edge
+  char         *product;               // Product value
+  cups_array_t *filters,               // cupsFilter/cupsFilter2 values
+               *prefilters;            // cupsPreFilter values
+  int          single_file;            // cupsSingleFile value
+  cups_array_t *finishings;            // cupsIPPFinishings values
+  cups_array_t *templates;             // cupsFinishingTemplate values
+  int          max_copies,             // cupsMaxCopies value
+               account_id,             // cupsJobAccountId value
+               accounting_user_id;     // cupsJobAccountingUserId value
+  char         *password;              // cupsJobPassword value
+  cups_array_t *mandatory;             // cupsMandatory value
+  char         *charge_info_uri;       // cupsChargeInfoURI value
+  cups_array_t *strings;               // Localization strings
+  cups_array_t *support_files;         // Support files - ICC profiles, etc.
 };
 typedef struct ppd_cache_s ppd_cache_t;
-                                       /**** PPD cache and mapping data ****/
-
-typedef struct ppd_file_s              /**** PPD File ****/
-{
-  int          language_level;         /* Language level of device */
-  int          color_device;           /* 1 = color device, 0 = grayscale */
-  int          variable_sizes;         /* 1 = supports variable sizes,
-                                          0 = doesn't */
-  int          accurate_screens;       /* 1 = supports accurate screens,
-                                          0 = not */
-  int          contone_only;           /* 1 = continuous tone only, 0 = not */
-  int          landscape;              /* -90 or 90 */
-  int          model_number;           /* Device-specific model number */
-  int          manual_copies;          /* 1 = Copies done manually,
-                                          0 = hardware */
-  int          throughput;             /* Pages per minute */
-  ppd_cs_t     colorspace;             /* Default colorspace */
-  char         *patches;               /* Patch commands to be sent to
-                                          printer */
-  int          num_emulations;         /* Number of emulations supported
-                                          (no longer supported) @private@ */
-  ppd_emul_t   *emulations;            /* Emulations and the code to invoke
-                                          them (no longer supported)
-                                          @private@ */
-  char         *jcl_begin;             /* Start JCL commands */
-  char         *jcl_ps;                /* Enter PostScript interpreter */
+                                       // **** PPD cache and mapping data ****
+
+typedef struct ppd_file_s              // **** PPD File ****
+{
+  int          language_level;         // Language level of device
+  int          color_device;           // 1 = color device, 0 = grayscale
+  int          variable_sizes;         // 1 = supports variable sizes,
+                                       // 0 = doesn't
+  int          accurate_screens;       // 1 = supports accurate screens,
+                                       // 0 = not
+  int          contone_only;           // 1 = continuous tone only, 0 = not
+  int          landscape;              // -90 or 90
+  int          model_number;           // Device-specific model number
+  int          manual_copies;          // 1 = Copies done manually,
+                                       // 0 = hardware
+  int          throughput;             // Pages per minute
+  ppd_cs_t     colorspace;             // Default colorspace
+  char         *patches;               // Patch commands to be sent to
+                                       // printer
+  int          num_emulations;         // Number of emulations supported
+                                       // (no longer supported) @private@
+  ppd_emul_t   *emulations;            // Emulations and the code to invoke
+                                       // them (no longer supported)
+                                       // @private@
+  char         *jcl_begin;             // Start JCL commands
+  char         *jcl_ps;                // Enter PostScript interpreter
 #if HAVE_CUPS_3_X
-  char         *jcl_pdf;               /* Enter PDF interpreter */
+  char         *jcl_pdf;               // Enter PDF interpreter
 #endif
-  char         *jcl_end;               /* End JCL commands */
-  char         *lang_encoding;         /* Language encoding */
-  char         *lang_version;          /* Language version (English, Spanish,
-                                          etc.) */
-  char         *modelname;             /* Model name (general) */
-  char         *ttrasterizer;          /* Truetype rasterizer */
-  char         *manufacturer;          /* Manufacturer name */
-  char         *product;               /* Product name (from PS
-                                          RIP/interpreter) */
-  char         *nickname;              /* Nickname (specific) */
-  char         *shortnickname;         /* Short version of nickname */
-  int          num_groups;             /* Number of UI groups */
-  ppd_group_t  *groups;                /* UI groups */
-  int          num_sizes;              /* Number of page sizes */
-  ppd_size_t   *sizes;                 /* Page sizes */
-  float                custom_min[2];          /* Minimum variable page size */
-  float                custom_max[2];          /* Maximum variable page size */
-  float                custom_margins[4];      /* Margins around page */
-  int          num_consts;             /* Number of UI/Non-UI constraints */
-  ppd_const_t  *consts;                /* UI/Non-UI constraints */
-  int          num_fonts;              /* Number of pre-loaded fonts */
-  char         **fonts;                /* Pre-loaded fonts */
-  int          num_profiles;           /* Number of sRGB color profiles */
-  ppd_profile_t        *profiles;              /* sRGB color profiles */
-  int          num_filters;            /* Number of filters */
-  char         **filters;              /* Filter strings... */
-
-  /**** New in CUPS 1.1 ****/
-  int          flip_duplex;            /* 1 = Flip page for back sides */
-
-  /**** New in CUPS 1.1.19 ****/
-  char         *protocols;             /* Protocols (BCP, TBCP) string
-                                          @since CUPS 1.1.19/macOS 10.3@ */
-  char         *pcfilename;            /* PCFileName string @since
-                                          CUPS 1.1.19/macOS 10.3@ */
-  int          num_attrs;              /* Number of attributes @since
-                                          CUPS 1.1.19/macOS 10.3@ @private@ */
-  int          cur_attr;               /* Current attribute @since
-                                          CUPS 1.1.19/macOS 10.3@ @private@ */
-  ppd_attr_t   **attrs;                /* Attributes @since CUPS 1.1.19/macOS
-                                          10.3@ @private@ */
-
-  /**** New in CUPS 1.2/macOS 10.5 ****/
-  cups_array_t *sorted_attrs;          /* Attribute lookup array @since
-                                          CUPS 1.2/macOS 10.5@ @private@ */
-  cups_array_t *options;               /* Option lookup array @since
-                                          CUPS 1.2/macOS 10.5@ @private@ */
-  cups_array_t *coptions;              /* Custom options array @since
-                                          CUPS 1.2/macOS 10.5@ @private@ */
-
-  /**** New in CUPS 1.3/macOS 10.5 ****/
-  cups_array_t *marked;                /* Marked choices
-                                          @since CUPS 1.3/macOS 10.5@
-                                          @private@ */
-
-  /**** New in CUPS 1.4/macOS 10.6 ****/
-  cups_array_t *cups_uiconstraints;    /* cupsUIConstraints @since
-                                          CUPS 1.4/macOS 10.6@ @private@ */
-
-  /**** New in CUPS 1.5 ****/
-  ppd_cache_t  *cache;                 /* PPD cache and mapping data @since
-                                          CUPS 1.5/macOS 10.7@ @private@ */
+  char         *jcl_end;               // End JCL commands
+  char         *lang_encoding;         // Language encoding
+  char         *lang_version;          // Language version (English, Spanish,
+                                       // etc.)
+  char         *modelname;             // Model name (general)
+  char         *ttrasterizer;          // Truetype rasterizer
+  char         *manufacturer;          // Manufacturer name
+  char         *product;               // Product name (from PS
+                                       // RIP/interpreter)
+  char         *nickname;              // Nickname (specific)
+  char         *shortnickname;         // Short version of nickname
+  int          num_groups;             // Number of UI groups
+  ppd_group_t  *groups;                // UI groups
+  int          num_sizes;              // Number of page sizes
+  ppd_size_t   *sizes;                 // Page sizes
+  float                custom_min[2];          // Minimum variable page size
+  float                custom_max[2];          // Maximum variable page size
+  float                custom_margins[4];      // Margins around page
+  int          num_consts;             // Number of UI/Non-UI constraints
+  ppd_const_t  *consts;                // UI/Non-UI constraints
+  int          num_fonts;              // Number of pre-loaded fonts
+  char         **fonts;                // Pre-loaded fonts
+  int          num_profiles;           // Number of sRGB color profiles
+  ppd_profile_t        *profiles;              // sRGB color profiles
+  int          num_filters;            // Number of filters
+  char         **filters;              // Filter strings...
+
+  // *** New in CUPS 1.1 ****
+  int          flip_duplex;            // 1 = Flip page for back sides
+
+  // **** New in CUPS 1.1.19 ****
+  char         *protocols;             // Protocols (BCP, TBCP) string
+                                       // @since CUPS 1.1.19/macOS 10.3@
+  char         *pcfilename;            // PCFileName string @since
+                                       // CUPS 1.1.19/macOS 10.3@
+  int          num_attrs;              // Number of attributes @since
+                                       // CUPS 1.1.19/macOS 10.3@ @private@
+  int          cur_attr;               // Current attribute @since
+                                       // CUPS 1.1.19/macOS 10.3@ @private@
+  ppd_attr_t   **attrs;                // Attributes @since CUPS 1.1.19/macOS
+                                       // 10.3@ @private@
+
+  // **** New in CUPS 1.2/macOS 10.5 ****
+  cups_array_t *sorted_attrs;          // Attribute lookup array @since
+                                       // CUPS 1.2/macOS 10.5@ @private@
+  cups_array_t *options;               // Option lookup array @since
+                                       // CUPS 1.2/macOS 10.5@ @private@
+  cups_array_t *coptions;              // Custom options array @since
+                                       // CUPS 1.2/macOS 10.5@ @private@
+
+  // **** New in CUPS 1.3/macOS 10.5 ****
+  cups_array_t *marked;                // Marked choices
+                                       // @since CUPS 1.3/macOS 10.5@
+                                       // @private@
+
+  // **** New in CUPS 1.4/macOS 10.6 ****
+  cups_array_t *cups_uiconstraints;    // cupsUIConstraints @since
+                                       // CUPS 1.4/macOS 10.6@ @private@
+
+  // **** New in CUPS 1.5 ****
+  ppd_cache_t  *cache;                 // PPD cache and mapping data @since
+                                       // CUPS 1.5/macOS 10.7@ @private@
 } ppd_file_t;
 
-/**** New in cups-filters 2.0.0: Ovetaken from cups-driverd ****/
-typedef struct                         /**** PPD record ****/
+// **** New in cups-filters 2.0.0: Ovetaken from cups-driverd ****
+typedef struct                         // **** PPD record ****
 {
-  time_t       mtime;                  /* Modification time */
-  off_t                size;                   /* Size in bytes */
-  int          model_number;           /* cupsModelNumber */
-  int          type;                   /* ppd-type */
-  char         filename[512],          /* Filename */
-               name[256],              /* PPD name */
+  time_t       mtime;                  // Modification time
+  off_t                size;                   // Size in bytes
+  int          model_number;           // cupsModelNumber
+  int          type;                   // ppd-type
+  char         filename[512],          // Filename
+               name[256],              // PPD name
                languages[PPD_MAX_LANG][6],
-                                       /* LanguageVersion/cupsLanguages */
+                                       // LanguageVersion/cupsLanguages
                products[PPD_MAX_PROD][128],
-                                       /* Product strings */
+                                       // Product strings
                psversions[PPD_MAX_VERS][32],
-                                       /* PSVersion strings */
-               make[128],              /* Manufacturer */
-               make_and_model[128],    /* NickName/ModelName */
-               device_id[256],         /* IEEE 1284 Device ID */
-               scheme[128];            /* PPD scheme */
+                                       // PSVersion strings
+               make[128],              // Manufacturer
+               make_and_model[128],    // NickName/ModelName
+               device_id[256],         // IEEE 1284 Device ID
+               scheme[128];            // PPD scheme
 } ppd_rec_t;
 
-typedef struct                         /**** In-memory record ****/
+typedef struct                         // **** In-memory record ****
 {
-  int          found;                  /* 1 if PPD is found */
-  int          matches;                /* Match count */
-  ppd_rec_t    record;                 /* PPDs.dat record */
+  int          found;                  // 1 if PPD is found
+  int          matches;                // Match count
+  ppd_rec_t    record;                 // PPDs.dat record
 } ppd_info_t;
 
 typedef struct
 {
-  char         *name;                  /* Name for PPD collection */
-  char         *path;                  /* Directory where PPD collection is
-                                          located */
+  char         *name;                  // Name for PPD collection
+  char         *path;                  // Directory where PPD collection is
+                                       // located
 } ppd_collection_t;
 
 
 
-/*
- * Prototypes...
- */
+//
+// Prototypes...
+//
 
-/* cupsMarkOptions replaced by ppdMarkOptions in libppd */
-/* extern int          cupsMarkOptions(ppd_file_t *ppd, int num_options,
-                                        cups_option_t *options); */
-/* Definition for backward compatibility, will be removed soon */
+// cupsMarkOptions replaced by ppdMarkOptions in libppd
+// extern int          cupsMarkOptions(ppd_file_t *ppd, int num_options,
+//                                      cups_option_t *options);
+// Definition for backward compatibility, will be removed soon
 #define cupsMarkOptions cupsMarkOptions_USE_ppdMarkOptions_INSTEAD
 
 extern void            ppdClose(ppd_file_t *ppd);
@@ -614,7 +612,7 @@ extern float                ppdPageLength(ppd_file_t *ppd, const char *name);
 extern ppd_size_t      *ppdPageSize(ppd_file_t *ppd, const char *name);
 extern float           ppdPageWidth(ppd_file_t *ppd, const char *name);
 
-/**** New in CUPS 1.1.19 ****/
+// **** New in CUPS 1.1.19 ****
 extern const char      *ppdErrorString(ppd_status_t status);
 extern ppd_attr_t      *ppdFindAttr(ppd_file_t *ppd, const char *name,
                                     const char *spec);
@@ -622,17 +620,17 @@ extern ppd_attr_t *ppdFindNextAttr(ppd_file_t *ppd, const char *name,
                                         const char *spec);
 extern ppd_status_t    ppdLastError(int *line);
 
-/**** New in CUPS 1.1.20 ****/
+// **** New in CUPS 1.1.20 ****
 extern void            ppdSetConformance(ppd_conform_t c);
 
-/**** New in CUPS 1.2 ****/
-/* cupsRasterInterpretPPD replaced by ppdRasterInterpretPPD in libppd */
-/* extern int          cupsRasterInterpretPPD(cups_page_header2_t *h,
-                                              ppd_file_t *ppd,
-                                              int num_options,
-                                              cups_option_t *options,
-                                              cups_interpret_cb_t func); */
-/* Definition for backward compatibility, will be removed soon */
+// **** New in CUPS 1.2 ****
+// cupsRasterInterpretPPD replaced by ppdRasterInterpretPPD in libppd
+// extern int          cupsRasterInterpretPPD(cups_page_header2_t *h,
+//                                            ppd_file_t *ppd,
+//                                            int num_options,
+//                                            cups_option_t *options,
+//                                            cups_interpret_cb_t func);
+// Definition for backward compatibility, will be removed soon
 #define cupsRasterInterpretPPD cupsRasterInterpretPPD_USE_ppdRasterInterpretPPD_INSTEAD
 
 extern int             ppdCollect2(ppd_file_t *ppd, ppd_section_t section,
@@ -654,28 +652,28 @@ extern ppd_option_t       *ppdNextOption(ppd_file_t *ppd);
 extern int             ppdLocalize(ppd_file_t *ppd);
 extern ppd_file_t      *ppdOpen2(cups_file_t *fp);
 
-/**** New in CUPS 1.3/macOS 10.5 ****/
+// **** New in CUPS 1.3/macOS 10.5 ****
 extern const char      *ppdLocalizeIPPReason(ppd_file_t *ppd,
                                              const char *reason,
                                              const char *scheme,
                                              char *buffer,
                                              size_t bufsize);
 
-/**** New in CUPS 1.4/macOS 10.6 ****/
-/* cupsGetConflicts replaced by ppdGetConflicts in libppd */
-/* extern int          cupsGetConflicts(ppd_file_t *ppd, const char *option,
-                                        const char *choice,
-                                        cups_option_t **options); */
-/* Definition for backward compatibility, will be removed soon */
+// **** New in CUPS 1.4/macOS 10.6 ****
+// cupsGetConflicts replaced by ppdGetConflicts in libppd
+// extern int          cupsGetConflicts(ppd_file_t *ppd, const char *option,
+//                                      const char *choice,
+//                                      cups_option_t **options);
+// Definition for backward compatibility, will be removed soon
 #define cupsGetConflicts cupsGetConflicts_USE_ppdGetConflicts_INSTEAD
 
-/* cupsResolveConflicts replaced by ppdResolveConflicts in libppd */
-/* extern int          cupsResolveConflicts(ppd_file_t *ppd,
-                                            const char *option,
-                                            const char *choice,
-                                            int *num_options,
-                                            cups_option_t **options); */
-/* Definition for backward compatibility, will be removed soon */
+// cupsResolveConflicts replaced by ppdResolveConflicts in libppd
+// extern int          cupsResolveConflicts(ppd_file_t *ppd,
+//                                          const char *option,
+//                                          const char *choice,
+//                                          int *num_options,
+//                                          cups_option_t **options);
+// Definition for backward compatibility, will be removed soon
 #define cupsResolveConflicts cupsResolveConflicts_USE_ppdResolveConflicts_INSTEAD
 
 extern int             ppdInstallableConflict(ppd_file_t *ppd,
@@ -689,7 +687,7 @@ extern int          ppdPageSizeLimits(ppd_file_t *ppd,
                                          ppd_size_t *minimum,
                                          ppd_size_t *maximum);
 
-/**** New in cups-filters 2.0.0: Renamed functions from original CUPS API ****/
+// **** New in cups-filters 2.0.0: Renamed functions from original CUPS API ****
 extern int             ppdMarkOptions(ppd_file_t *ppd,
                                       int num_options,
                                       cups_option_t *options);
@@ -707,7 +705,7 @@ extern int          ppdResolveConflicts(ppd_file_t *ppd,
                                            int *num_options,
                                            cups_option_t **options);
 
-/**** New in cups-filters 2.0.0: Formerly CUPS-private functions ****/
+// **** New in cups-filters 2.0.0: Formerly CUPS-private functions ****
 extern int             ppdConvertOptions(ipp_t *request,
                                          ppd_file_t *ppd,
                                          ppd_cache_t *pc,
@@ -792,16 +790,16 @@ extern void               ppdPwgUnppdizeName(const char *ppd, char *name,
                                           size_t namesize,
                                           const char *dashchars);
 
-/**** New in cups-filters 2.0.0: Overtaken from ippeveprinter ****/
+// **** New in cups-filters 2.0.0: Overtaken from ippeveprinter ****
 extern ipp_t           *ppdLoadAttributes(ppd_file_t   *ppd);
 
-/**** New in cups-filters 2.0.0: Overtaken from ippeveps ****/
+// **** New in cups-filters 2.0.0: Overtaken from ippeveps ****
 extern int             ppdGetOptions(cups_option_t **options,
                                      ipp_t *printer_attrs,
                                      ipp_t *job_attrs,
                                      ppd_file_t *ppd);
 
-/**** New in cups-filters 2.0.0: Added for pclmtoraster filter ****/
+// **** New in cups-filters 2.0.0: Added for pclmtoraster filter ****
 extern int             ppdRasterMatchPPDSize(cups_page_header2_t *header,
                                              ppd_file_t *ppd,
                                              double margins[4],
@@ -809,7 +807,7 @@ extern int          ppdRasterMatchPPDSize(cups_page_header2_t *header,
                                              int *image_fit,
                                              int *landscape);
 
-/**** New in cups-filters 2.0.0: Ovetaken from cups-driverd ****/
+// **** New in cups-filters 2.0.0: Ovetaken from cups-driverd ****
 extern cups_array_t    *ppdCollectionListPPDs(cups_array_t *ppd_collections,
                                               int limit,
                                               int num_options,
@@ -824,20 +822,20 @@ extern int                ppdCollectionDumpCache(const char *filename,
                                               cf_logfunc_t log,
                                               void *ld);
 
-/**** New in cups-filters 2.0.0: For PPD retro-fit Printer Applications ****/
+// **** New in cups-filters 2.0.0: For PPD retro-fit Printer Applications ****
 extern void             ppdCacheAssignPresets(ppd_file_t *ppd, ppd_cache_t *pc);
 
-/**** New in cups-filters 2.0.0: JCL for PDF printers, for
-      ppdFilterPDFToPDF() and ppdFilterImageToPDF() ****/
+/**** New in cups-filters 2.0.0: JCL for PDF printers, for
+//      ppdFilterPDFToPDF() and ppdFilterImageToPDF() ****
 extern int              ppdEmitJCLPDF(ppd_file_t *ppd, FILE *fp,
                                      int job_id, const char *user,
                                      const char *title,
                                      int hw_copies, bool hw_collate);
 
-/**** New in cups-filters 2.0.0: PPD file generator for CUPS queues for
-      driverless printers, compared to the one of CUPS this one supports
-      also clusters composed of different printers as composed by
-      cups-browsed, was cfCreatePPDFromIPP(2)() in libcupsfilters before ****/
+/**** New in cups-filters 2.0.0: PPD file generator for CUPS queues for
+//      driverless printers, compared to the one of CUPS this one supports
+//      also clusters composed of different printers as composed by
+//      cups-browsed, was ppdCreateFromIPP(2)() in libcupsfilters 1.x ****
 char            *ppdCreatePPDFromIPP(char *buffer, size_t bufsize,
                                     ipp_t *response, const char *make_model,
                                     const char *pdl, int color, int duplex,
@@ -851,8 +849,8 @@ char            *ppdCreatePPDFromIPP2(char *buffer, size_t bufsize,
                                      const char *default_cluster_color,
                                      char *status_msg, size_t status_msg_size);
 
-/**** New in cups-filters 2.0.0: Functions to load color profile data from
-      PPD files, from driver.h ****/
+/**** New in cups-filters 2.0.0: Functions to load color profile data from
+//      PPD files, from driver.h ****
 extern ppd_attr_t      *ppdFindColorAttr(ppd_file_t *ppd, const char *name,
                                          const char *colormodel,
                                          const char *media,
@@ -881,11 +879,11 @@ extern cf_cmyk_t  *ppdCMYKLoad(ppd_file_t *ppd,
                                    void *ld);
 
 
-/*
- * C++ magic...
- */
+//
+// C++ magic...
+//
 
 #  ifdef __cplusplus
 }
-#  endif /* __cplusplus */
-#endif /* !_PPD_PPD_H_ */
+#  endif // __cplusplus
+#endif // !_PPD_PPD_H_
index 3a0cab33be48535b3877b7c3c51674ca9d0475fd..f6436c4d76da44e5d8df67dc0f5d06599db99d6f 100644 (file)
@@ -1,10 +1,11 @@
 //
-// Array class for the CUPS PPD Compiler.
+// Array class for the CUPS PPD Compiler in libppd.
 //
 // Copyright 2007-2019 by Apple Inc.
 // Copyright 2002-2005 by Easy Software Products.
 //
-// Licensed under Apache License v2.0.  See the file "LICENSE" for more information.
+// Licensed under Apache License v2.0.  See the file "LICENSE" for more
+// information.
 //
 
 //
index 5bd6b213b7d3d052e285996d227b2fab87c7de5d..905ead59acecd295138cd6a95903da3d0fcf5212 100644 (file)
@@ -1,10 +1,11 @@
 //
-// Attribute class for the CUPS PPD Compiler.
+// Attribute class for the CUPS PPD Compiler in libppd.
 //
 // Copyright 2007-2009 by Apple Inc.
 // Copyright 2002-2005 by Easy Software Products.
 //
-// Licensed under Apache License v2.0.  See the file "LICENSE" for more information.
+// Licensed under Apache License v2.0.  See the file "LICENSE" for more
+// information.
 //
 
 //
index 8283218974350ff5879fe4e99b75e88611b942b8..71cd7339406997cc7bd8eb57416b9b1003044cd9 100644 (file)
@@ -1,10 +1,11 @@
 //
-// Shared message catalog class for the CUPS PPD Compiler.
+// Shared message catalog class for the CUPS PPD Compiler in libppd.
 //
 // Copyright 2007-2017 by Apple Inc.
 // Copyright 2002-2006 by Easy Software Products.
 //
-// Licensed under Apache License v2.0.  See the file "LICENSE" for more information.
+// Licensed under Apache License v2.0.  See the file "LICENSE" for more
+// information.
 //
 
 //
@@ -57,7 +58,7 @@ ppdcCatalog::ppdcCatalog(const char *l,       // I - Locale
     char       pofile[1024];           // Message catalog file
     const char  *c;
 
-    /* Determine CUPS datadir (usually /usr/share/cups) */
+    // Determine CUPS datadir (usually /usr/share/cups)
     if ((c = getenv("CUPS_DATADIR")) == NULL)
       c = CUPS_DATADIR;
 
@@ -185,14 +186,14 @@ ppdcCatalog::load_messages(
     goto unknown_load_format;
   else if (!strcmp(ptr, ".strings"))
   {
-   /*
-    * Read messages in macOS ".strings" format, which are either UTF-8/UTF-16
-    * text files of the format:
-    *
-    *     "id" = "str";
-    *
-    * Strings files can also contain C-style comments.
-    */
+    //
+    // Read messages in macOS ".strings" format, which are either UTF-8/UTF-16
+    // text files of the format:
+    //
+    //     "id" = "str";
+    //
+    // Strings files can also contain C-style comments.
+    //
 
     ppdc_cs_t  cs = PPDC_CS_AUTO;      // Character set for file
     int                ch;                     // Current character from file
@@ -278,22 +279,22 @@ ppdcCatalog::load_messages(
   }
   else if (!strcmp(ptr, ".po") || !strcmp(ptr, ".gz"))
   {
-   /*
-    * Read messages from the catalog file until EOF...
-    *
-    * The format is the GNU gettext .po format, which is fairly simple:
-    *
-    *     msgid "some text"
-    *     msgstr "localized text"
-    *
-    * The ID and localized text can span multiple lines using the form:
-    *
-    *     msgid ""
-    *     "some long text"
-    *     msgstr ""
-    *     "localized text spanning "
-    *     "multiple lines"
-    */
+    //
+    // Read messages from the catalog file until EOF...
+    //
+    // The format is the GNU gettext .po format, which is fairly simple:
+    //
+    //     msgid "some text"
+    //     msgstr "localized text"
+    //
+    // The ID and localized text can span multiple lines using the form:
+    //
+    //     msgid ""
+    //     "some long text"
+    //     msgstr ""
+    //     "localized text spanning "
+    //     "multiple lines"
+    //
 
     int        which,                          // In msgid?
        haveid,                         // Did we get a msgid string?
@@ -425,17 +426,17 @@ ppdcCatalog::load_messages(
   else
     goto unknown_load_format;
 
- /*
-  * Close the file and return...
-  */
+  //
+  // Close the file and return...
+  //
 
   cupsFileClose(fp);
 
   return (0);
 
- /*
-  * Unknown format error...
-  */
+  //
+  // Unknown format error...
+  //
 
   unknown_load_format:
 
index cb514d5e520223fa7e7d3fbf7ce390d7864c8eff..6ec2e7ddda73c720aec8d69ad41488726e91d4bc 100644 (file)
@@ -1,10 +1,11 @@
 //
-// Option choice class for the CUPS PPD Compiler.
+// Option choice class for the CUPS PPD Compiler in libppd.
 //
 // Copyright 2007-2009 by Apple Inc.
 // Copyright 2002-2005 by Easy Software Products.
 //
-// Licensed under Apache License v2.0.  See the file "LICENSE" for more information.
+// Licensed under Apache License v2.0.  See the file "LICENSE" for more
+// information.
 //
 
 //
index 54e5245931c7c3efea6864e8a967eec7b16cfc73..b5abc8f2f4fdcc67969b2aa60c6b98d1c286793e 100644 (file)
@@ -1,10 +1,11 @@
 //
-// Contraint class for the CUPS PPD Compiler.
+// Contraint class for the CUPS PPD Compiler in libppd.
 //
 // Copyright 2007-2009 by Apple Inc.
 // Copyright 2002-2005 by Easy Software Products.
 //
-// Licensed under Apache License v2.0.  See the file "LICENSE" for more information.
+// Licensed under Apache License v2.0.  See the file "LICENSE" for more
+// information.
 //
 
 //
index d8f9df83d43718258610cf0196e1629c5a53b8d7..3dcfb6067a40fb611643d93182edf7c6772e73d9 100644 (file)
@@ -1,5 +1,5 @@
 //
-// PPD file compiler definitions for the CUPS PPD Compiler.
+// PPD file compiler definitions for the CUPS PPD Compiler in libppd.
 //
 // Copyright © 2007-2019 by Apple Inc.
 // Copyright © 2002-2006 by Easy Software Products.
index 484d9f1c37d2140a744331aba4aea39a605a32d3..a779b2808e8680ab6fe12c86a18e17ce24466aa1 100644 (file)
@@ -1,10 +1,11 @@
 //
-// File class for the CUPS PPD Compiler.
+// File class for the CUPS PPD Compiler in libppd.
 //
 // Copyright 2007-2010 by Apple Inc.
 // Copyright 2002-2005 by Easy Software Products.
 //
-// Licensed under Apache License v2.0.  See the file "LICENSE" for more information.
+// Licensed under Apache License v2.0.  See the file "LICENSE" for more
+// information.
 //
 
 //
index e85d12184b37b51b4ddafb74586a1affe45dd2a8..41a4c5fe45728efdd35bf1f75e20ab554401d300 100644 (file)
@@ -1,10 +1,11 @@
 //
-// Filter class for the CUPS PPD Compiler.
+// Filter class for the CUPS PPD Compiler in libppd.
 //
 // Copyright 2007-2009 by Apple Inc.
 // Copyright 2002-2005 by Easy Software Products.
 //
-// Licensed under Apache License v2.0.  See the file "LICENSE" for more information.
+// Licensed under Apache License v2.0.  See the file "LICENSE" for more
+// information.
 //
 
 //
index 8a9f65a8419e580caf67c7d3dac35d62d66611ea..8ba5d26bf18493d26208540a31745839dd08d060 100644 (file)
@@ -1,10 +1,11 @@
 //
-// Shared font class for the CUPS PPD Compiler.
+// Shared font class for the CUPS PPD Compiler in libppd.
 //
 // Copyright 2007-2009 by Apple Inc.
 // Copyright 2002-2005 by Easy Software Products.
 //
-// Licensed under Apache License v2.0.  See the file "LICENSE" for more information.
+// Licensed under Apache License v2.0.  See the file "LICENSE" for more
+// information.
 //
 
 //
index dc9428426d038dccb8e15af40e37853a0845bf03..71e59bb8d2c4f187438b85b0c0b80cb62c8863f9 100644 (file)
@@ -1,10 +1,11 @@
 //
-// Group class for the CUPS PPD Compiler.
+// Group class for the CUPS PPD Compiler in libppd.
 //
 // Copyright 2007-2011 by Apple Inc.
 // Copyright 2002-2005 by Easy Software Products.
 //
-// Licensed under Apache License v2.0.  See the file "LICENSE" for more information.
+// Licensed under Apache License v2.0.  See the file "LICENSE" for more
+// information.
 //
 
 //
index 0f04e42abdc1b17ebd67d6f5bbae519e1f3a1914..9d3151c715d2c866da21544b87b0e1f5944a88f2 100644 (file)
@@ -1,10 +1,11 @@
 //
-// PPD file import methods for the CUPS PPD Compiler.
+// PPD file import methods for the CUPS PPD Compiler in libppd.
 //
 // Copyright 2007-2011 by Apple Inc.
 // Copyright 2002-2006 by Easy Software Products.
 //
-// Licensed under Apache License v2.0.  See the file "LICENSE" for more information.
+// Licensed under Apache License v2.0.  See the file "LICENSE" for more
+// information.
 //
 
 //
index a93d7e794670d8cb225f1346c2c5a91699236be9..8c5245c926cb4932789ebe68aac5a469561c5835 100644 (file)
@@ -1,10 +1,11 @@
 //
-// Shared media size class for the CUPS PPD Compiler.
+// Shared media size class for the CUPS PPD Compiler in libppd.
 //
 // Copyright 2007-2009 by Apple Inc.
 // Copyright 2002-2005 by Easy Software Products.
 //
-// Licensed under Apache License v2.0.  See the file "LICENSE" for more information.
+// Licensed under Apache License v2.0.  See the file "LICENSE" for more
+// information.
 //
 
 //
index 8d6ec7e5b5ca5acfbbd5e6c32a31daafbae0bb9f..9e84e893073a6e43c431f533826cb601fb366339 100644 (file)
@@ -1,10 +1,11 @@
 //
-// Shared message class for the CUPS PPD Compiler.
+// Shared message class for the CUPS PPD Compiler in libppd.
 //
 // Copyright 2007-2009 by Apple Inc.
 // Copyright 2002-2005 by Easy Software Products.
 //
-// Licensed under Apache License v2.0.  See the file "LICENSE" for more information.
+// Licensed under Apache License v2.0.  See the file "LICENSE" for more
+// information.
 //
 
 //
index eca63047038cc7da38db8226d27a8de054d3d34b..9a63d0ff7253e2bd8a96435e52b841989ce38ea3 100644 (file)
@@ -1,10 +1,11 @@
 //
-// Option class for the CUPS PPD Compiler.
+// Option class for the CUPS PPD Compiler in libppd.
 //
 // Copyright 2007-2011 by Apple Inc.
 // Copyright 2002-2005 by Easy Software Products.
 //
-// Licensed under Apache License v2.0.  See the file "LICENSE" for more information.
+// Licensed under Apache License v2.0.  See the file "LICENSE" for more
+// information.
 //
 
 //
index f964db903f8deeec966edc22df698ec20b0930ab..00b8b951e7acac4c518b9b514cde0ef4a9906a6d 100644 (file)
@@ -1,9 +1,10 @@
 //
-// Private definitions for the CUPS PPD Compiler.
+// Private definitions for the CUPS PPD Compilerin libppd.
 //
 // Copyright 2009-2010 by Apple Inc.
 //
-// Licensed under Apache License v2.0.  See the file "LICENSE" for more information.
+// Licensed under Apache License v2.0.  See the file "LICENSE" for more
+// information.
 //
 
 #ifndef _PPDC_PRIVATE_H_
 #    define PPDC_NEWVAL(s)
 #    define PPDC_DELETE
 #    define PPDC_DELETEVAL(s)
-#  endif /* PPDC_DEBUG */
+#  endif // PPDC_DEBUG
 
-/*
- * Macro for localized text...
- */
+//
+// Macro for localized text...
+//
 
 #  define _(x) x
 
index 3fbf9688f9647e2e7e8d738a3ead8183f51f6cfa..8939b5c1a3f8186ba5ec11633cc8a142ed2efe90 100644 (file)
@@ -1,10 +1,11 @@
 //
-// Color profile class for the CUPS PPD Compiler.
+// Color profile class for the CUPS PPD Compiler in libppd.
 //
 // Copyright 2007-2009 by Apple Inc.
 // Copyright 2002-2005 by Easy Software Products.
 //
-// Licensed under Apache License v2.0.  See the file "LICENSE" for more information.
+// Licensed under Apache License v2.0.  See the file "LICENSE" for more
+// information.
 //
 
 //
index 1b0152d3b34e22b877936f3ce526a30529971ae2..f3715c0e1b1b9ba159962e0f124f6047a2fc3eb4 100644 (file)
@@ -1,10 +1,11 @@
 //
-// Shared data class for the CUPS PPD Compiler.
+// Shared data class for the CUPS PPD Compiler in libppd.
 //
 // Copyright 2007-2009 by Apple Inc.
 // Copyright 2002-2005 by Easy Software Products.
 //
-// Licensed under Apache License v2.0.  See the file "LICENSE" for more information.
+// Licensed under Apache License v2.0.  See the file "LICENSE" for more
+// information.
 //
 
 //
@@ -48,7 +49,7 @@ ppdcShared::release(void)
     fprintf(stderr, "ERROR: Over-release of %s: %p\n", class_name(), this);
     abort();
   }
-#endif /* DEBUG */
+#endif // DEBUG
 
   if (use == 0)
     delete this;
index 500ce215f7feca3297749711b12bd81a0d4ec8a0..c2fc06fe75b9c481cbe0055babef4a3860c95ccb 100644 (file)
@@ -1,5 +1,5 @@
 //
-// Source class for the CUPS PPD Compiler.
+// Source class for the CUPS PPD Compiler in libppd.
 //
 // Copyright 2007-2018 by Apple Inc.
 // Copyright 2002-2007 by Easy Software Products.
@@ -1304,8 +1304,8 @@ ppdcSource::get_integer(const char *v)    // I - Value string
         // NAME logicop value
        for (newv = (char *)v + 1;
             *newv && (isalnum(*newv & 255) || *newv == '_');
-            newv ++)
-         /* do nothing */;
+            newv ++);
+         // do nothing
 
         ch    = *newv;
        *newv = '\0';
@@ -2283,7 +2283,7 @@ ppdcSource::quotef(cups_file_t *fp,       // I - File to write to
             if (size == 'L')
              bytes += cupsFilePrintf(fp, tformat, va_arg(ap, long long));
            else
-#  endif /* HAVE_LONG_LONG */
+#  endif // HAVE_LONG_LONG
             if (size == 'l')
              bytes += cupsFilePrintf(fp, tformat, va_arg(ap, long));
            else
index b28294e1a5c01d527613bcf79cab49d32e1fa718..5c8d2e18bc6c86e3e222d9d4dcacbc91d32958cd 100644 (file)
@@ -1,10 +1,11 @@
 //
-// Shared string class for the CUPS PPD Compiler.
+// Shared string class for the CUPS PPD Compiler in libppd.
 //
 // Copyright 2007-2012 by Apple Inc.
 // Copyright 2002-2005 by Easy Software Products.
 //
-// Licensed under Apache License v2.0.  See the file "LICENSE" for more information.
+// Licensed under Apache License v2.0.  See the file "LICENSE" for more
+// information.
 //
 
 //
index f84dedaa2f7768d6afeace7a90e9bbeff50f0c92..8e6d9eb66a35ccdcc8345aa9d4089107b9443113 100644 (file)
@@ -1,10 +1,11 @@
 //
-// Variable class for the CUPS PPD Compiler.
+// Variable class for the CUPS PPD Compiler in libppd.
 //
 // Copyright 2007-2009 by Apple Inc.
 // Copyright 2002-2005 by Easy Software Products.
 //
-// Licensed under Apache License v2.0.  See the file "LICENSE" for more information.
+// Licensed under Apache License v2.0.  See the file "LICENSE" for more
+// information.
 //
 
 //
index 394e04d1770426d3343aca8b43194a0a2450a960..7808ee542e1e132e5c6a82bb3e293c955e8a3a6f 100644 (file)
@@ -1,10 +1,11 @@
 //
-// PPD file compiler main entry for the CUPS PPD Compiler.
+// PPD file compiler main entry for the CUPS PPD Compiler in libppd.
 //
 // Copyright 2007-2014 by Apple Inc.
 // Copyright 2002-2007 by Easy Software Products.
 //
-// Licensed under Apache License v2.0.  See the file "LICENSE" for more information.
+// Licensed under Apache License v2.0.  See the file "LICENSE" for more
+// information.
 //
 
 //
@@ -381,9 +382,9 @@ main(int  argc,                             // I - Number of command-line arguments
          fprintf(stdout, _("%s: Writing %s.\n"), progname, filename);
       }
 
-     /*
-      * Write the PPD file...
-      */
+      //
+      // Write the PPD file...
+      //
 
       ppdcArray *templocales = locales;
 
index 075cdcb5041539fd1c3e38edebaf77ee0e8fc041..0a3a190261bdb6c0bb7c92be789f75b1e14d9133 100644 (file)
@@ -1,10 +1,11 @@
 //
-// Definitions for the CUPS PPD Compiler.
+// API definitions for the CUPS PPD Compiler in libppd.
 //
 // Copyright 2007-2019 by Apple Inc.
 // Copyright 2002-2007 by Easy Software Products.
 //
-// Licensed under Apache License v2.0.  See the file "LICENSE" for more information.
+// Licensed under Apache License v2.0.  See the file "LICENSE" for more
+// information.
 //
 
 #ifndef _PPDC_H_
index 590dedb7cf939563b017854620b167b89c76c1ea..1179fbf9913e738e438a45f654f61596026689e4 100644 (file)
@@ -1,10 +1,11 @@
 //
-// PPD to HTML utility for the CUPS PPD Compiler.
+// PPD to HTML utility for the CUPS PPD Compiler in libppd.
 //
 // Copyright 2007-2015 by Apple Inc.
 // Copyright 2002-2005 by Easy Software Products.
 //
-// Licensed under Apache License v2.0.  See the file "LICENSE" for more information.
+// Licensed under Apache License v2.0.  See the file "LICENSE" for more
+// information.
 //
 
 //
index ff5fc204e374a1db8ed6caa28fc9b1b6f649bf96..056b2e570bb3ef9e553ccb4f1540fa4357ad7c84 100644 (file)
@@ -1,10 +1,11 @@
 //
-// PPD file import utility for the CUPS PPD Compiler.
+// PPD file import utility for the CUPS PPD Compiler in libppd.
 //
 // Copyright 2007-2011 by Apple Inc.
 // Copyright 2002-2005 by Easy Software Products.
 //
-// Licensed under Apache License v2.0.  See the file "LICENSE" for more information.
+// Licensed under Apache License v2.0.  See the file "LICENSE" for more
+// information.
 //
 
 //
index 399ffb0eef38046c9915407cb39c1b3b767aac7b..41c6516b071a76f4acdb8043a6e090fa494a05b2 100644 (file)
@@ -1,5 +1,5 @@
 //
-// PPD file merge utility for the CUPS PPD Compiler.
+// PPD file merge utility for the CUPS PPD Compiler in libppd.
 //
 // Copyright © 2007-2018 by Apple Inc.
 // Copyright © 2002-2007 by Easy Software Products.
@@ -292,8 +292,8 @@ ppd_locale(ppd_file_t *ppd)         // I - PPD file
   static char  locale[256];            // Locale string
   static struct                                // LanguageVersion translation table
   {
-    const char *version,               // LanguageVersion string */
-               *language;              // Language code */
+    const char *version,               // LanguageVersion string
+               *language;              // Language code
   }            languages[] =
   {
     { "chinese",               "zh" },
index b8459120fd3284c0579d07909bea4991378302bf..89528db9ca805b910c231cabdcd3fd1820737595 100644 (file)
@@ -1,10 +1,11 @@
 //
-// PPD file message catalog program for the CUPS PPD Compiler.
+// PPD file message catalog program for the CUPS PPD Compiler in libppd.
 //
 // Copyright 2007-2015 by Apple Inc.
 // Copyright 2002-2005 by Easy Software Products.
 //
-// Licensed under Apache License v2.0.  See the file "LICENSE" for more information.
+// Licensed under Apache License v2.0.  See the file "LICENSE" for more
+// information.
 //
 
 //
index 1c5c468d3ae935d7f1126cb3268040f17176c4b7..36d7c21f52b7e16311dabb240db371689f10bc26 100644 (file)
@@ -1,40 +1,40 @@
-/*
- * Raster error handling for libppd.
- *
- * Copyright © 2007-2018 by Apple Inc.
- * Copyright © 2007 by Easy Software Products.
- *
- * Licensed under Apache License v2.0.  See the file "LICENSE" for more
- * information.
- */
-
-/*
- * Include necessary headers...
- */
+//
+// Raster error handling for libppd.
+//
+// Copyright © 2007-2018 by Apple Inc.
+// Copyright © 2007 by Easy Software Products.
+//
+// Licensed under Apache License v2.0.  See the file "LICENSE" for more
+// information.
+//
+
+//
+// Include necessary headers...
+//
 
 #include "raster-private.h"
 #include "debug-internal.h"
 
-typedef struct _ppd_raster_error_s     /**** Error buffer structure ****/
+typedef struct _ppd_raster_error_s     // **** Error buffer structure ****
 {
-  char *start,                         /* Start of buffer */
-       *current,                       /* Current position in buffer */
-       *end;                           /* End of buffer */
+  char *start,                         // Start of buffer
+       *current,                       // Current position in buffer
+       *end;                           // End of buffer
 } _ppd_raster_error_t;
 
 static _ppd_raster_error_t     *buf = NULL;
 
-/*
- * '_ppdRasterAddError()' - Add an error message to the error buffer.
- */
+//
+// '_ppdRasterAddError()' - Add an error message to the error buffer.
+//
 
 void
-_ppdRasterAddError(const char *f,      /* I - Printf-style error message */
-                    ...)               /* I - Additional arguments as needed */
+_ppdRasterAddError(const char *f,      // I - Printf-style error message
+                    ...)               // I - Additional arguments as needed
 {
-  va_list      ap;                     /* Pointer to additional arguments */
-  char         s[2048];                /* Message string */
-  ssize_t      bytes;                  /* Bytes in message string */
+  va_list      ap;                     // Pointer to additional arguments
+  char         s[2048];                // Message string
+  ssize_t      bytes;                  // Bytes in message string
 
 
   DEBUG_printf(("_ppdRasterAddError(f=\"%s\", ...)", f));
@@ -55,12 +55,12 @@ _ppdRasterAddError(const char *f,   /* I - Printf-style error message */
 
   if (bytes > (ssize_t)(buf->end - buf->current))
   {
-   /*
-    * Allocate more memory...
-    */
+    //
+    // Allocate more memory...
+    //
 
-    char       *temp;                  /* New buffer */
-    size_t     size;                   /* Size of buffer */
+    char       *temp;                  // New buffer
+    size_t     size;                   // Size of buffer
 
 
     size = (size_t)(buf->end - buf->start + 2 * bytes + 1024);
@@ -73,32 +73,33 @@ _ppdRasterAddError(const char *f,   /* I - Printf-style error message */
     if (!temp)
       return;
 
-   /*
-    * Update pointers...
-    */
+    //
+    // Update pointers...
+    //
 
     buf->end     = temp + size;
     buf->current = temp + (buf->current - buf->start);
     buf->start   = temp;
   }
 
- /*
-  * Append the message to the end of the current string...
-  */
+  //
+  // Append the message to the end of the current string...
+  //
 
   memcpy(buf->current, s, (size_t)bytes);
   buf->current += bytes - 1;
 }
 
 
-/*
- * '_ppdRasterClearError()' - Clear the error buffer.
- */
+//
+// '_ppdRasterClearError()' - Clear the error buffer.
+//
 
 void
 _ppdRasterClearError(void)
 {
-  if (buf == NULL) {
+  if (buf == NULL)
+  {
     buf = malloc(sizeof(_ppd_raster_error_t));
     buf->start = NULL;
     buf->end = NULL;
@@ -112,15 +113,15 @@ _ppdRasterClearError(void)
 }
 
 
-/*
- * '_ppdRasterErrorString()' - Return the last error from a raster function.
- *
- * If there are no recent errors, NULL is returned.
- *
- * @since CUPS 1.3/macOS 10.5@
- */
+//
+// '_ppdRasterErrorString()' - Return the last error from a raster function.
+//
+// If there are no recent errors, NULL is returned.
+//
+// @since CUPS 1.3/macOS 10.5@
+//
 
-const char *                           /* O - Last error */
+const char *                           // O - Last error
 _ppdRasterErrorString(void)
 {
   if (buf->current == buf->start)
index 4796b86d097e00f65dfea72a7a87857d17cb0db6..efa99d7e68b4cfaca9c6a38c2c72e20bb29dcb90 100644 (file)
@@ -1,16 +1,16 @@
-/*
- * PPD command interpreter for libppd.
- *
- * Copyright © 2007-2018 by Apple Inc.
- * Copyright © 1993-2007 by Easy Software Products.
- *
- * Licensed under Apache License v2.0.  See the file "LICENSE" for more
- * information.
- */
-
-/*
- * Include necessary headers...
- */
+//
+// PPD command interpreter for libppd.
+//
+// Copyright © 2007-2018 by Apple Inc.
+// Copyright © 1993-2007 by Easy Software Products.
+//
+// Licensed under Apache License v2.0.  See the file "LICENSE" for more
+// information.
+//
+
+//
+// Include necessary headers...
+//
 
 #include "raster-private.h"
 #include "ppd.h"
@@ -18,9 +18,9 @@
 #include <math.h>
 
 
-/*
- * Stack values for the PostScript mini-interpreter...
- */
+//
+// Stack values for the PostScript mini-interpreter...
+//
 
 typedef enum
 {
@@ -48,28 +48,28 @@ typedef enum
 
 typedef struct
 {
-  _ppd_ps_type_t       type;           /* Object type */
+  _ppd_ps_type_t       type;           // Object type
   union
   {
-    int                boolean;                /* Boolean value */
-    char       name[64];               /* Name value */
-    double     number;                 /* Number value */
-    char       other[64];              /* Other operator */
-    char       string[64];             /* Sring value */
-  }                    value;          /* Value */
+    int                boolean;                // Boolean value
+    char       name[64];               // Name value
+    double     number;                 // Number value
+    char       other[64];              // Other operator
+    char       string[64];             // Sring value
+  }                    value;          // Value
 } _ppd_ps_obj_t;
 
 typedef struct
 {
-  int                  num_objs,       /* Number of objects on stack */
-                       alloc_objs;     /* Number of allocated objects */
-  _ppd_ps_obj_t        *objs;          /* Objects in stack */
+  int                  num_objs,       // Number of objects on stack
+                       alloc_objs;     // Number of allocated objects
+  _ppd_ps_obj_t        *objs;          // Objects in stack
 } _ppd_ps_stack_t;
 
 
-/*
- * Local functions...
- */
+//
+// Local functions...
+//
 
 static int             ppd_cleartomark_stack(_ppd_ps_stack_t *st);
 static int             ppd_copy_stack(_ppd_ps_stack_t *st, int count);
@@ -89,62 +89,63 @@ static int          ppd_setpagedevice(_ppd_ps_stack_t *st,
 #ifdef DEBUG
 static void            ppd_DEBUG_object(const char *prefix, _ppd_ps_obj_t *obj);
 static void            ppd_DEBUG_stack(const char *prefix, _ppd_ps_stack_t *st);
-#endif /* DEBUG */
-
-
-/*
- * 'ppdRasterInterpretPPD()' - Interpret PPD commands to create a page header.
- *
- * This function is used by raster image processing (RIP) filters like
- * cgpdftoraster and imagetoraster when writing CUPS raster data for a page.
- * It is not used by raster printer driver filters which only read CUPS
- * raster data.
- *
- *
- * @code ppdRasterInterpretPPD@ does not mark the options in the PPD using
- * the "num_options" and "options" arguments.  Instead, mark the options with
- * @code ppdMarkOptions@ and @code ppdMarkOption@ prior to calling it -
- * this allows for per-page options without manipulating the options array.
- *
- * The "func" argument specifies an optional callback function that is
- * called prior to the computation of the final raster data.  The function
- * can make changes to the @link cups_page_header2_t@ data as needed to use a
- * supported raster format and then returns 0 on success and -1 if the
- * requested attributes cannot be supported.
- *
- *
- * @code ppdRasterInterpretPPD@ supports a subset of the PostScript language.
- * Currently only the @code [@, @code ]@, @code <<@, @code >>@, @code {@,
- * @code }@, @code cleartomark@, @code copy@, @code dup@, @code index@,
- * @code pop@, @code roll@, @code setpagedevice@, and @code stopped@ operators
- * are supported.
- *
- * @since CUPS 1.2/macOS 10.5@
- */
-
-int                                    /* O - 0 on success, -1 on failure */
+#endif // DEBUG
+
+
+//
+// 'ppdRasterInterpretPPD()' - Interpret PPD commands to create a page header.
+//
+// This function is used by raster image processing (RIP) filters like
+// cgpdftoraster and imagetoraster when writing CUPS raster data for a page.
+// It is not used by raster printer driver filters which only read CUPS
+// raster data.
+//
+//
+// @code ppdRasterInterpretPPD@ does not mark the options in the PPD using
+// the "num_options" and "options" arguments.  Instead, mark the options with
+// @code ppdMarkOptions@ and @code ppdMarkOption@ prior to calling it -
+// this allows for per-page options without manipulating the options array.
+//
+// The "func" argument specifies an optional callback function that is
+// called prior to the computation of the final raster data.  The function
+// can make changes to the @link cups_page_header2_t@ data as needed to use a
+// supported raster format and then returns 0 on success and -1 if the
+// requested attributes cannot be supported.
+//
+//
+// @code ppdRasterInterpretPPD@ supports a subset of the PostScript language.
+// Currently only the @code [@, @code ]@, @code <<@, @code >>@, @code {@,
+// @code }@, @code cleartomark@, @code copy@, @code dup@, @code index@,
+// @code pop@, @code roll@, @code setpagedevice@, and @code stopped@ operators
+// are supported.
+//
+// @since CUPS 1.2/macOS 10.5@
+//
+
+int                                    // O - 0 on success, -1 on failure
 ppdRasterInterpretPPD(
-    cups_page_header2_t *h,            /* O - Page header to create */
-    ppd_file_t          *ppd,          /* I - PPD file */
-    int                 num_options,   /* I - Number of options */
-    cups_option_t       *options,      /* I - Options */
-    cups_interpret_cb_t func)          /* I - Optional page header callback (@code NULL@ for none) */
+    cups_page_header2_t *h,            // O - Page header to create
+    ppd_file_t          *ppd,          // I - PPD file
+    int                 num_options,   // I - Number of options
+    cups_option_t       *options,      // I - Options
+    cups_interpret_cb_t func)          // I - Optional page header callback
+                                       //     (@code NULL@ for none)
 {
-  int          status;                 /* Cummulative status */
-  char         *code;                  /* Code to run */
-  const char   *val;                   /* Option value */
-  ppd_size_t   *size;                  /* Current size */
-  float                left,                   /* Left position */
-               bottom,                 /* Bottom position */
-               right,                  /* Right position */
-               top,                    /* Top position */
-               temp1, temp2;           /* Temporary variables for swapping */
-  int          preferred_bits;         /* Preferred bits per color */
-
-
- /*
-  * Range check input...
-  */
+  int          status;                 // Cummulative status
+  char         *code;                  // Code to run
+  const char   *val;                   // Option value
+  ppd_size_t   *size;                  // Current size
+  float                left,                   // Left position
+               bottom,                 // Bottom position
+               right,                  // Right position
+               top,                    // Top position
+               temp1, temp2;           // Temporary variables for swapping
+  int          preferred_bits;         // Preferred bits per color
+
+
+  //
+  // Range check input...
+  //
 
   _ppdRasterClearError();
 
@@ -154,9 +155,9 @@ ppdRasterInterpretPPD(
     return (-1);
   }
 
- /*
-  * Reset the page header to the defaults...
-  */
+  //
+  // Reset the page header to the defaults...
+  //
 
   memset(h, 0, sizeof(cups_page_header2_t));
 
@@ -179,33 +180,33 @@ ppdRasterInterpretPPD(
   strlcpy(h->cupsPageSizeName, "Letter", sizeof(h->cupsPageSizeName));
 
 #ifdef __APPLE__
- /*
-  * cupsInteger0 is also used for the total page count on macOS; set an
-  * uncommon default value so we can tell if the driver is using cupsInteger0.
-  */
+  //
+  // cupsInteger0 is also used for the total page count on macOS; set an
+  // uncommon default value so we can tell if the driver is using cupsInteger0.
+  //
 
   h->cupsInteger[0] = 0x80000000;
-#endif /* __APPLE__ */
+#endif // __APPLE__
 
- /*
-  * Apply patches and options to the page header...
-  */
+  //
+  // Apply patches and options to the page header...
+  //
 
   status         = 0;
   preferred_bits = 0;
 
   if (ppd)
   {
-   /*
-    * Apply any patch code (used to override the defaults...)
-    */
+    //
+    // Apply any patch code (used to override the defaults...)
+    //
 
     if (ppd->patches)
       status |= ppdRasterExecPS(h, &preferred_bits, ppd->patches);
 
-   /*
-    * Then apply printer options in the proper order...
-    */
+    //
+    // Then apply printer options in the proper order...
+    //
 
     if ((code = ppdEmitString(ppd, PPD_ORDER_DOCUMENT, 0.0)) != NULL)
     {
@@ -232,28 +233,28 @@ ppdRasterInterpretPPD(
     }
   }
 
- /*
-  * Allow option override for page scaling...
-  */
+  //
+  // Allow option override for page scaling...
+  //
 
   if ((val = cupsGetOption("cupsBorderlessScalingFactor", num_options,
                            options)) != NULL)
   {
-    double sc = atof(val);             /* Scale factor */
+    double sc = atof(val);             // Scale factor
 
     if (sc >= 0.1 && sc <= 2.0)
       h->cupsBorderlessScalingFactor = (float)sc;
   }
 
- /*
-  * Get the margins for the current size...
-  */
+  //
+  // Get the margins for the current size...
+  //
 
   if ((size = ppdPageSize(ppd, NULL)) != NULL)
   {
-   /*
-    * Use the margins from the PPD file...
-    */
+    //
+    // Use the margins from the PPD file...
+    //
 
     left   = size->left;
     bottom = size->bottom;
@@ -267,9 +268,9 @@ ppdRasterInterpretPPD(
   }
   else
   {
-   /*
-    * Use the default margins...
-    */
+    //
+    // Use the default margins...
+    //
 
     left   = 0.0f;
     bottom = 0.0f;
@@ -277,15 +278,15 @@ ppdRasterInterpretPPD(
     top    = 792.0f;
   }
 
- /*
-  * Handle orientation...
-  */
+  //
+  // Handle orientation...
+  //
 
   switch (h->Orientation)
   {
     case CUPS_ORIENT_0 :
     default :
-        /* Do nothing */
+        // Do nothing
         break;
 
     case CUPS_ORIENT_90 :
@@ -359,9 +360,9 @@ ppdRasterInterpretPPD(
   h->cupsImagingBBox[2]    = (float)right;
   h->cupsImagingBBox[3]    = (float)top;
 
- /*
-  * Use the callback to validate the page header...
-  */
+  //
+  // Use the callback to validate the page header...
+  //
 
   if (func && (*func)(h, preferred_bits))
   {
@@ -369,9 +370,9 @@ ppdRasterInterpretPPD(
     return (-1);
   }
 
- /*
-  * Check parameters...
-  */
+  //
+  // Check parameters...
+  //
 
   if (!h->HWResolution[0] || !h->HWResolution[1] ||
       !h->PageSize[0] || !h->PageSize[1] ||
@@ -385,14 +386,14 @@ ppdRasterInterpretPPD(
     return (-1);
   }
 
- /*
-  * Compute the bitmap parameters...
-  */
+  //
+  // Compute the bitmap parameters...
+  //
 
   h->cupsWidth  = (unsigned)((right - left) * h->cupsBorderlessScalingFactor *
-                        h->HWResolution[0] / 72.0f + 0.5f);
+                            h->HWResolution[0] / 72.0f + 0.5f);
   h->cupsHeight = (unsigned)((top - bottom) * h->cupsBorderlessScalingFactor *
-                        h->HWResolution[1] / 72.0f + 0.5f);
+                            h->HWResolution[1] / 72.0f + 0.5f);
 
   switch (h->cupsColorSpace)
   {
@@ -407,18 +408,18 @@ ppdRasterInterpretPPD(
        break;
 
     default :
-       /*
-        * Ensure that colorimetric colorspaces use at least 8 bits per
-       * component...
-       */
+        //
+        // Ensure that colorimetric colorspaces use at least 8 bits per
+       // component...
+
 
         if (h->cupsColorSpace >= CUPS_CSPACE_CIEXYZ &&
            h->cupsBitsPerColor < 8)
          h->cupsBitsPerColor = 8;
 
-       /*
-        * Figure out the number of bits per pixel...
-       */
+       //
+        // Figure out the number of bits per pixel...
+       //
 
        if (h->cupsColorOrder == CUPS_ORDER_CHUNKED)
        {
@@ -445,9 +446,9 @@ ppdRasterInterpretPPD(
           break;
        }
 
-       /*
-       * Fall through to CMYK code...
-       */
+       //
+       // Fall through to CMYK code...
+       //
 
     case CUPS_CSPACE_RGBA :
     case CUPS_CSPACE_RGBW :
@@ -496,23 +497,23 @@ ppdRasterInterpretPPD(
   return (status);
 }
 
-/*
- * 'ppdRasterMatchPageSize()' - Match PPD page size to header page size.
- */
+//
+// 'ppdRasterMatchPageSize()' - Match PPD page size to header page size.
+//
 
-int                                    /* O - 0 on success, -1 on failure */
+int                                    // O - 0 on success, -1 on failure
 ppdRasterMatchPPDSize(
-    cups_page_header2_t *header,       /* I - Page header to match */
-    ppd_file_t         *ppd,           /* I - PPD file */
-    double             margins[4],     /* O - Margins of media in points */
-    double             dimensions[2],  /* O - Width and Length of media in points */
-    int                *image_fit,     /* O - Imageable Area Fit */
-    int                *landscape)     /* O - Landscape / Portrait Fit */
+    cups_page_header2_t *header,       // I - Page header to match
+    ppd_file_t         *ppd,           // I - PPD file
+    double             margins[4],     // O - Margins of media in points
+    double             dimensions[2],  // O - Width and Length of media in points
+    int                *image_fit,     // O - Imageable Area Fit
+    int                *landscape)     // O - Landscape / Portrait Fit
 {
-  ppd_size_t   *size,                  /* Current size */
-               *size_matched = NULL;   /* Matched size */
-  int          i = 0;                  /* Loop variable */
-  char         pageSizeRequested[64];  /* Requested PageSize */
+  ppd_size_t   *size,                  // Current size
+               *size_matched = NULL;   // Matched size
+  int          i = 0;                  // Loop variable
+  char         pageSizeRequested[64];  // Requested PageSize
 
   if (!header)
   {
@@ -525,15 +526,16 @@ ppdRasterMatchPPDSize(
     return (-1);
   }
 
-  strncpy(pageSizeRequested, header->cupsPageSizeName, 64); /* Prefer user-selected page size. */
+  strncpy(pageSizeRequested, header->cupsPageSizeName, 64);
+                                       // Prefer user-selected page size.
   memset(dimensions, 0, sizeof(double)*2);
   memset(margins, 0, sizeof(double)*4);
   size_matched = NULL;
 
   for (i = ppd->num_sizes, size = ppd->sizes; i > 0; i --, size ++)
   {
-    /* Skip page sizes which conflict with settings of the other options */
-    /* Find size of document's page under the PPD page sizes */
+    // Skip page sizes which conflict with settings of the other options
+    // Find size of document's page under the PPD page sizes
     if (fabs(header->PageSize[1] - size->length) / size->length < 0.01 &&
        fabs(header->PageSize[0] - size->width) / size->width < 0.01 &&
        (size_matched == NULL || !strcasecmp(pageSizeRequested, size->name)))
@@ -545,26 +547,29 @@ ppdRasterMatchPPDSize(
   }
 
   if (size_matched == NULL)
-  /* Input page size does not fit any of the PPD's sizes, try to fit
-     the input page size into the imageable areas of the PPD's sizes */
-  for (i = ppd->num_sizes, size = ppd->sizes; i > 0; i --, size ++)
-  {
-    if (fabs(header->PageSize[1] - size->top + size->bottom) / size->length < 0.01 &&
-       fabs(header->PageSize[0] - size->right + size->left) / size->width < 0.01 &&
-       (size_matched == NULL || !strcasecmp(pageSizeRequested, size->name)))
+    // Input page size does not fit any of the PPD's sizes, try to fit
+    // the input page size into the imageable areas of the PPD's sizes
+    for (i = ppd->num_sizes, size = ppd->sizes; i > 0; i --, size ++)
     {
-      DEBUG_puts("Imageable area fit\n");
-      size_matched = size;
-      if (landscape) *landscape = 0;
-      if (image_fit) *image_fit = 1;
+      if (fabs(header->PageSize[1] -
+              size->top + size->bottom) / size->length < 0.01 &&
+         fabs(header->PageSize[0] -
+              size->right + size->left) / size->width < 0.01 &&
+         (size_matched == NULL || !strcasecmp(pageSizeRequested, size->name)))
+      {
+       DEBUG_puts("Imageable area fit\n");
+       size_matched = size;
+       if (landscape) *landscape = 0;
+       if (image_fit) *image_fit = 1;
+      }
     }
-  }
 
   if (size_matched)
   {
-    /*
-    * Standard size...
-    */
+    //
+    // Standard size...
+    //
+
     DEBUG_printf(("PPD matched size = %s", size_matched->name));
     size = size_matched;
     dimensions[0] = size->width;
@@ -577,10 +582,11 @@ ppdRasterMatchPPDSize(
   }
   else
   {
-    /*
-    * No matching portrait size; look for a matching size in
-    * landscape orientation...
-    */
+    //
+    // No matching portrait size; look for a matching size in
+    // landscape orientation...
+    //
+
     size_matched = 0;
     for (i = ppd->num_sizes, size = ppd->sizes; i > 0; i --, size ++)
     if (fabs(header->PageSize[0] - size->length) / size->length < 0.01 &&
@@ -593,27 +599,31 @@ ppdRasterMatchPPDSize(
     }
 
     if (size_matched == NULL)
-    /* Input page size does not fit any of the PPD's sizes, try to fit
-       the input page size into the imageable areas of the PPD's sizes */
-    for (i = ppd->num_sizes, size = ppd->sizes; i > 0; i --, size ++)
-    {
-      if (fabs(header->PageSize[0] - size->top + size->bottom) / size->length < 0.01 &&
-       fabs(header->PageSize[1] - size->right + size->left) / size->width < 0.01 &&
-       (size_matched == NULL || !strcasecmp(pageSizeRequested, size->name)))
+      // Input page size does not fit any of the PPD's sizes, try to fit
+      // the input page size into the imageable areas of the PPD's sizes
+      for (i = ppd->num_sizes, size = ppd->sizes; i > 0; i --, size ++)
       {
-       DEBUG_puts("Imageable area fit\n");
-       size_matched = size;
-       if (landscape) *landscape = 1;
-       if (image_fit) *image_fit = 1;
+       if (fabs(header->PageSize[0] -
+                size->top + size->bottom) / size->length < 0.01 &&
+           fabs(header->PageSize[1] -
+                size->right + size->left) / size->width < 0.01 &&
+           (size_matched == NULL ||
+            !strcasecmp(pageSizeRequested, size->name)))
+       {
+         DEBUG_puts("Imageable area fit\n");
+         size_matched = size;
+         if (landscape) *landscape = 1;
+         if (image_fit) *image_fit = 1;
+       }
       }
-    }
   }
 
   if (size_matched)
   {
-    /*
-     * Standard size in landscape orientation...
-     */
+    //
+    // Standard size in landscape orientation...
+    //
+
     size = size_matched;
     DEBUG_printf(("landscape size = %s", size->name));
     dimensions[0] = size->width;
@@ -626,43 +636,45 @@ ppdRasterMatchPPDSize(
   }
   else
   {
-    /*
-     * Custom size...
-     */
+    //
+    // Custom size...
+    //
+
     DEBUG_puts("size = Custom\n");
     for (i = 0; i < 2; i ++)
       dimensions[i] = header->PageSize[i];
     for (i = 0; i < 4; i ++)
       margins[i] = ppd->custom_margins[i];
-    snprintf(header->cupsPageSizeName, 64, "Custom.%dx%d", header->PageSize[0], header->PageSize[1]);
+    snprintf(header->cupsPageSizeName, 64, "Custom.%dx%d",
+            header->PageSize[0], header->PageSize[1]);
   }
 
   return 0;
 }
 
-/*
- * 'ppdRasterExecPS()' - Execute PostScript code to initialize a page header.
- */
+//
+// 'ppdRasterExecPS()' - Execute PostScript code to initialize a page header.
+//
 
-int                                    /* O - 0 on success, -1 on error */
+int                                    // O - 0 on success, -1 on error
 ppdRasterExecPS(
-    cups_page_header2_t *h,            /* O - Page header */
-    int                 *preferred_bits,/* O - Preferred bits per color */
-    const char          *code)         /* I - PS code to execute */
+    cups_page_header2_t *h,            // O - Page header
+    int                 *preferred_bits,// O - Preferred bits per color
+    const char          *code)         // I - PS code to execute
 {
-  int                  error = 0;      /* Error condition? */
-  _ppd_ps_stack_t      *st;            /* PostScript value stack */
-  _ppd_ps_obj_t        *obj;           /* Object from top of stack */
-  char                 *codecopy,      /* Copy of code */
-                       *codeptr;       /* Pointer into copy of code */
+  int                  error = 0;      // Error condition?
+  _ppd_ps_stack_t      *st;            // PostScript value stack
+  _ppd_ps_obj_t        *obj;                   // Object from top of stack
+  char                 *codecopy,      // Copy of code
+                       *codeptr;       // Pointer into copy of code
 
 
   DEBUG_printf(("ppdRasterExecPS(h=%p, preferred_bits=%p, code=\"%s\")\n",
                 h, preferred_bits, code));
 
- /*
-  * Copy the PostScript code and create a stack...
-  */
+  //
+  // Copy the PostScript code and create a stack...
+  //
 
   if ((codecopy = strdup(code)) == NULL)
   {
@@ -677,9 +689,9 @@ ppdRasterExecPS(
     return (-1);
   }
 
- /*
-  * Parse the PS string until we run out of data...
-  */
+  //
+  // Parse the PS string until we run out of data...
+  //
 
   codeptr = codecopy;
 
@@ -688,12 +700,12 @@ ppdRasterExecPS(
 #ifdef DEBUG
     DEBUG_printf(("ppdRasterExecPS: Stack (%d objects)", st->num_objs));
     ppd_DEBUG_object("ppdRasterExecPS", obj);
-#endif /* DEBUG */
+#endif // DEBUG
 
     switch (obj->type)
     {
       default :
-          /* Do nothing for regular values */
+          // Do nothing for regular values
          break;
 
       case PPD_PS_CLEARTOMARK :
@@ -705,7 +717,7 @@ ppdRasterExecPS(
 #ifdef DEBUG
           DEBUG_puts("1_ppdRasterExecPS:    dup");
          ppd_DEBUG_stack("ppdRasterExecPS", st);
-#endif /* DEBUG */
+#endif // DEBUG
           break;
 
       case PPD_PS_COPY :
@@ -717,7 +729,7 @@ ppdRasterExecPS(
 #ifdef DEBUG
             DEBUG_puts("ppdRasterExecPS: copy");
            ppd_DEBUG_stack("ppdRasterExecPS", st);
-#endif /* DEBUG */
+#endif // DEBUG
           }
           break;
 
@@ -728,7 +740,7 @@ ppdRasterExecPS(
 #ifdef DEBUG
           DEBUG_puts("ppdRasterExecPS: dup");
          ppd_DEBUG_stack("ppdRasterExecPS", st);
-#endif /* DEBUG */
+#endif // DEBUG
           break;
 
       case PPD_PS_INDEX :
@@ -740,7 +752,7 @@ ppdRasterExecPS(
 #ifdef DEBUG
             DEBUG_puts("ppdRasterExecPS: index");
            ppd_DEBUG_stack("ppdRasterExecPS", st);
-#endif /* DEBUG */
+#endif // DEBUG
           }
           break;
 
@@ -751,14 +763,14 @@ ppdRasterExecPS(
 #ifdef DEBUG
           DEBUG_puts("ppdRasterExecPS: pop");
          ppd_DEBUG_stack("ppdRasterExecPS", st);
-#endif /* DEBUG */
+#endif // DEBUG
           break;
 
       case PPD_PS_ROLL :
           ppd_pop_stack(st);
          if ((obj = ppd_pop_stack(st)) != NULL)
          {
-            int                c;              /* Count */
+            int                c;              // Count
 
 
             c = (int)obj->value.number;
@@ -770,7 +782,7 @@ ppdRasterExecPS(
 #ifdef DEBUG
               DEBUG_puts("ppdRasterExecPS: roll");
              ppd_DEBUG_stack("ppdRasterExecPS", st);
-#endif /* DEBUG */
+#endif // DEBUG
             }
          }
           break;
@@ -782,7 +794,7 @@ ppdRasterExecPS(
 #ifdef DEBUG
           DEBUG_puts("ppdRasterExecPS: setpagedevice");
          ppd_DEBUG_stack("ppdRasterExecPS", st);
-#endif /* DEBUG */
+#endif // DEBUG
           break;
 
       case PPD_PS_START_PROC :
@@ -802,9 +814,9 @@ ppdRasterExecPS(
       break;
   }
 
- /*
-  * Cleanup...
-  */
+  //
+  // Cleanup...
+  //
 
   free(codecopy);
 
@@ -815,7 +827,7 @@ ppdRasterExecPS(
 #ifdef DEBUG
     DEBUG_puts("ppdRasterExecPS: Stack not empty");
     ppd_DEBUG_stack("ppdRasterExecPS", st);
-#endif /* DEBUG */
+#endif // DEBUG
 
     ppd_delete_stack(st);
 
@@ -824,22 +836,22 @@ ppdRasterExecPS(
 
   ppd_delete_stack(st);
 
- /*
-  * Return success...
-  */
+  //
+  // Return success...
+  //
 
   return (0);
 }
 
 
-/*
- * 'ppd_cleartomark_stack()' - Clear to the last mark ([) on the stack.
- */
+//
+// 'ppd_cleartomark_stack()' - Clear to the last mark ([) on the stack.
+//
 
-static int                             /* O - 0 on success, -1 on error */
-ppd_cleartomark_stack(_ppd_ps_stack_t *st)     /* I - Stack */
+static int                                     // O - 0 on success, -1 on error
+ppd_cleartomark_stack(_ppd_ps_stack_t *st)     // I - Stack
 {
-  _ppd_ps_obj_t        *obj;           /* Current object on stack */
+  _ppd_ps_obj_t        *obj;           // Current object on stack
 
 
   while ((obj = ppd_pop_stack(st)) != NULL)
@@ -850,15 +862,15 @@ ppd_cleartomark_stack(_ppd_ps_stack_t *st)        /* I - Stack */
 }
 
 
-/*
- * 'ppd_copy_stack()' - Copy the top N stack objects.
- */
+//
+// 'ppd_copy_stack()' - Copy the top N stack objects.
+//
 
-static int                             /* O - 0 on success, -1 on error */
-ppd_copy_stack(_ppd_ps_stack_t *st,    /* I - Stack */
-           int              c)         /* I - Number of objects to copy */
+static int                             // O - 0 on success, -1 on error
+ppd_copy_stack(_ppd_ps_stack_t *st,    // I - Stack
+              int              c)      // I - Number of objects to copy
 {
-  int  n;                              /* Index */
+  int  n;                              // Index
 
 
   if (c < 0)
@@ -882,24 +894,24 @@ ppd_copy_stack(_ppd_ps_stack_t *st,       /* I - Stack */
 }
 
 
-/*
- * 'ppd_delete_stack()' - Free memory used by a stack.
- */
+//
+// 'ppd_delete_stack()' - Free memory used by a stack.
+//
 
 static void
-ppd_delete_stack(_ppd_ps_stack_t *st)  /* I - Stack */
+ppd_delete_stack(_ppd_ps_stack_t *st)  // I - Stack
 {
   free(st->objs);
   free(st);
 }
 
 
-/*
- * 'ppd_error_object()' - Add an object's value to the current error message.
- */
+//
+// 'ppd_error_object()' - Add an object's value to the current error message.
+//
 
 static void
-ppd_error_object(_ppd_ps_obj_t *obj)   /* I - Object to add */
+ppd_error_object(_ppd_ps_obj_t *obj)   // I - Object to add
 {
   switch (obj->type)
   {
@@ -989,16 +1001,16 @@ ppd_error_object(_ppd_ps_obj_t *obj)     /* I - Object to add */
 }
 
 
-/*
- * 'ppd_error_stack()' - Add a stack to the current error message...
- */
+//
+// 'ppd_error_stack()' - Add a stack to the current error message...
+//
 
 static void
-ppd_error_stack(_ppd_ps_stack_t *st,   /* I - Stack */
-            const char       *title)   /* I - Title string */
+ppd_error_stack(_ppd_ps_stack_t *st,   // I - Stack
+            const char       *title)   // I - Title string
 {
-  int                  c;              /* Looping var */
-  _ppd_ps_obj_t        *obj;           /* Current object on stack */
+  int                  c;              // Looping var
+  _ppd_ps_obj_t        *obj;           // Current object on stack
 
 
   _ppdRasterAddError("%s", title);
@@ -1010,13 +1022,13 @@ ppd_error_stack(_ppd_ps_stack_t *st,    /* I - Stack */
 }
 
 
-/*
- * 'ppd_index_stack()' - Copy the Nth value on the stack.
- */
+//
+// 'ppd_index_stack()' - Copy the Nth value on the stack.
+//
 
-static _ppd_ps_obj_t   *               /* O - New object */
-ppd_index_stack(_ppd_ps_stack_t *st,   /* I - Stack */
-            int              n)                /* I - Object index */
+static _ppd_ps_obj_t   *               // O - New object
+ppd_index_stack(_ppd_ps_stack_t *st,   // I - Stack
+            int              n)                // I - Object index
 {
   if (n < 0 || (n = st->num_objs - n - 1) < 0)
     return (NULL);
@@ -1025,14 +1037,14 @@ ppd_index_stack(_ppd_ps_stack_t *st,    /* I - Stack */
 }
 
 
-/*
- * 'ppd_new_stack()' - Create a new stack.
- */
+//
+// 'ppd_new_stack()' - Create a new stack.
+//
 
-static _ppd_ps_stack_t *               /* O - New stack */
+static _ppd_ps_stack_t *               // O - New stack
 ppd_new_stack(void)
 {
-  _ppd_ps_stack_t      *st;            /* New stack */
+  _ppd_ps_stack_t      *st;            // New stack
 
 
   if ((st = calloc(1, sizeof(_ppd_ps_stack_t))) == NULL)
@@ -1050,12 +1062,12 @@ ppd_new_stack(void)
 }
 
 
-/*
- * 'pop_stock()' - Pop the top object off the stack.
- */
+//
+// 'pop_stock()' - Pop the top object off the stack.
+//
 
-static _ppd_ps_obj_t   *               /* O - Object */
-ppd_pop_stack(_ppd_ps_stack_t *st)             /* I - Stack */
+static _ppd_ps_obj_t   *               // O - Object
+ppd_pop_stack(_ppd_ps_stack_t *st)     // I - Stack
 {
   if (st->num_objs > 0)
   {
@@ -1068,21 +1080,19 @@ ppd_pop_stack(_ppd_ps_stack_t *st)              /* I - Stack */
 }
 
 
-/*
- * 'ppd_push_stack()' - Push an object on the stack.
- */
+//
+// 'ppd_push_stack()' - Push an object on the stack.
+//
 
-static _ppd_ps_obj_t   *               /* O - New object */
-ppd_push_stack(_ppd_ps_stack_t *st,    /* I - Stack */
-           _ppd_ps_obj_t   *obj)       /* I - Object */
+static _ppd_ps_obj_t   *               // O - New object
+ppd_push_stack(_ppd_ps_stack_t *st,    // I - Stack
+           _ppd_ps_obj_t   *obj)       // I - Object
 {
-  _ppd_ps_obj_t        *temp;          /* New object */
+  _ppd_ps_obj_t        *temp;          // New object
 
 
   if (st->num_objs >= st->alloc_objs)
   {
-
-
     st->alloc_objs += 32;
 
     if ((temp = realloc(st->objs, (size_t)st->alloc_objs *
@@ -1102,24 +1112,24 @@ ppd_push_stack(_ppd_ps_stack_t *st,     /* I - Stack */
 }
 
 
-/*
- * 'ppd_roll_stack()' - Rotate stack objects.
- */
+//
+// 'ppd_roll_stack()' - Rotate stack objects.
+//
 
-static int                             /* O - 0 on success, -1 on error */
-ppd_roll_stack(_ppd_ps_stack_t *st,    /* I - Stack */
-          int              c,          /* I - Number of objects */
-           int              s)         /* I - Amount to shift */
+static int                             // O - 0 on success, -1 on error
+ppd_roll_stack(_ppd_ps_stack_t *st,    // I - Stack
+          int              c,          // I - Number of objects
+           int              s)         // I - Amount to shift
 {
-  _ppd_ps_obj_t        *temp;          /* Temporary array of objects */
-  int                  n;              /* Index into array */
+  _ppd_ps_obj_t                *temp;          // Temporary array of objects
+  int                  n;              // Index into array
 
 
   DEBUG_printf(("3roll_stack(st=%p, s=%d, c=%d)", st, s, c));
 
- /*
-  * Range check input...
-  */
+  //
+  // Range check input...
+  //
 
   if (c < 0)
     return (-1);
@@ -1134,15 +1144,15 @@ ppd_roll_stack(_ppd_ps_stack_t *st,     /* I - Stack */
   if (s == 0)
     return (0);
 
- /*
-  * Copy N objects and move things around...
-  */
+  //
+  // Copy N objects and move things around...
+  //
 
   if (s < 0)
   {
-   /*
-    * Shift down...
-    */
+    //
+    // Shift down...
+    //
 
     s = -s;
 
@@ -1150,20 +1160,22 @@ ppd_roll_stack(_ppd_ps_stack_t *st,     /* I - Stack */
       return (-1);
 
     memcpy(temp, st->objs + n, (size_t)s * sizeof(_ppd_ps_obj_t));
-    memmove(st->objs + n, st->objs + n + s, (size_t)(c - s) * sizeof(_ppd_ps_obj_t));
+    memmove(st->objs + n, st->objs + n + s,
+           (size_t)(c - s) * sizeof(_ppd_ps_obj_t));
     memcpy(st->objs + n + c - s, temp, (size_t)s * sizeof(_ppd_ps_obj_t));
   }
   else
   {
-   /*
-    * Shift up...
-    */
+    //
+    // Shift up...
+    //
 
     if ((temp = calloc((size_t)s, sizeof(_ppd_ps_obj_t))) == NULL)
       return (-1);
 
     memcpy(temp, st->objs + n + c - s, (size_t)s * sizeof(_ppd_ps_obj_t));
-    memmove(st->objs + n + s, st->objs + n, (size_t)(c - s) * sizeof(_ppd_ps_obj_t));
+    memmove(st->objs + n + s, st->objs + n,
+           (size_t)(c - s) * sizeof(_ppd_ps_obj_t));
     memcpy(st->objs + n, temp, (size_t)s * sizeof(_ppd_ps_obj_t));
   }
 
@@ -1173,33 +1185,33 @@ ppd_roll_stack(_ppd_ps_stack_t *st,     /* I - Stack */
 }
 
 
-/*
- * 'ppd_scan_ps()' - Scan a string for the next PS object.
- */
+//
+// 'ppd_scan_ps()' - Scan a string for the next PS object.
+//
 
-static _ppd_ps_obj_t   *               /* O  - New object or NULL on EOF */
-ppd_scan_ps(_ppd_ps_stack_t *st,               /* I  - Stack */
-        char             **ptr)                /* IO - String pointer */
+static _ppd_ps_obj_t *                 // O  - New object or NULL on EOF
+ppd_scan_ps(_ppd_ps_stack_t  *st,      // I  - Stack
+           char             **ptr)     // IO - String pointer
 {
-  _ppd_ps_obj_t        obj;            /* Current object */
-  char                 *start,         /* Start of object */
-                       *cur,           /* Current position */
-                       *valptr,        /* Pointer into value string */
-                       *valend;        /* End of value string */
-  int                  parens;         /* Parenthesis nesting level */
+  _ppd_ps_obj_t                obj;            // Current object
+  char                 *start,         // Start of object
+                       *cur,           // Current position
+                       *valptr,        // Pointer into value string
+                       *valend;        // End of value string
+  int                  parens;         // Parenthesis nesting level
 
 
- /*
-  * Skip leading whitespace...
-  */
+  //
+  // Skip leading whitespace...
+  //
 
   for (cur = *ptr; *cur; cur ++)
   {
     if (*cur == '%')
     {
-     /*
-      * Comment, skip to end of line...
-      */
+      //
+      // Comment, skip to end of line...
+      //
 
       for (cur ++; *cur && *cur != '\n' && *cur != '\r'; cur ++);
 
@@ -1217,15 +1229,15 @@ ppd_scan_ps(_ppd_ps_stack_t *st,                /* I  - Stack */
     return (NULL);
   }
 
- /*
-  * See what we have...
-  */
+  //
+  // See what we have...
+  //
 
   memset(&obj, 0, sizeof(obj));
 
   switch (*cur)
   {
-    case '(' :                         /* (string) */
+    case '(' :                         // (string)
         obj.type = PPD_PS_STRING;
        start    = cur;
 
@@ -1251,9 +1263,9 @@ ppd_scan_ps(_ppd_ps_stack_t *st,          /* I  - Stack */
 
          if (*cur == '\\')
          {
-          /*
-           * Decode escaped character...
-           */
+           //
+           // Decode escaped character...
+           //
 
            cur ++;
 
@@ -1307,17 +1319,17 @@ ppd_scan_ps(_ppd_ps_stack_t *st,                /* I  - Stack */
        cur ++;
         break;
 
-    case '[' :                         /* Start array */
+    case '[' :                         // Start array
         obj.type = PPD_PS_START_ARRAY;
        cur ++;
         break;
 
-    case ']' :                         /* End array */
+    case ']' :                         // End array
         obj.type = PPD_PS_END_ARRAY;
        cur ++;
         break;
 
-    case '<' :                         /* Start dictionary or hex string */
+    case '<' :                         // Start dictionary or hex string
         if (cur[1] == '<')
        {
          obj.type = PPD_PS_START_DICT;
@@ -1333,9 +1345,7 @@ ppd_scan_ps(_ppd_ps_stack_t *st,          /* I  - Stack */
                *cur;
               cur ++)
          {
-           int ch;                     /* Current character */
-
-
+           int ch;                     // Current character
 
             if (*cur == '>')
              break;
@@ -1373,7 +1383,7 @@ ppd_scan_ps(_ppd_ps_stack_t *st,          /* I  - Stack */
        }
         break;
 
-    case '>' :                         /* End dictionary? */
+    case '>' :                         // End dictionary?
         if (cur[1] == '>')
        {
          obj.type = PPD_PS_END_DICT;
@@ -1388,17 +1398,17 @@ ppd_scan_ps(_ppd_ps_stack_t *st,                /* I  - Stack */
        }
         break;
 
-    case '{' :                         /* Start procedure */
+    case '{' :                         // Start procedure
         obj.type = PPD_PS_START_PROC;
        cur ++;
         break;
 
-    case '}' :                         /* End procedure */
+    case '}' :                         // End procedure
         obj.type = PPD_PS_END_PROC;
        cur ++;
         break;
 
-    case '-' :                         /* Possible number */
+    case '-' :                         // Possible number
     case '+' :
         if (!isdigit(cur[1] & 255) && cur[1] != '.')
        {
@@ -1409,7 +1419,7 @@ ppd_scan_ps(_ppd_ps_stack_t *st,          /* I  - Stack */
          break;
        }
 
-    case '0' :                         /* Number */
+    case '0' :                         // Number
     case '1' :
     case '2' :
     case '3' :
@@ -1429,18 +1439,18 @@ ppd_scan_ps(_ppd_ps_stack_t *st,                /* I  - Stack */
 
         if (*cur == '#')
        {
-        /*
-         * Integer with radix...
-         */
+         //
+         // Integer with radix...
+         //
 
           obj.value.number = strtol(cur + 1, &cur, atoi(start));
          break;
        }
        else if (strchr(".Ee()<>[]{}/%", *cur) || isspace(*cur & 255))
        {
-        /*
-         * Integer or real number...
-         */
+         //
+         // Integer or real number...
+         //
 
          obj.value.number = _ppdStrScand(start, &cur, localeconv());
           break;
@@ -1448,7 +1458,7 @@ ppd_scan_ps(_ppd_ps_stack_t *st,          /* I  - Stack */
        else
          cur = start;
 
-    default :                          /* Operator/variable name */
+    default :                          // Operator/variable name
         start = cur;
 
        if (*cur == '/')
@@ -1512,9 +1522,9 @@ ppd_scan_ps(_ppd_ps_stack_t *st,          /* I  - Stack */
        break;
   }
 
- /*
-  * Save the current position in the string and return the new object...
-  */
+  //
+  // Save the current position in the string and return the new object...
+  //
 
   *ptr = cur;
 
@@ -1522,25 +1532,25 @@ ppd_scan_ps(_ppd_ps_stack_t *st,                /* I  - Stack */
 }
 
 
-/*
- * 'ppd_setpagedevice()' - Simulate the PostScript setpagedevice operator.
- */
+//
+// 'ppd_setpagedevice()' - Simulate the PostScript setpagedevice operator.
+//
 
-static int                             /* O - 0 on success, -1 on error */
+static int                             // O - 0 on success, -1 on error
 ppd_setpagedevice(
-    _ppd_ps_stack_t    *st,            /* I - Stack */
-    cups_page_header2_t *h,            /* O - Page header */
-    int                 *preferred_bits)/* O - Preferred bits per color */
+    _ppd_ps_stack_t     *st,           // I - Stack
+    cups_page_header2_t *h,            // O - Page header
+    int                 *preferred_bits)// O - Preferred bits per color
 {
-  int                  i;              /* Index into array */
-  _ppd_ps_obj_t        *obj,           /* Current object */
-                       *end;           /* End of dictionary */
-  const char           *name;          /* Attribute name */
+  int                  i;              // Index into array
+  _ppd_ps_obj_t                *obj,           // Current object
+                       *end;           // End of dictionary
+  const char           *name;          // Attribute name
 
 
- /*
-  * Make sure we have a dictionary on the stack...
-  */
+  //
+  // Make sure we have a dictionary on the stack...
+  //
 
   if (st->num_objs == 0)
     return (-1);
@@ -1563,23 +1573,23 @@ ppd_setpagedevice(
   if (obj < st->objs)
     return (-1);
 
- /*
-  * Found the start of the dictionary, empty the stack to this point...
-  */
+  //
+  // Found the start of the dictionary, empty the stack to this point...
+  //
 
   st->num_objs = (int)(obj - st->objs);
 
- /*
-  * Now pull /name and value pairs from the dictionary...
-  */
+  //
+  // Now pull /name and value pairs from the dictionary...
+  //
 
   DEBUG_puts("3ppd_setpagedevice: Dictionary:");
 
   for (obj ++; obj < end; obj ++)
   {
-   /*
-    * Grab the name...
-    */
+    //
+    // Grab the name...
+    //
 
     if (obj->type != PPD_PS_NAME)
       return (-1);
@@ -1590,11 +1600,11 @@ ppd_setpagedevice(
 #ifdef DEBUG
     DEBUG_printf(("4ppd_setpagedevice: /%s ", name));
     ppd_DEBUG_object("setpagedevice", obj);
-#endif /* DEBUG */
+#endif // DEBUG
 
-   /*
-    * Then grab the value...
-    */
+    //
+    // Then grab the value...
+    //
 
     if (!strcmp(name, "MediaClass") && obj->type == PPD_PS_STRING)
       strlcpy(h->MediaClass, obj->value.string, sizeof(h->MediaClass));
@@ -1637,13 +1647,13 @@ ppd_setpagedevice(
     else if ((!strcmp(name, "cupsMediaPosition") ||
               !strcmp(name, "MediaPosition")) && obj->type == PPD_PS_NUMBER)
     {
-     /*
-      * cupsMediaPosition is supported for backwards compatibility only.
-      * We added it back in the Ghostscript 5.50 days to work around a
-      * bug in Ghostscript WRT handling of MediaPosition and setpagedevice.
-      *
-      * All new development should set MediaPosition...
-      */
+      //
+      // cupsMediaPosition is supported for backwards compatibility only.
+      // We added it back in the Ghostscript 5.50 days to work around a
+      // bug in Ghostscript WRT handling of MediaPosition and setpagedevice.
+      //
+      // All new development should set MediaPosition...
+      //
 
       h->MediaPosition = (unsigned)obj->value.number;
     }
@@ -1735,11 +1745,12 @@ ppd_setpagedevice(
               sizeof(h->cupsRenderingIntent));
     else
     {
-     /*
-      * Ignore unknown name+value...
-      */
+      //
+      // Ignore unknown name+value...
+      //
 
-      DEBUG_printf(("4ppd_setpagedevice: Unknown name (\"%s\") or value...\n", name));
+      DEBUG_printf(("4ppd_setpagedevice: Unknown name (\"%s\") or value...\n",
+                   name));
 
       while (obj[1].type != PPD_PS_NAME && obj < end)
         obj ++;
@@ -1751,13 +1762,13 @@ ppd_setpagedevice(
 
 
 #ifdef DEBUG
-/*
- * 'ppd_DEBUG_object()' - Print an object's value...
- */
+//
+// 'ppd_DEBUG_object()' - Print an object's value...
+//
 
 static void
-ppd_DEBUG_object(const char *prefix,   /* I - Prefix string */
-             _ppd_ps_obj_t *obj)       /* I - Object to print */
+ppd_DEBUG_object(const char *prefix,   // I - Prefix string
+                _ppd_ps_obj_t *obj)    // I - Object to print
 {
   switch (obj->type)
   {
@@ -1847,19 +1858,19 @@ ppd_DEBUG_object(const char *prefix,    /* I - Prefix string */
 }
 
 
-/*
- * 'ppd_DEBUG_stack()' - Print a stack...
- */
+//
+// 'ppd_DEBUG_stack()' - Print a stack...
+//
 
 static void
-ppd_DEBUG_stack(const char       *prefix,      /* I - Prefix string */
-            _ppd_ps_stack_t *st)       /* I - Stack */
+ppd_DEBUG_stack(const char       *prefix,      // I - Prefix string
+               _ppd_ps_stack_t *st)            // I - Stack
 {
-  int                  c;              /* Looping var */
-  _ppd_ps_obj_t        *obj;           /* Current object on stack */
+  int          c;              // Looping var
+  _ppd_ps_obj_t        *obj;           // Current object on stack
 
 
   for (obj = st->objs, c = st->num_objs; c > 0; c --, obj ++)
     ppd_DEBUG_object(prefix, obj);
 }
-#endif /* DEBUG */
+#endif // DEBUG
index da4e32bd690e15f9bf8d28bafcc0469de1871bd0..1ee279ad61954e46c3cb5e90d4b289364a7a1bb1 100644 (file)
@@ -1,39 +1,39 @@
-/*
- * Private image library definitions for libppd.
- *
- * Copyright © 2007-2019 by Apple Inc.
- * Copyright © 1993-2006 by Easy Software Products.
- *
- * Licensed under Apache License v2.0.  See the file "LICENSE" for more
- * information.
- */
+//
+// Private image library definitions for libppd.
+//
+// Copyright © 2007-2019 by Apple Inc.
+// Copyright © 1993-2006 by Easy Software Products.
+//
+// Licensed under Apache License v2.0.  See the file "LICENSE" for more
+// information.
+
 
 #ifndef _PPD_RASTER_PRIVATE_H_
 #  define _PPD_RASTER_PRIVATE_H_
 
-/*
- * Include necessary headers...
- */
+//
+// Include necessary headers...
+//
 
 #  include <cups/raster.h>
 #  include "debug-private.h"
 #  include "string-private.h"
 #  ifdef _WIN32
 #    include <io.h>
-#    include <winsock2.h>              /* for htonl() definition */
+#    include <winsock2.h>              // for htonl() definition
 #  else
 #    include <unistd.h>
 #    include <fcntl.h>
-#  endif /* _WIN32 */
+#  endif // _WIN32
 
 #  ifdef __cplusplus
 extern "C" {
-#  endif /* __cplusplus */
+#  endif // __cplusplus
 
 
-/*
- * Prototypes...
- */
+//
+// Prototypes...
+//
 
 extern void            _ppdRasterAddError(const char *f, ...);
 extern void            _ppdRasterClearError(void);
@@ -41,6 +41,6 @@ extern const char     *_ppdRasterErrorString(void);
 
 #  ifdef __cplusplus
 }
-#  endif /* __cplusplus */
+#  endif // __cplusplus
 
-#endif /* !_PPD_RASTER_PRIVATE_H_ */
+#endif // !_PPD_RASTER_PRIVATE_H_
index fea2ffe190ea35b60954dd764d45d7b0e4c1db39..1d6f5f041edf1d8232c6bef09e23d00a025cc62e 100644 (file)
@@ -1,6 +1,17 @@
-/*
- * Include necessary headers...
- */
+//
+// Raster file to PostScript filter function for libppd.
+//
+// Copyright © 2020 by Till Kamppeter
+// Copyright © 2007-2018 by Apple Inc.
+// Copyright © 1993-2007 by Easy Software Products.
+//
+// Licensed under Apache License v2.0.  See the file "LICENSE" for more
+// information.
+//
+
+//
+// Include necessary headers...
+//
 
 #include <cupsfilters/colormanager.h>
 #include <cupsfilters/filter.h>
 #include "debug-internal.h"
 #include <zlib.h>
 
-/*
- * Types...
- */
-typedef struct rastertops_doc_s {         /**** Document information ****/
-  cups_file_t  *inputfp;                 /* Temporary file, if any */
-  FILE         *outputfp;                /* Temporary file, if any */
-  cf_logfunc_t logfunc;               /* Logging function, NULL for no
-                                            logging */
-  void          *logdata;                 /* User data for logging function, can
-                                            be NULL */
-  cf_filter_iscanceledfunc_t iscanceledfunc; /* Function returning 1 when
-                                            job is canceled, NULL for not
-                                            supporting stop on cancel */
-  void *iscanceleddata;                   /* User data for is-canceled
-                                            function, can be NULL */
+//
+// Types...
+//
+
+typedef struct rastertops_doc_s           // **** Document information ****
+{
+  cups_file_t  *inputfp;                 // Temporary file, if any
+  FILE         *outputfp;                // Temporary file, if any
+  cf_logfunc_t logfunc;                          // Logging function, NULL for no
+                                         // logging
+  void          *logdata;                 // User data for logging function, can
+                                         // be NULL
+  cf_filter_iscanceledfunc_t iscanceledfunc; // Function returning 1 when
+                                         // job is canceled, NULL for not
+                                         // supporting stop on cancel
+  void *iscanceleddata;                   // User data for is-canceled
+                                         // function, can be NULL
 } rastertops_doc_t;
 
 
-/*
- * 'write_prolog()' - Writing the PostScript prolog for the file
- */
+//
+// 'write_prolog()' - Writing the PostScript prolog for the file
+//
 
 static void
-write_prolog(int          width,  /* I - width of the image in points */
-            int           height, /* I - height of the image in points */
-            rastertops_doc_t *doc) /* I - Document information */
+write_prolog(int          width,  // I - width of the image in points
+            int           height, // I - height of the image in points
+            rastertops_doc_t *doc) // I - Document information
 {
-  /* Document header... */
+  // Document header...
   fprintf(doc->outputfp, "%%!PS-Adobe-3.0\n");
   fprintf(doc->outputfp, "%%%%BoundingBox: %d %d %d %d\n", 0, 0, width, height);
   fprintf(doc->outputfp, "%%%%Creator: cups-filters\n");
@@ -54,15 +67,16 @@ write_prolog(int       width,  /* I - width of the image in points */
   fprintf(doc->outputfp, "%%%%EndProlog\n");
 }
 
-/*
- * 'write_start_page()' - Write the basic page setup
- */
+
+//
+// 'write_start_page()' - Write the basic page setup
+//
 
 static void
-write_start_page(int  page,   /* I - Page to write */
-              int  width,  /* I - Page width in points */
-               int  length, /* I - Page length in points */
-               rastertops_doc_t *doc) /* I - Document information */
+write_start_page(int  page,   // I - Page to write
+                int  width,  // I - Page width in points
+                int  length, // I - Page length in points
+                rastertops_doc_t *doc) // I - Document information
 {
   if (doc->logfunc) doc->logfunc(doc->logdata, CF_LOGLEVEL_CONTROL,
                                 "PAGE: %d %d", page, 1);
@@ -73,61 +87,63 @@ write_start_page(int  page,   /* I - Page to write */
   fprintf(doc->outputfp, "%%%%EndPageSetup\n");
 }
 
-/*
- * 'find_bits()' - Finding the number of bits per color
- */
 
-static int                    /* O - Exit status */
-find_bits(cups_cspace_t mode, /* I - Color space of data */
-         int           bpc)  /* I - Original bits per color of data */
+//
+// 'find_bits()' - Finding the number of bits per color
+//
+
+static int                    // O - Exit status
+find_bits(cups_cspace_t mode, // I - Color space of data
+         int           bpc)  // I - Original bits per color of data
 {
   if (bpc == 1 &&
       (mode == CUPS_CSPACE_RGB ||
        mode == CUPS_CSPACE_ADOBERGB ||
        mode == CUPS_CSPACE_SRGB ||
        mode == CUPS_CSPACE_CMY))
-    return 8;
+    return (8);
 
   if (bpc == 16)
-    return 8;
+    return (8);
 
-  return bpc;
+  return (bpc);
 }
 
-/*
- * 'write_image()' - Write the information regarding the image
- */
+
+//
+// 'write_image()' - Write the information regarding the image
+//
 
 static void
-write_image(int           pagewidth,  /* I - width of page in points */
-          int           pageheight, /* I - height of page in points */
-          int           bpc,        /* I - bits per color */
-          int           pixwidth,   /* I - width of image in pixels */
-          int           pixheight,  /* I - height of image in pixels */
-          cups_cspace_t mode,       /* I - color model of image */
-     rastertops_doc_t *doc) /* I - Document information */
+write_image(int           pagewidth,  // I - width of page in points
+           int           pageheight, // I - height of page in points
+           int           bpc,        // I - bits per color
+           int           pixwidth,   // I - width of image in pixels
+           int           pixheight,  // I - height of image in pixels
+           cups_cspace_t mode,       // I - color model of image
+           rastertops_doc_t *doc)    // I - Document information
 {
   fprintf(doc->outputfp, "gsave\n");
 
   switch (mode)
   {
-  case CUPS_CSPACE_RGB:
-  case CUPS_CSPACE_CMY:
-  case CUPS_CSPACE_SRGB:
-  case CUPS_CSPACE_ADOBERGB:
-    fprintf(doc->outputfp, "/DeviceRGB setcolorspace\n");
-    break;
-
-  case CUPS_CSPACE_CMYK:
-    fprintf(doc->outputfp, "/DeviceCMYK setcolorspace\n");
-    break;
-
-  default:
-  case CUPS_CSPACE_K:
-  case CUPS_CSPACE_W:
-  case CUPS_CSPACE_SW:
-    fprintf(doc->outputfp, "/DeviceGray setcolorspace\n");
-    break;
+    case CUPS_CSPACE_RGB:
+    case CUPS_CSPACE_CMY:
+    case CUPS_CSPACE_SRGB:
+    case CUPS_CSPACE_ADOBERGB:
+        fprintf(doc->outputfp, "/DeviceRGB setcolorspace\n");
+       break;
+
+    case CUPS_CSPACE_CMYK:
+        fprintf(doc->outputfp, "/DeviceCMYK setcolorspace\n");
+       break;
+
+    default:
+    case CUPS_CSPACE_K:
+    case CUPS_CSPACE_W:
+    case CUPS_CSPACE_SW:
+        fprintf(doc->outputfp, "/DeviceGray setcolorspace\n");
+       break;
   }
 
   if (bpc == 16)
@@ -141,52 +157,53 @@ write_image(int           pagewidth,  /* I - width of page in points */
 
   switch (mode)
   {
-  case CUPS_CSPACE_RGB:
-  case CUPS_CSPACE_CMY:
-  case CUPS_CSPACE_SRGB:
-  case CUPS_CSPACE_ADOBERGB:
-    fprintf(doc->outputfp, "/Decode [0 1 0 1 0 1]\n");
-    break;
+    case CUPS_CSPACE_RGB:
+    case CUPS_CSPACE_CMY:
+    case CUPS_CSPACE_SRGB:
+    case CUPS_CSPACE_ADOBERGB:
+        fprintf(doc->outputfp, "/Decode [0 1 0 1 0 1]\n");
+       break;
        
-  case CUPS_CSPACE_CMYK:
-    fprintf(doc->outputfp, "/Decode [0 1 0 1 0 1 0 1]\n");
-    break;
+    case CUPS_CSPACE_CMYK:
+        fprintf(doc->outputfp, "/Decode [0 1 0 1 0 1 0 1]\n");
+       break;
   
-  case CUPS_CSPACE_SW:
-       fprintf(doc->outputfp, "/Decode [0 1]\n");
+    case CUPS_CSPACE_SW:
+        fprintf(doc->outputfp, "/Decode [0 1]\n");
        break;
 
-  default:
-  case CUPS_CSPACE_K:
-  case CUPS_CSPACE_W:
-    fprintf(doc->outputfp, "/Decode [1 0]\n");
-    break;
+    default:
+    case CUPS_CSPACE_K:
+    case CUPS_CSPACE_W:
+        fprintf(doc->outputfp, "/Decode [1 0]\n");
+       break;
   }     
        
-  if(bpc==16)
+  if (bpc == 16)
     fprintf(doc->outputfp,
            "/DataSource {3 string 0 1 2 {1 index exch Input read {pop}"
-          "if Input read pop put } for} bind\n");
+           "if Input read pop put } for} bind\n");
   else
     fprintf(doc->outputfp, "/DataSource currentfile /FlateDecode filter\n");
        
   fprintf(doc->outputfp, "/ImageMatrix [%d 0 0 %d 0 %d]\n", pixwidth,
-         -1*pixheight, pixheight);
+         -1 * pixheight, pixheight);
   fprintf(doc->outputfp, ">> image\n");
 }
 
-/*
- * 'convert_pixels()'- Convert 1 bpc to 8 bpc
- */
+
+//
+// 'convert_pixels()'- Convert 1 bpc to 8 bpc
+//
 
 static void
-convert_pixels(unsigned char *pixdata,      /* I - Original pixel data */
-              unsigned char *convertedpix, /* I - Buffer for converted data */
-              int           width)         /* I - Width of data */
+convert_pixels(unsigned char *pixdata,      // I - Original pixel data
+              unsigned char *convertedpix, // I - Buffer for converted data
+              int           width)         // I - Width of data
 {
-  int          j, k = 0; /* Variables for iteration */
-  unsigned int  mask;    /* Variable for per byte iteration */
-  unsigned char temp;    /* temporary character */
+  int          j, k = 0; // Variables for iteration
+  unsigned int  mask;    // Variable for per byte iteration
+  unsigned char temp;    // temporary character
 
   for(j = 0; j < width; ++j)
   {
@@ -205,48 +222,50 @@ convert_pixels(unsigned char *pixdata,      /* I - Original pixel data */
   }
 }
 
-/*
- * 'write_flate()' - Write the image data in flate encoded format
- */
 
-static int                              /* O - Error value */
-write_flate(cups_raster_t *ras,                /* I - Image data */
-           cups_page_header2_t header, /* I - Bytes Per Line */
-      rastertops_doc_t *doc) /* I - Document information */
+//
+// 'write_flate()' - Write the image data in flate encoded format
+//
+
+static int                              // O - Error value
+write_flate(cups_raster_t *ras,                // I - Image data
+           cups_page_header2_t header, // I - Bytes Per Line
+           rastertops_doc_t *doc)      // I - Document information
 {
-  int            ret,                              /* Return value of this
-                                                     function */
-                 flush,                            /* Check the end of image
-                                                     data */
-                 curr_line=1,                      /* Maitining the working
-                                                     line of pixels */
+  int            ret,                              // Return value of this
+                                                  // function
+                 flush,                            // Check the end of image
+                                                  // data
+                 curr_line=1,                      // Maitining the working
+                                                  // line of pixels
                  alloc,
                  flag = 0;
-  unsigned       have;                             /* Bytes available in
-                                                     output buffer */
-  z_stream       strm;                             /* Structure required
-                                                     by deflate */
+  unsigned       have;                             // Bytes available in
+                                                  // output buffer
+  z_stream       strm;                             // Structure required
+                                                  // by deflate
   unsigned char  *pixdata,
                  *convertedpix;
-  unsigned char  in[header.cupsBytesPerLine * 6],  /* Input data buffer */
-                 out[header.cupsBytesPerLine * 6]; /* Output data buffer */
+  unsigned char  in[header.cupsBytesPerLine * 6],  // Input data buffer
+                 out[header.cupsBytesPerLine * 6]; // Output data buffer
                
-  /* allocate deflate state */
+  // allocate deflate state
   strm.zalloc = Z_NULL;
   strm.zfree = Z_NULL;
   strm.opaque = Z_NULL;
   ret = deflateInit(&strm, -1);
   if (ret != Z_OK)
-    return ret;
+    return (ret);
 
-  if(header.cupsBitsPerColor == 1 &&
-     (header.cupsColorSpace == CUPS_CSPACE_RGB ||
-      header.cupsColorSpace == CUPS_CSPACE_ADOBERGB ||
-      header.cupsColorSpace == CUPS_CSPACE_SRGB))
+  if (header.cupsBitsPerColor == 1 &&
+      (header.cupsColorSpace == CUPS_CSPACE_RGB ||
+       header.cupsColorSpace == CUPS_CSPACE_ADOBERGB ||
+       header.cupsColorSpace == CUPS_CSPACE_SRGB))
     flag = 1;
 
-  /* compress until end of file */
-  do {
+  // compress until end of file
+  do
+  {
     pixdata = malloc(header.cupsBytesPerLine);
     cupsRasterReadPixels(ras, pixdata, header.cupsBytesPerLine);
     if (flag)
@@ -271,16 +290,17 @@ write_flate(cups_raster_t *ras,           /* I - Image data */
     strm.avail_in = alloc;
     strm.next_in = in;
 
-    /* run deflate() on input until output buffer not full, finish
-     * compression if all of source has been read in */
-    do {
+    // run deflate() on input until output buffer not full, finish
+    // compression if all of source has been read in
+    do
+    {
       strm.avail_out = alloc;
       strm.next_out = out;
 
-      /* Run the deflate algorithm on the data */
+      // Run the deflate algorithm on the data
       ret = deflate(&strm, flush);
 
-      /* check whether state is not clobbered */
+      // check whether state is not clobbered
       DEBUG_assert(ret != Z_STREAM_ERROR);
       have = alloc - strm.avail_out;
       if (fwrite(out, 1, have, doc->outputfp) != have)
@@ -288,103 +308,109 @@ write_flate(cups_raster_t *ras,         /* I - Image data */
        (void)deflateEnd(&strm);
        if (convertedpix != NULL)
          free(convertedpix);
-       return Z_ERRNO;
+       return (Z_ERRNO);
       }
-    } while (strm.avail_out == 0);
+    }
+    while (strm.avail_out == 0);
 
-    /* all input will be used */
+    // all input will be used
     DEBUG_assert(strm.avail_in == 0);
 
-    /* done when last data in file processed */
+    // done when last data in file processed
     free(pixdata);
     free(convertedpix);
-  } while (flush != Z_FINISH);
+  }
+  while (flush != Z_FINISH);
 
-  /* stream will be complete */
+  // stream will be complete
   DEBUG_assert(ret == Z_STREAM_END);
 
-  /* clean up and return */
+  // clean up and return
   (void)deflateEnd(&strm);
-  return Z_OK;
+  return (Z_OK);
 }
 
-/*
- * 'z_error()' - Report a zlib or i/o error
- */
+//
+// 'z_error()' - Report a zlib or i/o error
+//
 
 static void
-z_error(int ret, /* I - Return status of deflate */
-    rastertops_doc_t *doc) /* I - Document information */
+z_error(int ret,               // I - Return status of deflate
+       rastertops_doc_t *doc) // I - Document information
 {
-  switch (ret) {
-  case Z_ERRNO:
-    if (doc->logfunc) doc->logfunc(doc->logdata, CF_LOGLEVEL_ERROR,
-                 "ppdFilterRasterToPS: zpipe - error in source data or output file");
-    break;
-  case Z_STREAM_ERROR:
-    if (doc->logfunc) doc->logfunc(doc->logdata, CF_LOGLEVEL_ERROR,
-                 "ppdFilterRasterToPS: zpipe - invalid compression level");
-    break;
-  case Z_DATA_ERROR:
-    if (doc->logfunc) doc->logfunc(doc->logdata, CF_LOGLEVEL_ERROR,
-                 "ppdFilterRasterToPS: zpipe - invalid or incomplete deflate data");
-    break;
-  case Z_MEM_ERROR:
-    if (doc->logfunc) doc->logfunc(doc->logdata, CF_LOGLEVEL_ERROR,
-                 "ppdFilterRasterToPS: zpipe - out of memory");
-    break;
-  case Z_VERSION_ERROR:
-    if (doc->logfunc) doc->logfunc(doc->logdata, CF_LOGLEVEL_ERROR,
-                 "ppdFilterRasterToPS: zpipe - zlib version mismatch!");
+  switch (ret)
+  {
+    case Z_ERRNO:
+        if (doc->logfunc) doc->logfunc(doc->logdata, CF_LOGLEVEL_ERROR,
+                                      "ppdFilterRasterToPS: zpipe - error in source data or output file");
+       break;
+    case Z_STREAM_ERROR:
+        if (doc->logfunc) doc->logfunc(doc->logdata, CF_LOGLEVEL_ERROR,
+                                      "ppdFilterRasterToPS: zpipe - invalid compression level");
+       break;
+    case Z_DATA_ERROR:
+        if (doc->logfunc) doc->logfunc(doc->logdata, CF_LOGLEVEL_ERROR,
+                                      "ppdFilterRasterToPS: zpipe - invalid or incomplete deflate data");
+       break;
+    case Z_MEM_ERROR:
+        if (doc->logfunc) doc->logfunc(doc->logdata, CF_LOGLEVEL_ERROR,
+                                      "ppdFilterRasterToPS: zpipe - out of memory");
+       break;
+    case Z_VERSION_ERROR:
+      if (doc->logfunc) doc->logfunc(doc->logdata, CF_LOGLEVEL_ERROR,
+                                    "ppdFilterRasterToPS: zpipe - zlib version mismatch!");
   }
 }
 
-/*
- * 'write_end_page()' - Show the current page.
- */
+
+//
+// 'write_end_page()' - Show the current page.
+//
 
 static void
-write_end_page(rastertops_doc_t *doc) /* I - Document information */
+write_end_page(rastertops_doc_t *doc) // I - Document information
 {
   fprintf(doc->outputfp, "\ngrestore\n");
   fprintf(doc->outputfp, "showpage\n");
   fprintf(doc->outputfp, "%%%%PageTrailer\n");
 }
 
-/*
- * 'write_trailer()' - Write the PostScript trailer.
- */
+//
+// 'write_trailer()' - Write the PostScript trailer.
+//
 
 static void
-write_trailer(int  pages, /* I - Number of pages */
-            rastertops_doc_t *doc) /* I - Document information */
+write_trailer(int              pages, // I - Number of pages
+             rastertops_doc_t *doc)  // I - Document information
 {
   fprintf(doc->outputfp, "%%%%Trailer\n");
   fprintf(doc->outputfp, "%%%%Pages: %d\n", pages);
   fprintf(doc->outputfp, "%%%%EOF\n");
 }
 
-/*
- * 'ppdFilterRasterToPS()' - Filter function to convert PWG raster input
- *                  to PostScript
- */
-
-int                         /* O - Error status */
-ppdFilterRasterToPS(int inputfd,         /* I - File descriptor input stream */
-       int outputfd,        /* I - File descriptor output stream */
-       int inputseekable,   /* I - Is input stream seekable? (unused) */
-       cf_filter_data_t *data, /* I - Job and printer data */
-       void *parameters)    /* I - Filter-specific parameters (unused) */
+//
+// 'ppdFilterRasterToPS()' - Filter function to convert PWG raster input
+//                           to PostScript
+//
+
+int                                      // O - Error status
+ppdFilterRasterToPS(int inputfd,         // I - File descriptor input stream
+                   int outputfd,        // I - File descriptor output stream
+                   int inputseekable,   // I - Is input stream seekable?
+                                        //     (unused)
+                   cf_filter_data_t *data, // I - Job and printer data
+                   void *parameters)    // I - Filter-specific parameters
+                                         //     (unused)
 {
-  rastertops_doc_t     doc;         /* Document information */
-  cups_file_t           *inputfp;              /* Print file */
-  FILE                 *outputfp;   /* Output data stream */
-  cups_raster_t               *ras;        /* Raster stream for printing */
-  cups_page_header2_t  header;      /* Page header from file */
-  int           empty,         /* Is the input empty? */
-                Page = 0,      /* variable for counting the pages */
-                ret;           /* Return value of deflate compression */
-  cf_logfunc_t     log = data->logfunc;
+  rastertops_doc_t     doc;         // Document information
+  cups_file_t         *inputfp;    // Print file
+  FILE                 *outputfp;   // Output data stream
+  cups_raster_t               *ras;        // Raster stream for printing
+  cups_page_header2_t  header;      // Page header from file
+  int                  empty,       // Is the input empty?
+                       Page = 0,    // variable for counting the pages
+                       ret;         // Return value of deflate compression
+  cf_logfunc_t         log = data->logfunc;
   void                 *ld = data->logdata;
   cf_filter_iscanceledfunc_t iscanceled = data->iscanceledfunc;
   void                 *icd = data->iscanceleddata;
@@ -393,9 +419,9 @@ ppdFilterRasterToPS(int inputfd,         /* I - File descriptor input stream */
   (void)inputseekable;
   (void)parameters;
 
-  /*
-  * Open the input data stream specified by the inputfd...
-  */
+  //
+  // Open the input data stream specified by the inputfd...
+  //
 
   if ((inputfp = cupsFileOpenFd(inputfd, "r")) == NULL)
   {
@@ -408,9 +434,9 @@ ppdFilterRasterToPS(int inputfd,         /* I - File descriptor input stream */
     return (1);
   }
 
-  /*
-  * Open the output data stream specified by the outputfd...
-  */
+  //
+  // Open the output data stream specified by the outputfd...
+  //
 
   if ((outputfp = fdopen(outputfd, "w")) == NULL)
   {
@@ -427,18 +453,19 @@ ppdFilterRasterToPS(int inputfd,         /* I - File descriptor input stream */
 
   doc.inputfp = inputfp;
   doc.outputfp = outputfp;
-  /* Logging function */
+  // Logging function
   doc.logfunc = log;
   doc.logdata = ld;
-  /* Job-is-canceled function */
+  // Job-is-canceled function
   doc.iscanceledfunc = iscanceled;
   doc.iscanceleddata = icd;
  
   ras = cupsRasterOpen(inputfd, CUPS_RASTER_READ);
 
-  /*
-  * Process pages as needed...
-  */
+  //
+  // Process pages as needed...
+  //
+
   Page = 0;
   empty = 1;
 
@@ -451,9 +478,9 @@ ppdFilterRasterToPS(int inputfd,         /* I - File descriptor input stream */
       break;
     }
 
-   /*
-    * Write the prolog for PS only once
-    */
+    //
+    // Write the prolog for PS only once
+    //
 
     if (empty)
     {
@@ -461,29 +488,31 @@ ppdFilterRasterToPS(int inputfd,         /* I - File descriptor input stream */
       write_prolog(header.PageSize[0], header.PageSize[1], &doc);
     }
 
-   /*
-    * Write a status message with the page number and number of copies.
-    */
+    //
+    // Write a status message with the page number and number of copies.
+    //
 
     Page ++;
 
     if (log) log(ld, CF_LOGLEVEL_INFO,
      "ppdFilterRasterToPS: Starting page %d.", Page);
 
-   /*
-    *  Write the starting of the page
-    */
+    //
+    // Write the starting of the page
+    //
+    
     write_start_page(Page, header.PageSize[0], header.PageSize[1], &doc);
 
-   /*
-    *  write the information regarding the image
-    */
+    //
+    // Write the information regarding the image
+    //
+    
     write_image(header.PageSize[0], header.PageSize[1],
-              header.cupsBitsPerColor,
-              header.cupsWidth, header.cupsHeight,
-              header.cupsColorSpace, &doc);
+               header.cupsBitsPerColor,
+               header.cupsWidth, header.cupsHeight,
+               header.cupsColorSpace, &doc);
 
-    /* Write the compressed image data*/
+    // Write the compressed image data
     ret = write_flate(ras, header, &doc);
     if (ret != Z_OK)
       z_error(ret, &doc);
@@ -492,10 +521,10 @@ ppdFilterRasterToPS(int inputfd,         /* I - File descriptor input stream */
 
   if (empty)
   {
-     if (log) log(ld, CF_LOGLEVEL_DEBUG,
-      "ppdFilterRasterToPS: Input is empty, outputting empty file.");
-     cupsRasterClose(ras);
-     return 0;
+    if (log) log(ld, CF_LOGLEVEL_DEBUG,
+                "ppdFilterRasterToPS: Input is empty, outputting empty file.");
+    cupsRasterClose(ras);
+    return (0);
   }
 
   write_trailer(Page, &doc);
@@ -507,5 +536,5 @@ ppdFilterRasterToPS(int inputfd,         /* I - File descriptor input stream */
   fclose(outputfp);
   close(outputfd);
 
-  return 0;
+  return (0);
 }
index a4693da4c4fa9fb3e91f9bde124ea27dc8b7f318..89f4f914f63e0131a865051ea841d01085ffa015 100644 (file)
@@ -1,49 +1,49 @@
-/*
- * snprintf functions for libppd.
- *
- * Copyright © 2007-2019 by Apple Inc.
- * Copyright © 1997-2007 by Easy Software Products.
- *
- * Licensed under Apache License v2.0.  See the file "LICENSE" for more
- * information.
- */
-
-/*
- * Include necessary headers...
- */
+//
+// snprintf functions for libppd.
+//
+// Copyright © 2007-2019 by Apple Inc.
+// Copyright © 1997-2007 by Easy Software Products.
+//
+// Licensed under Apache License v2.0.  See the file "LICENSE" for more
+// information.
+//
+
+//
+// Include necessary headers...
+//
 
 #include "string-private.h"
 
 
 #ifndef HAVE_VSNPRINTF
-/*
- * '_ppd_vsnprintf()' - Format a string into a fixed size buffer.
- */
-
-int                                    /* O - Number of bytes formatted */
-_ppd_vsnprintf(char       *buffer,     /* O - Output buffer */
-                size_t     bufsize,    /* O - Size of output buffer */
-               const char *format,     /* I - printf-style format string */
-               va_list    ap)          /* I - Pointer to additional arguments */
+//
+// '_ppd_vsnprintf()' - Format a string into a fixed size buffer.
+//
+
+int                                    // O - Number of bytes formatted
+_ppd_vsnprintf(char       *buffer,     // O - Output buffer
+              size_t     bufsize,      // O - Size of output buffer
+              const char *format,      // I - printf-style format string
+              va_list    ap)           // I - Pointer to additional arguments
 {
-  char         *bufptr,                /* Pointer to position in buffer */
-               *bufend,                /* Pointer to end of buffer */
-               sign,                   /* Sign of format width */
-               type;                   /* Format type character */
-  int          width,                  /* Width of field */
-               prec;                   /* Number of characters of precision */
-  char         tformat[100],           /* Temporary format string for sprintf() */
-               *tptr,                  /* Pointer into temporary format */
-               temp[1024];             /* Buffer for formatted numbers */
-  size_t       templen;                /* Length of "temp" */
-  char         *s;                     /* Pointer to string */
-  int          slen;                   /* Length of string */
-  int          bytes;                  /* Total number of bytes needed */
-
-
- /*
-  * Loop through the format string, formatting as needed...
-  */
+  char         *bufptr,                // Pointer to position in buffer
+               *bufend,                // Pointer to end of buffer
+               sign,                   // Sign of format width
+               type;                   // Format type character
+  int          width,                  // Width of field
+               prec;                   // Number of characters of precision
+  char         tformat[100],           // Temporary format string for sprintf()
+               *tptr,                  // Pointer into temporary format
+               temp[1024];             // Buffer for formatted numbers
+  size_t       templen;                // Length of "temp"
+  char         *s;                     // Pointer to string
+  int          slen;                   // Length of string
+  int          bytes;                  // Total number of bytes needed
+
+
+  //
+  // Loop through the format string, formatting as needed...
+  //
 
   bufptr = buffer;
   bufend = buffer + bufsize - 1;
@@ -73,9 +73,9 @@ _ppd_vsnprintf(char       *buffer,    /* O - Output buffer */
 
       if (*format == '*')
       {
-       /*
-        * Get width from argument...
-       */
+       //
+        // Get width from argument...
+       //
 
        format ++;
        width = va_arg(ap, int);
@@ -105,9 +105,9 @@ _ppd_vsnprintf(char       *buffer,  /* O - Output buffer */
 
         if (*format == '*')
        {
-         /*
-         * Get precision from argument...
-         */
+         //
+         // Get precision from argument...
+         //
 
          format ++;
          prec = va_arg(ap, int);
@@ -158,7 +158,7 @@ _ppd_vsnprintf(char       *buffer,  /* O - Output buffer */
 
       switch (type)
       {
-       case 'E' : /* Floating point formats */
+       case 'E' : // Floating point formats
        case 'G' :
        case 'e' :
        case 'f' :
@@ -186,7 +186,7 @@ _ppd_vsnprintf(char       *buffer,  /* O - Output buffer */
            }
            break;
 
-        case 'B' : /* Integer formats */
+        case 'B' : // Integer formats
        case 'X' :
        case 'b' :
         case 'd' :
@@ -217,7 +217,7 @@ _ppd_vsnprintf(char       *buffer,  /* O - Output buffer */
            }
            break;
 
-       case 'p' : /* Pointer value */
+       case 'p' : // Pointer value
            if ((width + 2) > sizeof(temp))
              break;
 
@@ -241,7 +241,7 @@ _ppd_vsnprintf(char       *buffer,  /* O - Output buffer */
            }
            break;
 
-        case 'c' : /* Character or character array */
+        case 'c' : // Character or character array
            bytes += width;
 
            if (bufptr)
@@ -259,7 +259,7 @@ _ppd_vsnprintf(char       *buffer,  /* O - Output buffer */
            }
            break;
 
-       case 's' : /* String */
+       case 's' : // String
            if ((s = va_arg(ap, char *)) == NULL)
              s = "(null)";
 
@@ -292,7 +292,7 @@ _ppd_vsnprintf(char       *buffer,  /* O - Output buffer */
            }
            break;
 
-       case 'n' : /* Output number of chars so far */
+       case 'n' : // Output number of chars so far
            *(va_arg(ap, int *)) = bytes;
            break;
       }
@@ -308,30 +308,30 @@ _ppd_vsnprintf(char       *buffer,        /* O - Output buffer */
     }
   }
 
- /*
-  * Nul-terminate the string and return the number of characters needed.
-  */
+  //
+  // Nul-terminate the string and return the number of characters needed.
+  //
 
   *bufptr = '\0';
 
   return (bytes);
 }
-#endif /* !HAVE_VSNPRINT */
+#endif // !HAVE_VSNPRINT
 
 
 #ifndef HAVE_SNPRINTF
-/*
- * '_ppd_snprintf()' - Format a string into a fixed size buffer.
- */
-
-int                                    /* O - Number of bytes formatted */
-_ppd_snprintf(char       *buffer,      /* O - Output buffer */
-               size_t     bufsize,     /* O - Size of output buffer */
-               const char *format,     /* I - printf-style format string */
-              ...)                     /* I - Additional arguments as needed */
+//
+// '_ppd_snprintf()' - Format a string into a fixed size buffer.
+//
+
+int                                    // O - Number of bytes formatted
+_ppd_snprintf(char       *buffer,      // O - Output buffer
+               size_t     bufsize,     // O - Size of output buffer
+               const char *format,     // I - printf-style format string
+              ...)                     // I - Additional arguments as needed
 {
-  int          bytes;                  /* Number of bytes formatted */
-  va_list      ap;                     /* Pointer to additional arguments */
+  int          bytes;                  // Number of bytes formatted
+  va_list      ap;                     // Pointer to additional arguments
 
 
   va_start(ap, format);
@@ -340,4 +340,4 @@ _ppd_snprintf(char       *buffer,   /* O - Output buffer */
 
   return (bytes);
 }
-#endif /* !HAVE_SNPRINTF */
+#endif // !HAVE_SNPRINTF
index 6d184fcd0bccbd6a67b15384a52c35cfd99e0248..9652755ec093df7b743295fef591e6cefa8d8aad 100644 (file)
@@ -1,19 +1,19 @@
-/*
- * Private string definitions for libppd.
- *
- * Copyright © 2007-2018 by Apple Inc.
- * Copyright © 1997-2006 by Easy Software Products.
- *
- * Licensed under Apache License v2.0.  See the file "LICENSE" for more
- * information.
- */
+//
+// Private string definitions for libppd.
+//
+// Copyright © 2007-2018 by Apple Inc.
+// Copyright © 1997-2006 by Easy Software Products.
+//
+// Licensed under Apache License v2.0.  See the file "LICENSE" for more
+// information.
+//
 
 #ifndef _PPD_STRING_PRIVATE_H_
 #  define _PPD_STRING_PRIVATE_H_
 
-/*
- * Include necessary headers...
- */
+//
+// Include necessary headers...
+//
 
 #  include "config.h"
 #  include <stdio.h>
 
 #  ifdef HAVE_STRING_H
 #    include <string.h>
-#  endif /* HAVE_STRING_H */
+#  endif // HAVE_STRING_H
 
 #  ifdef HAVE_STRINGS_H
 #    include <strings.h>
-#  endif /* HAVE_STRINGS_H */
+#  endif // HAVE_STRINGS_H
 
 #  ifdef HAVE_BSTRING_H
 #    include <bstring.h>
-#  endif /* HAVE_BSTRING_H */
+#  endif // HAVE_BSTRING_H
 
 #  if defined(_WIN32) && !defined(__CUPS_SSIZE_T_DEFINED)
 #    define __CUPS_SSIZE_T_DEFINED
 #    include <stddef.h>
-/* Windows does not support the ssize_t type, so map it to long... */
-typedef long ssize_t;                  /* @private@ */
-#  endif /* _WIN32 && !__CUPS_SSIZE_T_DEFINED */
+// Windows does not support the ssize_t type, so map it to long...
+typedef long ssize_t;                  // @private@
+#  endif // _WIN32 && !__CUPS_SSIZE_T_DEFINED
 
 
-/*
- * C++ magic...
- */
+//
+// C++ magic...
+//
 
 #  ifdef __cplusplus
 extern "C" {
-#  endif /* __cplusplus */
+#  endif // __cplusplus
 
 
-/*
- * String pool structures...
- */
+//
+// String pool structures...
+//
 
 #  define _PPD_STR_GUARD       0x56788765
 
-typedef struct _ppd_sp_item_s          /**** String Pool Item ****/
+typedef struct _ppd_sp_item_s          // **** String Pool Item ****
 {
 #  ifdef DEBUG_GUARDS
-  unsigned int guard;                  /* Guard word */
-#  endif /* DEBUG_GUARDS */
-  unsigned int ref_count;              /* Reference count */
-  char         str[1];                 /* String */
+  unsigned int guard;                  // Guard word
+#  endif // DEBUG_GUARDS
+  unsigned int ref_count;              // Reference count
+  char         str[1];                 // String
 } _ppd_sp_item_t;
 
 
-/*
- * Replacements for the ctype macros that are not affected by locale, since we
- * really only care about testing for ASCII characters when parsing files, etc.
- *
- * The _PPD_INLINE definition controls whether we get an inline function body,
- * and external function body, or an external definition.
- */
+//
+// Replacements for the ctype macros that are not affected by locale, since we
+// really only care about testing for ASCII characters when parsing files, etc.
+//
+// The _PPD_INLINE definition controls whether we get an inline function body,
+// and external function body, or an external definition.
+//
 
 #  if defined(__GNUC__) || __STDC_VERSION__ >= 199901L
 #    define _PPD_INLINE static inline
@@ -83,51 +83,51 @@ typedef struct _ppd_sp_item_s               /**** String Pool Item ****/
 #    define _PPD_INLINE static __inline
 #  elif defined(_PPD_STRING_C_)
 #    define _PPD_INLINE
-#  endif /* __GNUC__ || __STDC_VERSION__ */
+#  endif // __GNUC__ || __STDC_VERSION__
 
 #  ifdef _PPD_INLINE
-_PPD_INLINE int                        /* O - 1 on match, 0 otherwise */
-_ppd_isalnum(int ch)                   /* I - Character to test */
+_PPD_INLINE int                                // O - 1 on match, 0 otherwise
+_ppd_isalnum(int ch)                   // I - Character to test
 {
   return ((ch >= '0' && ch <= '9') ||
           (ch >= 'A' && ch <= 'Z') ||
           (ch >= 'a' && ch <= 'z'));
 }
 
-_PPD_INLINE int                        /* O - 1 on match, 0 otherwise */
-_ppd_isalpha(int ch)                   /* I - Character to test */
+_PPD_INLINE int                                // O - 1 on match, 0 otherwise
+_ppd_isalpha(int ch)                   // I - Character to test
 {
   return ((ch >= 'A' && ch <= 'Z') ||
           (ch >= 'a' && ch <= 'z'));
 }
 
-_PPD_INLINE int                        /* O - 1 on match, 0 otherwise */
-_ppd_islower(int ch)                   /* I - Character to test */
+_PPD_INLINE int                                // O - 1 on match, 0 otherwise
+_ppd_islower(int ch)                   // I - Character to test
 {
   return (ch >= 'a' && ch <= 'z');
 }
 
-_PPD_INLINE int                        /* O - 1 on match, 0 otherwise */
-_ppd_isspace(int ch)                   /* I - Character to test */
+_PPD_INLINE int                                // O - 1 on match, 0 otherwise
+_ppd_isspace(int ch)                   // I - Character to test
 {
   return (ch == ' ' || ch == '\f' || ch == '\n' || ch == '\r' || ch == '\t' ||
           ch == '\v');
 }
 
-_PPD_INLINE int                        /* O - 1 on match, 0 otherwise */
-_ppd_isupper(int ch)                   /* I - Character to test */
+_PPD_INLINE int                                // O - 1 on match, 0 otherwise
+_ppd_isupper(int ch)                   // I - Character to test
 {
   return (ch >= 'A' && ch <= 'Z');
 }
 
-_PPD_INLINE int                        /* O - Converted character */
-_ppd_tolower(int ch)                   /* I - Character to convert */
+_PPD_INLINE int                                // O - Converted character
+_ppd_tolower(int ch)                   // I - Character to convert
 {
   return (_ppd_isupper(ch) ? ch - 'A' + 'a' : ch);
 }
 
-_PPD_INLINE int                        /* O - Converted character */
-_ppd_toupper(int ch)                   /* I - Character to convert */
+_PPD_INLINE int                                // O - Converted character
+_ppd_toupper(int ch)                   // I - Character to convert
 {
   return (_ppd_islower(ch) ? ch - 'a' + 'A' : ch);
 }
@@ -139,20 +139,21 @@ extern int _ppd_isspace(int ch);
 extern int _ppd_isupper(int ch);
 extern int _ppd_tolower(int ch);
 extern int _ppd_toupper(int ch);
-#  endif /* _PPD_INLINE */
+#  endif // _PPD_INLINE
 
 
-/*
- * Prototypes...
- */
+//
+// Prototypes...
+//
 
-extern ssize_t _ppd_safe_vsnprintf(char *buffer, size_t bufsize, const char *format, va_list args);
+extern ssize_t _ppd_safe_vsnprintf(char *buffer, size_t bufsize,
+                                   const char *format, va_list args);
 extern void    _ppd_strcpy(char *dst, const char *src);
 
 #  ifndef HAVE_STRDUP
 extern char    *_ppd_strdup(const char *);
 #    define strdup _ppd_strdup
-#  endif /* !HAVE_STRDUP */
+#  endif // !HAVE_STRDUP
 
 extern int     _ppd_strcasecmp(const char *, const char *);
 
@@ -161,26 +162,27 @@ extern int        _ppd_strncasecmp(const char *, const char *, size_t n);
 #  ifndef HAVE_STRLCAT
 extern size_t _ppd_strlcat(char *, const char *, size_t);
 #    define strlcat _ppd_strlcat
-#  endif /* !HAVE_STRLCAT */
+#  endif // !HAVE_STRLCAT
 
 #  ifndef HAVE_STRLCPY
 extern size_t _ppd_strlcpy(char *, const char *, size_t);
 #    define strlcpy _ppd_strlcpy
-#  endif /* !HAVE_STRLCPY */
+#  endif // !HAVE_STRLCPY
 
 #  ifndef HAVE_SNPRINTF
 extern int     _ppd_snprintf(char *, size_t, const char *, ...);
 #    define snprintf _ppd_snprintf
-#  endif /* !HAVE_SNPRINTF */
+#  endif // !HAVE_SNPRINTF
 
 #  ifndef HAVE_VSNPRINTF
 extern int     _ppd_vsnprintf(char *, size_t, const char *, va_list);
 #    define vsnprintf _ppd_vsnprintf
-#  endif /* !HAVE_VSNPRINTF */
+#  endif // !HAVE_VSNPRINTF
 
-/*
- * String pool functions...
- */
+
+//
+// String pool functions...
+//
 
 extern char    *_ppdStrAlloc(const char *s);
 extern void    _ppdStrFlush(void);
@@ -189,22 +191,22 @@ extern char       *_ppdStrRetain(const char *s);
 extern size_t  _ppdStrStatistics(size_t *alloc_bytes, size_t *total_bytes);
 
 
-/*
- * Floating point number functions...
- */
+//
+// Floating point number functions...
+//
 
 extern char    *_ppdStrFormatd(char *buf, char *bufend, double number,
-                                struct lconv *loc);
+                               struct lconv *loc);
 extern double  _ppdStrScand(const char *buf, char **bufptr,
-                             struct lconv *loc);
+                            struct lconv *loc);
 
 
-/*
- * C++ magic...
- */
+//
+// C++ magic...
+//
 
 #  ifdef __cplusplus
 }
-#  endif /* __cplusplus */
+#  endif // __cplusplus
 
-#endif /* !_PPD_STRING_H_ */
+#endif // !_PPD_STRING_H_
index a1da5dbcb879c72df3d5a7863adc120f220c9858..3dbf5d84ac4e76f09212fd37fe6cc7c58fb5566f 100644 (file)
@@ -1,16 +1,16 @@
-/*
- * String functions for libppd.
- *
- * Copyright © 2007-2019 by Apple Inc.
- * Copyright © 1997-2007 by Easy Software Products.
- *
- * Licensed under Apache License v2.0.  See the file "LICENSE" for more
- * information.
- */
-
-/*
- * Include necessary headers...
- */
+//
+// String functions for libppd.
+//
+// Copyright © 2007-2019 by Apple Inc.
+// Copyright © 1997-2007 by Easy Software Products.
+//
+// Licensed under Apache License v2.0.  See the file "LICENSE" for more
+// information.
+//
+
+//
+// Include necessary headers...
+//
 
 #define _PPD_STRING_C_
 #include "string-private.h"
 #include <limits.h>
 
 
-/*
- * Local globals...
- */
+//
+// Local globals...
+//
 
 static _ppd_mutex_t    sp_mutex = _PPD_MUTEX_INITIALIZER;
-                                       /* Mutex to control access to pool */
+                                       // Mutex to control access to pool
 static cups_array_t    *stringpool = NULL;
-                                       /* Global string pool */
+                                       // Global string pool
 
 
-/*
- * Local functions...
- */
+//
+// Local functions...
+//
 
 static int     ppd_compare_sp_items(_ppd_sp_item_t *a, _ppd_sp_item_t *b);
 
 
-/*
- * '_ppdStrAlloc()' - Allocate/reference a string.
- */
+//
+// '_ppdStrAlloc()' - Allocate/reference a string.
+//
 
-char *                                 /* O - String pointer */
-_ppdStrAlloc(const char *s)            /* I - String */
+char *                                 // O - String pointer
+_ppdStrAlloc(const char *s)            // I - String
 {
-  size_t               slen;           /* Length of string */
-  _ppd_sp_item_t       *item,          /* String pool item */
-                       *key;           /* Search key */
+  size_t               slen;           // Length of string
+  _ppd_sp_item_t       *item,          // String pool item
+                       *key;           // Search key
 
 
- /*
-  * Range check input...
-  */
+  //
+  // Range check input...
+  //
 
   if (!s)
     return (NULL);
 
- /*
-  * Get the string pool...
-  */
+  //
+  // Get the string pool...
+  //
 
   _ppdMutexLock(&sp_mutex);
 
@@ -73,17 +73,17 @@ _ppdStrAlloc(const char *s)         /* I - String */
     return (NULL);
   }
 
- /*
-  * See if the string is already in the pool...
-  */
+  //
+  // See if the string is already in the pool...
+  //
 
   key = (_ppd_sp_item_t *)(s - offsetof(_ppd_sp_item_t, str));
 
   if ((item = (_ppd_sp_item_t *)cupsArrayFind(stringpool, key)) != NULL)
   {
-   /*
-    * Found it, return the cached string...
-    */
+    //
+    // Found it, return the cached string...
+    //
 
     item->ref_count ++;
 
@@ -97,16 +97,16 @@ _ppdStrAlloc(const char *s)         /* I - String */
       _ppdMutexUnlock(&sp_mutex);
       abort();
     }
-#endif /* DEBUG_GUARDS */
+#endif // DEBUG_GUARDS
 
     _ppdMutexUnlock(&sp_mutex);
 
     return (item->str);
   }
 
- /*
-  * Not found, so allocate a new one...
-  */
+  //
+  // Not found, so allocate a new one...
+  //
 
   slen = strlen(s);
   item = (_ppd_sp_item_t *)calloc(1, sizeof(_ppd_sp_item_t) + slen);
@@ -126,11 +126,11 @@ _ppdStrAlloc(const char *s)               /* I - String */
   DEBUG_printf(("5_ppdStrAlloc: Created string %p(%s) for \"%s\", guard=%08x, "
                "ref_count=%d", item, item->str, s, item->guard,
                item->ref_count));
-#endif /* DEBUG_GUARDS */
+#endif // DEBUG_GUARDS
 
- /*
-  * Add the string to the pool and return it...
-  */
+  //
+  // Add the string to the pool and return it...
+  //
 
   cupsArrayAdd(stringpool, item);
 
@@ -140,14 +140,14 @@ _ppdStrAlloc(const char *s)               /* I - String */
 }
 
 
-/*
- * '_ppdStrFlush()' - Flush the string pool.
- */
+//
+// '_ppdStrFlush()' - Flush the string pool.
+//
 
 void
 _ppdStrFlush(void)
 {
-  _ppd_sp_item_t       *item;          /* Current item */
+  _ppd_sp_item_t       *item;          // Current item
 
 
   DEBUG_printf(("4_ppdStrFlush: %d strings in array",
@@ -167,37 +167,37 @@ _ppdStrFlush(void)
 }
 
 
-/*
- * '_ppdStrFormatd()' - Format a floating-point number.
- */
+//
+// '_ppdStrFormatd()' - Format a floating-point number.
+//
 
-char *                                 /* O - Pointer to end of string */
-_ppdStrFormatd(char         *buf,      /* I - String */
-                char         *bufend,  /* I - End of string buffer */
-               double       number,    /* I - Number to format */
-                struct lconv *loc)     /* I - Locale data */
+char *                                 // O - Pointer to end of string
+_ppdStrFormatd(char         *buf,      // I - String
+                char         *bufend,  // I - End of string buffer
+               double       number,    // I - Number to format
+                struct lconv *loc)     // I - Locale data
 {
-  char         *bufptr,                /* Pointer into buffer */
-               temp[1024],             /* Temporary string */
-               *tempdec,               /* Pointer to decimal point */
-               *tempptr;               /* Pointer into temporary string */
-  const char   *dec;                   /* Decimal point */
-  int          declen;                 /* Length of decimal point */
+  char         *bufptr,                // Pointer into buffer
+               temp[1024],             // Temporary string
+               *tempdec,               // Pointer to decimal point
+               *tempptr;               // Pointer into temporary string
+  const char   *dec;                   // Decimal point
+  int          declen;                 // Length of decimal point
 
 
- /*
-  * Format the number using the "%.12f" format and then eliminate
-  * unnecessary trailing 0's.
-  */
+  //
+  // Format the number using the "%.12f" format and then eliminate
+  // unnecessary trailing 0's.
+  //
 
   snprintf(temp, sizeof(temp), "%.12f", number);
   for (tempptr = temp + strlen(temp) - 1;
        tempptr > temp && *tempptr == '0';
        *tempptr-- = '\0');
 
- /*
-  * Next, find the decimal point...
-  */
+  //
+  // Next, find the decimal point...
+  //
 
   if (loc && loc->decimal_point)
   {
@@ -215,9 +215,9 @@ _ppdStrFormatd(char         *buf,   /* I - String */
   else
     tempdec = strstr(temp, dec);
 
- /*
-  * Copy everything up to the decimal point...
-  */
+  //
+  // Copy everything up to the decimal point...
+  //
 
   if (tempdec)
   {
@@ -247,38 +247,38 @@ _ppdStrFormatd(char         *buf, /* I - String */
 }
 
 
-/*
- * '_ppdStrFree()' - Free/dereference a string.
- */
+//
+// '_ppdStrFree()' - Free/dereference a string.
+//
 
 void
-_ppdStrFree(const char *s)             /* I - String to free */
+_ppdStrFree(const char *s)             // I - String to free
 {
-  _ppd_sp_item_t       *item,          /* String pool item */
-                       *key;           /* Search key */
+  _ppd_sp_item_t       *item,          // String pool item
+                       *key;           // Search key
 
 
- /*
-  * Range check input...
-  */
+  //
+  // Range check input...
+  //
 
   if (!s)
     return;
 
- /*
-  * Check the string pool...
-  *
-  * We don't need to lock the mutex yet, as we only want to know if
-  * the stringpool is initialized.  The rest of the code will still
-  * work if it is initialized before we lock...
-  */
+  //
+  // Check the string pool...
+  //
+  // We don't need to lock the mutex yet, as we only want to know if
+  // the stringpool is initialized.  The rest of the code will still
+  // work if it is initialized before we lock...
+  //
 
   if (!stringpool)
     return;
 
- /*
-  * See if the string is already in the pool...
-  */
+  //
+  // See if the string is already in the pool...
+  //
 
   _ppdMutexLock(&sp_mutex);
 
@@ -287,9 +287,9 @@ _ppdStrFree(const char *s)          /* I - String to free */
   if ((item = (_ppd_sp_item_t *)cupsArrayFind(stringpool, key)) != NULL &&
       item == key)
   {
-   /*
-    * Found it, dereference...
-    */
+    //
+    // Found it, dereference...
+    //
 
 #ifdef DEBUG_GUARDS
     if (key->guard != _PPD_STR_GUARD)
@@ -298,15 +298,15 @@ _ppdStrFree(const char *s)                /* I - String to free */
       _ppdMutexUnlock(&sp_mutex);
       abort();
     }
-#endif /* DEBUG_GUARDS */
+#endif // DEBUG_GUARDS
 
     item->ref_count --;
 
     if (!item->ref_count)
     {
-     /*
-      * Remove and free...
-      */
+      //
+      // Remove and free...
+      //
 
       cupsArrayRemove(stringpool, item);
 
@@ -318,18 +318,18 @@ _ppdStrFree(const char *s)                /* I - String to free */
 }
 
 
-/*
- * '_ppdStrRetain()' - Increment the reference count of a string.
- *
- * Note: This function does not verify that the passed pointer is in the
- *       string pool, so any calls to it MUST know they are passing in a
- *       good pointer.
- */
+//
+// '_ppdStrRetain()' - Increment the reference count of a string.
+//
+// Note: This function does not verify that the passed pointer is in the
+//       string pool, so any calls to it MUST know they are passing in a
+//       good pointer.
+//
 
-char *                                 /* O - Pointer to string */
-_ppdStrRetain(const char *s)           /* I - String to retain */
+char *                                 // O - Pointer to string
+_ppdStrRetain(const char *s)           // I - String to retain
 {
-  _ppd_sp_item_t       *item;          /* Pointer to string pool item */
+  _ppd_sp_item_t       *item;          // Pointer to string pool item
 
 
   if (s)
@@ -343,7 +343,7 @@ _ppdStrRetain(const char *s)                /* I - String to retain */
                     "ref_count=%d", item, s, item->guard, item->ref_count));
       abort();
     }
-#endif /* DEBUG_GUARDS */
+#endif // DEBUG_GUARDS
 
     _ppdMutexLock(&sp_mutex);
 
@@ -356,39 +356,39 @@ _ppdStrRetain(const char *s)              /* I - String to retain */
 }
 
 
-/*
- * '_ppdStrScand()' - Scan a string for a floating-point number.
- *
- * This function handles the locale-specific BS so that a decimal
- * point is always the period (".")...
- */
+//
+// '_ppdStrScand()' - Scan a string for a floating-point number.
+//
+// This function handles the locale-specific BS so that a decimal
+// point is always the period (".")...
+//
 
-double                                 /* O - Number */
-_ppdStrScand(const char   *buf,        /* I - Pointer to number */
-              char         **bufptr,   /* O - New pointer or NULL on error */
-              struct lconv *loc)       /* I - Locale data */
+double                                 // O - Number
+_ppdStrScand(const char   *buf,                // I - Pointer to number
+            char         **bufptr,     // O - New pointer or NULL on error
+            struct lconv *loc)         // I - Locale data
 {
-  char temp[1024],                     /* Temporary buffer */
-       *tempptr;                       /* Pointer into temporary buffer */
+  char temp[1024],                     // Temporary buffer
+       *tempptr;                       // Pointer into temporary buffer
 
 
- /*
-  * Range check input...
-  */
+  //
+  // Range check input...
+  //
 
   if (!buf)
     return (0.0);
 
- /*
-  * Skip leading whitespace...
-  */
+  //
+  // Skip leading whitespace...
+  //
 
   while (_ppd_isspace(*buf))
     buf ++;
 
- /*
-  * Copy leading sign, numbers, period, and then numbers...
-  */
+  //
+  // Copy leading sign, numbers, period, and then numbers...
+  //
 
   tempptr = temp;
   if (*buf == '-' || *buf == '+')
@@ -407,15 +407,16 @@ _ppdStrScand(const char   *buf,   /* I - Pointer to number */
 
   if (*buf == '.')
   {
-   /*
-    * Read fractional portion of number...
-    */
+    //
+    // Read fractional portion of number...
+    //
 
     buf ++;
 
     if (loc && loc->decimal_point)
     {
-      strlcpy(tempptr, loc->decimal_point, sizeof(temp) - (size_t)(tempptr - temp));
+      strlcpy(tempptr, loc->decimal_point,
+             sizeof(temp) - (size_t)(tempptr - temp));
       tempptr += strlen(tempptr);
     }
     else if (tempptr < (temp + sizeof(temp) - 1))
@@ -442,9 +443,9 @@ _ppdStrScand(const char   *buf,     /* I - Pointer to number */
 
   if (*buf == 'e' || *buf == 'E')
   {
-   /*
-    * Read exponent...
-    */
+    //
+    // Read exponent...
+    //
 
     if (tempptr < (temp + sizeof(temp) - 1))
       *tempptr++ = *buf++;
@@ -481,9 +482,9 @@ _ppdStrScand(const char   *buf,     /* I - Pointer to number */
       }
   }
 
- /*
-  * Nul-terminate the temporary string and return the value...
-  */
+  //
+  // Nul-terminate the temporary string and return the value...
+  //
 
   if (bufptr)
     *bufptr = (char *)buf;
@@ -494,35 +495,35 @@ _ppdStrScand(const char   *buf,   /* I - Pointer to number */
 }
 
 
-/*
- * '_ppdStrStatistics()' - Return allocation statistics for string pool.
- */
+//
+// '_ppdStrStatistics()' - Return allocation statistics for string pool.
+//
 
-size_t                                 /* O - Number of strings */
-_ppdStrStatistics(size_t *alloc_bytes, /* O - Allocated bytes */
-                   size_t *total_bytes)        /* O - Total string bytes */
+size_t                                 // O - Number of strings
+_ppdStrStatistics(size_t *alloc_bytes, // O - Allocated bytes
+                 size_t *total_bytes)  // O - Total string bytes
 {
-  size_t               count,          /* Number of strings */
-                       abytes,         /* Allocated string bytes */
-                       tbytes,         /* Total string bytes */
-                       len;            /* Length of string */
-  _ppd_sp_item_t       *item;          /* Current item */
+  size_t               count,          // Number of strings
+                       abytes,         // Allocated string bytes
+                       tbytes,         // Total string bytes
+                       len;            // Length of string
+  _ppd_sp_item_t       *item;          // Current item
 
 
- /*
-  * Loop through strings in pool, counting everything up...
-  */
+  //
+  // Loop through strings in pool, counting everything up...
+  //
 
   _ppdMutexLock(&sp_mutex);
 
   for (count = 0, abytes = 0, tbytes = 0,
-           item = (_ppd_sp_item_t *)cupsArrayFirst(stringpool);
+        item = (_ppd_sp_item_t *)cupsArrayFirst(stringpool);
        item;
        item = (_ppd_sp_item_t *)cupsArrayNext(stringpool))
   {
-   /*
-    * Count allocated memory, using a 64-bit aligned buffer as a basis.
-    */
+    //
+    // Count allocated memory, using a 64-bit aligned buffer as a basis.
+    //
 
     count  += item->ref_count;
     len    = (strlen(item->str) + 8) & (size_t)~7;
@@ -532,9 +533,9 @@ _ppdStrStatistics(size_t *alloc_bytes,      /* O - Allocated bytes */
 
   _ppdMutexUnlock(&sp_mutex);
 
- /*
-  * Return values...
-  */
+  //
+  // Return values...
+  //
 
   if (alloc_bytes)
     *alloc_bytes = abytes;
@@ -546,13 +547,13 @@ _ppdStrStatistics(size_t *alloc_bytes,    /* O - Allocated bytes */
 }
 
 
-/*
- * '_ppd_strcpy()' - Copy a string allowing for overlapping strings.
- */
+//
+// '_ppd_strcpy()' - Copy a string allowing for overlapping strings.
+//
 
 void
-_ppd_strcpy(char       *dst,           /* I - Destination string */
-             const char *src)          /* I - Source string */
+_ppd_strcpy(char       *dst,           // I - Destination string
+           const char *src)            // I - Source string
 {
   while (*src)
     *dst++ = *src++;
@@ -561,16 +562,16 @@ _ppd_strcpy(char       *dst,              /* I - Destination string */
 }
 
 
-/*
- * '_ppd_strdup()' - Duplicate a string.
- */
+//
+// '_ppd_strdup()' - Duplicate a string.
+//
 
 #ifndef HAVE_STRDUP
-char   *                               /* O - New string pointer */
-_ppd_strdup(const char *s)             /* I - String to duplicate */
+char   *                               // O - New string pointer
+_ppd_strdup(const char *s)             // I - String to duplicate
 {
-  char         *t;                     /* New string pointer */
-  size_t       slen;                   /* Length of string */
+  char         *t;                     // New string pointer
+  size_t       slen;                   // Length of string
 
 
   if (!s)
@@ -582,16 +583,16 @@ _ppd_strdup(const char *s)                /* I - String to duplicate */
 
   return (memcpy(t, s, slen + 1));
 }
-#endif /* !HAVE_STRDUP */
+#endif // !HAVE_STRDUP
 
 
-/*
- * '_ppd_strcasecmp()' - Do a case-insensitive comparison.
- */
+//
+// '_ppd_strcasecmp()' - Do a case-insensitive comparison.
+//
 
-int                            /* O - Result of comparison (-1, 0, or 1) */
-_ppd_strcasecmp(const char *s, /* I - First string */
-                 const char *t)        /* I - Second string */
+int                            // O - Result of comparison (-1, 0, or 1)
+_ppd_strcasecmp(const char *s, // I - First string
+               const char *t)  // I - Second string
 {
   while (*s != '\0' && *t != '\0')
   {
@@ -612,14 +613,17 @@ _ppd_strcasecmp(const char *s,    /* I - First string */
     return (-1);
 }
 
-/*
- * '_ppd_strncasecmp()' - Do a case-insensitive comparison on up to N chars.
- */
 
-int                                    /* O - Result of comparison (-1, 0, or 1) */
-_ppd_strncasecmp(const char *s,        /* I - First string */
-                  const char *t,       /* I - Second string */
-                 size_t     n)         /* I - Maximum number of characters to compare */
+//
+// '_ppd_strncasecmp()' - Do a case-insensitive comparison on up to N chars.
+//
+
+int                                    // O - Result of comparison
+                                       //     (-1, 0, or 1)
+_ppd_strncasecmp(const char *s,                // I - First string
+                const char *t,         // I - Second string
+                size_t     n)          // I - Maximum number of characters to
+                                       //     compare
 {
   while (*s != '\0' && *t != '\0' && n > 0)
   {
@@ -645,39 +649,39 @@ _ppd_strncasecmp(const char *s,   /* I - First string */
 
 
 #ifndef HAVE_STRLCAT
-/*
- * '_ppd_strlcat()' - Safely concatenate two strings.
- */
-
-size_t                                 /* O - Length of string */
-_ppd_strlcat(char       *dst,          /* O - Destination string */
-              const char *src,         /* I - Source string */
-             size_t     size)          /* I - Size of destination string buffer */
+//
+// '_ppd_strlcat()' - Safely concatenate two strings.
+//
+
+size_t                                 // O - Length of string
+_ppd_strlcat(char       *dst,          // O - Destination string
+            const char *src,           // I - Source string
+            size_t     size)           // I - Size of destination string buffer
 {
-  size_t       srclen;                 /* Length of source string */
-  size_t       dstlen;                 /* Length of destination string */
+  size_t       srclen;                 // Length of source string
+  size_t       dstlen;                 // Length of destination string
 
 
- /*
-  * Figure out how much room is left...
-  */
+  //
+  // Figure out how much room is left...
+  //
 
   dstlen = strlen(dst);
 
   if (size < (dstlen + 1))
-    return (dstlen);                   /* No room, return immediately... */
+    return (dstlen);                   // No room, return immediately...
 
   size -= dstlen + 1;
 
- /*
-  * Figure out how much room is needed...
-  */
+  //
+  // Figure out how much room is needed...
+  //
 
   srclen = strlen(src);
 
- /*
-  * Copy the appropriate amount...
-  */
+  //
+  // Copy the appropriate amount...
+  //
 
   if (srclen > size)
     srclen = size;
@@ -687,33 +691,33 @@ _ppd_strlcat(char       *dst,             /* O - Destination string */
 
   return (dstlen + srclen);
 }
-#endif /* !HAVE_STRLCAT */
+#endif // !HAVE_STRLCAT
 
 
 #ifndef HAVE_STRLCPY
-/*
- * '_ppd_strlcpy()' - Safely copy two strings.
- */
-
-size_t                                 /* O - Length of string */
-_ppd_strlcpy(char       *dst,          /* O - Destination string */
-              const char *src,         /* I - Source string */
-             size_t      size)         /* I - Size of destination string buffer */
+//
+// '_ppd_strlcpy()' - Safely copy two strings.
+//
+
+size_t                                 // O - Length of string
+_ppd_strlcpy(char       *dst,          // O - Destination string
+            const char *src,           // I - Source string
+            size_t      size)          // I - Size of destination string buffer
 {
-  size_t       srclen;                 /* Length of source string */
+  size_t       srclen;                 // Length of source string
 
 
- /*
-  * Figure out how much room is needed...
-  */
+  //
+  // Figure out how much room is needed...
+  //
 
   size --;
 
   srclen = strlen(src);
 
- /*
-  * Copy the appropriate amount...
-  */
+  //
+  // Copy the appropriate amount...
+  //
 
   if (srclen > size)
     srclen = size;
@@ -723,16 +727,16 @@ _ppd_strlcpy(char       *dst,             /* O - Destination string */
 
   return (srclen);
 }
-#endif /* !HAVE_STRLCPY */
+#endif // !HAVE_STRLCPY
 
 
-/*
- * 'ppd_compare_sp_items()' - Compare two string pool items...
- */
+//
+// 'ppd_compare_sp_items()' - Compare two string pool items...
+//
 
-static int                             /* O - Result of comparison */
-ppd_compare_sp_items(_ppd_sp_item_t *a,        /* I - First item */
-                 _ppd_sp_item_t *b)    /* I - Second item */
+static int                             // O - Result of comparison
+ppd_compare_sp_items(_ppd_sp_item_t *a,        // I - First item
+                    _ppd_sp_item_t *b) // I - Second item
 {
   return (strcmp(a->str, b->str));
 }
index 1b233620b8a93b6e1901b3246e829f815eb34eb3..7a1980442f1b42f9dea7ee06b75a380bfde4fcbe 100644 (file)
@@ -1,47 +1,45 @@
-/*
- *   Sample/test driver interface program for CUPS.
- *
- *   This program handles listing and installing both static PPD files
- *   in CUPS_DATADIR/model and dynamically generated PPD files using
- *   the driver helper programs in CUPS_SERVERBIN/driver.
- *
- *   Copyright 2007-2010 by Apple Inc.
- *   Copyright 1997-2006 by Easy Software Products.
- *
- *   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 "COPYING"
- *   which should have been included with this file.
- *
- * Contents:
- *
- *   main()      - Enumerate or display PPD files.
- *   cat_ppd()   - Display a PPD file.
- *   list_ppds() - List PPDs.
- *
- * Compile with:gcc -o testdriver testdriver.c -I.. -lppd -lcups
- */
-
-/*
- * Include necessary headers...
- */
+//
+//   Sample/test driver interface program for libppd.
+//
+//   This program handles listing and installing both static PPD files
+//   in CUPS_DATADIR/model and dynamically generated PPD files using
+//   the driver helper programs in CUPS_SERVERBIN/driver.
+//
+//   Copyright 2007-2010 by Apple Inc.
+//   Copyright 1997-2006 by Easy Software Products.
+//
+//   Licensed under Apache License v2.0.  See the file "LICENSE" for more
+//   information.
+//
+// Contents:
+//
+//   main()      - Enumerate or display PPD files.
+//   cat_ppd()   - Display a PPD file.
+//   list_ppds() - List PPDs.
+//
+// Compile with:gcc -o testdriver testdriver.c -I.. -lppd -lcups
+//
+
+//
+// Include necessary headers...
+//
 
 #include <ppd/ppd.h>
 #include <ppd/string-private.h>
 #include <cups/cups.h>
 
 
-/*
- * Local functions...
- */
+//
+// Local functions...
+//
 
 static int     cat_ppd(const char *uri);
 static int     list_ppds(const char *name);
 
 
-/*
- * Sample data...
- */
+//
+// Sample data...
+//
 
 static const char *models[][2] =
                {
@@ -51,13 +49,13 @@ static const char *models[][2] =
                };
 
 
-/*
- * 'main()' - Enumerate or display PPD files.
- */
+//
+// 'main()' - Enumerate or display PPD files.
+//
 
-int                                    /* O - Exit status */
-main(int  argc,                                /* I - Number of command-line args */
-     char *argv[])                     /* I - Command-line arguments */
+int                                    // O - Exit status
+main(int  argc,                                // I - Number of command-line args
+     char *argv[])                     // I - Command-line arguments
 {
   if (argc == 2 && !strcmp(argv[1], "list"))
     return (list_ppds(argv[0]));
@@ -70,20 +68,20 @@ main(int  argc,                             /* I - Number of command-line args */
 }
 
 
-/*
- * 'cat_ppd()' - Display a PPD file.
- */
+//
+// 'cat_ppd()' - Display a PPD file.
+//
 
-static int                             /* O - Exit status */
-cat_ppd(const char *uri)               /* I - PPD URI */
+static int                             // O - Exit status
+cat_ppd(const char *uri)               // I - PPD URI
 {
-  int          i;                      /* Looping var */
-  char         scheme[255],            /* URI scheme */
-               userpass[255],          /* Username/password (unused) */
-               hostname[255],          /* Hostname (unused) */
-               resource[1024];         /* Resource name */
-  int          port;                   /* Port (unused) */
-  const char   *name;                  /* Pointer to name in URI */
+  int          i;                      // Looping var
+  char         scheme[255],            // URI scheme
+               userpass[255],          // Username/password (unused)
+               hostname[255],          // Hostname (unused)
+               resource[1024];         // Resource name
+  int          port;                   // Port (unused)
+  const char   *name;                  // Pointer to name in URI
 
 
   if (httpSeparateURI(HTTP_URI_CODING_ALL, uri, scheme, sizeof(scheme),
@@ -99,9 +97,10 @@ cat_ppd(const char *uri)             /* I - PPD URI */
   for (i = 0 ; i < (int)(sizeof(models) / sizeof(models[0])); i ++)
     if (!strcmp(name, models[i][0]))
     {
-     /*
-      * Actually display the PPD file...
-      */
+      //
+      // Actually display the PPD file...
+      //
+
       puts("*PPD-Adobe: \"4.3\"");
 
       puts("*LanguageEncoding: ISOLatin1");
@@ -147,15 +146,15 @@ cat_ppd(const char *uri)          /* I - PPD URI */
 }
 
 
-/*
- * 'list_ppds()' - List PPDs.
- */
+//
+// 'list_ppds()' - List PPDs.
+//
 
-static int                             /* O - Exit status */
-list_ppds(const char *name)            /* I - Program name */
+static int                             // O - Exit status
+list_ppds(const char *name)            // I - Program name
 {
-  int          i;                      /* Looping var */
-  const char   *base;                  /* Base name of program */
+  int          i;                      // Looping var
+  const char   *base;                  // Base name of program
 
 
   if ((base = strrchr(name, '/')) != NULL)
@@ -169,4 +168,3 @@ list_ppds(const char *name)         /* I - Program name */
 
   return (0);
 }
-
index 6028302bd8e89a65e0421633ca00e1e31ba287a1..07625b8fbef0d0da00659a3a40c9272e2f0a6378 100644 (file)
@@ -1,16 +1,16 @@
-/*
- * PPD test program for libppd.
- *
- * Copyright © 2007-2018 by Apple Inc.
- * Copyright © 1997-2006 by Easy Software Products.
- *
- * Licensed under Apache License v2.0.  See the file "LICENSE" for more
- * information.
- */
-
-/*
- * Include necessary headers...
- */
+//
+// PPD test program for libppd.
+//
+// Copyright © 2007-2018 by Apple Inc.
+// Copyright © 1997-2006 by Easy Software Products.
+//
+// Licensed under Apache License v2.0.  See the file "LICENSE" for more
+// information.
+//
+
+//
+// Include necessary headers...
+//
 
 #include "ppd.h"
 #include "array-private.h"
 #else
 #  include <unistd.h>
 #  include <fcntl.h>
-#endif /* _WIN32 */
+#endif // _WIN32
 #include <math.h>
 
 
-/*
- * Local functions...
- */
+//
+// Local functions...
+//
 
-static int     do_ppd_tests(const char *filename, int num_options, cups_option_t *options);
+static int     do_ppd_tests(const char *filename, int num_options,
+                            cups_option_t *options);
 static int     do_ps_tests(void);
 static void    print_changes(cups_page_header2_t *header, cups_page_header2_t *expected);
 
 
-/*
- * Test data...
- */
+//
+// Test data...
+//
 
 static const char *dsc_code =
 "[{\n"
@@ -135,57 +136,57 @@ static const char *setpagedevice_code =
 
 static cups_page_header2_t setpagedevice_header =
 {
-  "Media Class",                       /* MediaClass */
-  "(Media Color)",                     /* MediaColor */
-  "Media\\Type",                       /* MediaType */
-  "Abc",                               /* OutputType */
-  1000,                                        /* AdvanceDistance */
-  CUPS_ADVANCE_FILE,                   /* AdvanceMedia */
-  CUPS_FALSE,                          /* Collate */
-  CUPS_CUT_JOB,                                /* CutMedia */
-  CUPS_TRUE,                           /* Duplex */
-  { 100, 200 },                                /* HWResolution */
-  { 0, 0, 0, 0 },                      /* ImagingBoundingBox */
-  CUPS_TRUE,                           /* InsertSheet */
-  CUPS_JOG_SET,                                /* Jog */
-  CUPS_EDGE_RIGHT,                     /* LeadingEdge */
-  { 0, 0 },                            /* Margins */
-  CUPS_TRUE,                           /* ManualFeed */
-  0777,                                        /* MediaPosition */
-  0xfe01,                              /* MediaWeight */
-  CUPS_TRUE,                           /* MirrorPrint */
-  CUPS_TRUE,                           /* NegativePrint */
-  1,                                   /* NumCopies */
-  CUPS_ORIENT_90,                      /* Orientation */
-  CUPS_TRUE,                           /* OutputFaceUp */
-  { 612, 792 },                                /* PageSize */
-  CUPS_TRUE,                           /* Separations */
-  CUPS_TRUE,                           /* TraySwitch */
-  CUPS_TRUE,                           /* Tumble */
-  0,                                   /* cupsWidth */
-  0,                                   /* cupsHeight */
-  2,                                   /* cupsMediaType */
-  0,                                   /* cupsBitsPerColor */
-  0,                                   /* cupsBitsPerPixel */
-  0,                                   /* cupsBytesPerLine */
-  CUPS_ORDER_BANDED,                   /* cupsColorOrder */
-  CUPS_CSPACE_RGB,                     /* cupsColorSpace */
-  1,                                   /* cupsCompression */
-  1,                                   /* cupsRowCount */
-  1,                                   /* cupsRowFeed */
-  1,                                   /* cupsRowStep */
-  0,                                   /* cupsNumColors */
-  1.001f,                              /* cupsBorderlessScalingFactor */
-  { 612.0f, 792.1f },                  /* cupsPageSize */
-  { 0.0f, 0.0f, 0.0f, 0.0f },          /* cupsImagingBBox */
+  "Media Class",                       // MediaClass
+  "(Media Color)",                     // MediaColor
+  "Media\\Type",                       // MediaType
+  "Abc",                               // OutputType
+  1000,                                        // AdvanceDistance
+  CUPS_ADVANCE_FILE,                   // AdvanceMedia
+  CUPS_FALSE,                          // Collate
+  CUPS_CUT_JOB,                                // CutMedia
+  CUPS_TRUE,                           // Duplex
+  { 100, 200 },                                // HWResolution
+  { 0, 0, 0, 0 },                      // ImagingBoundingBox
+  CUPS_TRUE,                           // InsertSheet
+  CUPS_JOG_SET,                                // Jog
+  CUPS_EDGE_RIGHT,                     // LeadingEdge
+  { 0, 0 },                            // Margins
+  CUPS_TRUE,                           // ManualFeed
+  0777,                                        // MediaPosition
+  0xfe01,                              // MediaWeight
+  CUPS_TRUE,                           // MirrorPrint
+  CUPS_TRUE,                           // NegativePrint
+  1,                                   // NumCopies
+  CUPS_ORIENT_90,                      // Orientation
+  CUPS_TRUE,                           // OutputFaceUp
+  { 612, 792 },                                // PageSize
+  CUPS_TRUE,                           // Separations
+  CUPS_TRUE,                           // TraySwitch
+  CUPS_TRUE,                           // Tumble
+  0,                                   // cupsWidth
+  0,                                   // cupsHeight
+  2,                                   // cupsMediaType
+  0,                                   // cupsBitsPerColor
+  0,                                   // cupsBitsPerPixel
+  0,                                   // cupsBytesPerLine
+  CUPS_ORDER_BANDED,                   // cupsColorOrder
+  CUPS_CSPACE_RGB,                     // cupsColorSpace
+  1,                                   // cupsCompression
+  1,                                   // cupsRowCount
+  1,                                   // cupsRowFeed
+  1,                                   // cupsRowStep
+  0,                                   // cupsNumColors
+  1.001f,                              // cupsBorderlessScalingFactor
+  { 612.0f, 792.1f },                  // cupsPageSize
+  { 0.0f, 0.0f, 0.0f, 0.0f },          // cupsImagingBBox
   { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 },
-                                       /* cupsInteger[16] */
-  { 1.1f, 2.1f, 3.1f, 4.1f, 5.1f, 6.1f, 7.1f, 8.1f, 9.1f, 10.1f, 11.1f, 12.1f, 13.1f, 14.1f, 15.1f, 16.1f },                   /* cupsReal[16] */
+                                       // cupsInteger[16]
+  { 1.1f, 2.1f, 3.1f, 4.1f, 5.1f, 6.1f, 7.1f, 8.1f, 9.1f, 10.1f, 11.1f, 12.1f, 13.1f, 14.1f, 15.1f, 16.1f },                   // cupsReal[16]
   { "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13",
-    "14", "15", "16" },                        /* cupsString[16] */
-  "Marker Type",                       /* cupsMarkerType */
-  "Rendering Intent",                  /* cupsRenderingIntent */
-  "Letter"                             /* cupsPageSizeName */
+    "14", "15", "16" },                        // cupsString[16]
+  "Marker Type",                       // cupsMarkerType
+  "Rendering Intent",                  // cupsRenderingIntent
+  "Letter"                             // cupsPageSizeName
 };
 
 static const char      *default_code =
@@ -289,17 +290,17 @@ static const char *default2_code =
                        "} stopped cleartomark\n";
 
 
-/*
- * '_ppdRasterColorSpaceString()' - Return the colorspace name for a
- *                                   cupsColorSpace value.
- */
+//
+// '_ppdRasterColorSpaceString()' - Return the colorspace name for a
+//                                  cupsColorSpace value.
+//
 
 const char *
 _ppdRasterColorSpaceString(
-    cups_cspace_t cspace)              /* I - cupsColorSpace value */
+    cups_cspace_t cspace)              // I - cupsColorSpace value
 {
   static const char * const cups_color_spaces[] =
-  {                                    /* Color spaces */
+  {                                    // Color spaces
     "W",
     "RGB",
     "RGBA",
@@ -371,9 +372,10 @@ _ppdRasterColorSpaceString(
     return (cups_color_spaces[cspace]);
 }
 
-/*
- * '_log()' - Simple log function
- */
+
+//
+// '_log()' - Simple log function
+//
 
 void
 _log(void *data,
@@ -383,7 +385,7 @@ _log(void *data,
 {
   va_list arglist;
 
-  (void)data; /* No extra data needed */
+  (void)data; // No extra data needed
 
   switch(level)
   {
@@ -404,38 +406,38 @@ _log(void *data,
 }
 
 
-/*
- * 'main()' - Main entry.
- */
+//
+// 'main()' - Main entry.
+//
 
-int                                    /* O - Exit status */
-main(int  argc,                                /* I - Number of command-line arguments */
-     char *argv[])                     /* I - Command-line arguments */
+int                                    // O - Exit status
+main(int  argc,                                // I - Number of command-line arguments
+     char *argv[])                     // I - Command-line arguments
 {
-  int          i;                      /* Looping var */
-  ppd_file_t   *ppd = NULL;            /* PPD file loaded from disk */
-  int          status;                 /* Status of tests (0 = success, 1 = fail) */
-  int          conflicts;              /* Number of conflicts */
-  char         *s;                     /* String */
-  char         buffer[8192];           /* String buffer */
-  const char   *text,                  /* Localized text */
-               *val;                   /* Option value */
-  int          num_options;            /* Number of options */
-  cups_option_t        *options;               /* Options */
-  ppd_size_t   minsize,                /* Minimum size */
-               maxsize,                /* Maximum size */
-               *size;                  /* Current size */
-  ppd_attr_t   *attr;                  /* Current attribute */
-  ppd_cache_t  *pc;                    /* PPD cache */
+  int          i;                      // Looping var
+  ppd_file_t   *ppd = NULL;            // PPD file loaded from disk
+  int          status;                 // Status of tests (0 = success, 1 = fail)
+  int          conflicts;              // Number of conflicts
+  char         *s;                     // String
+  char         buffer[8192];           // String buffer
+  const char   *text,                  // Localized text
+               *val;                   // Option value
+  int          num_options;            // Number of options
+  cups_option_t        *options;               // Options
+  ppd_size_t   minsize,                // Minimum size
+               maxsize,                // Maximum size
+               *size;                  // Current size
+  ppd_attr_t   *attr;                  // Current attribute
+  ppd_cache_t  *pc;                    // PPD cache
 
 
   status = 0;
 
   if (argc == 1)
   {
-   /*
-    * Setup directories for locale stuff...
-    */
+    //
+    // Setup directories for locale stuff...
+    //
 
     if (access("locale", 0))
     {
@@ -449,9 +451,9 @@ main(int  argc,                             /* I - Number of command-line arguments */
     putenv("LOCALEDIR=locale");
     putenv("SOFTWARE=CUPS");
 
-   /*
-    * Do tests with test.ppd...
-    */
+    //
+    // Do tests with test.ppd...
+    //
 
     fputs("ppdOpenFile(\"ppd/test.ppd\"): ", stdout);
 
@@ -459,8 +461,8 @@ main(int  argc,                             /* I - Number of command-line arguments */
       puts("PASS");
     else
     {
-      ppd_status_t     err;            /* Last error in file */
-      int              line;           /* Line number in file */
+      ppd_status_t     err;            // Last error in file
+      int              line;           // Line number in file
 
 
       status ++;
@@ -550,7 +552,8 @@ main(int  argc,                             /* I - Number of command-line arguments */
 
     fputs("ppdEmitString (custom size and string): ", stdout);
     ppdMarkOption(ppd, "PageSize", "Custom.400x500");
-    ppdMarkOption(ppd, "StringOption", "{String1=\"value 1\" String2=value(2)}");
+    ppdMarkOption(ppd, "StringOption",
+                 "{String1=\"value 1\" String2=value(2)}");
 
     if ((s = ppdEmitString(ppd, PPD_ORDER_ANY, 0.0)) != NULL &&
        !strcmp(s, custom_code))
@@ -568,9 +571,9 @@ main(int  argc,                             /* I - Number of command-line arguments */
     if (s)
       free(s);
 
-   /*
-    * Test constraints...
-    */
+    //
+    // Test constraints...
+    //
 
     fputs("ppdGetConflicts(InputSlot=Envelope): ", stdout);
     ppdMarkOption(ppd, "PageSize", "Letter");
@@ -662,15 +665,17 @@ main(int  argc,                           /* I - Number of command-line arguments */
       status ++;
     }
 
-   /*
-    * ppdPageSizeLimits
-    */
+    //
+    // ppdPageSizeLimits
+    //
 
     fputs("ppdPageSizeLimits: ", stdout);
     if (ppdPageSizeLimits(ppd, &minsize, &maxsize))
     {
-      if (fabs(minsize.width - 36.0) > 0.001 || fabs(minsize.length - 36.0) > 0.001 ||
-          fabs(maxsize.width - 1080.0) > 0.001 || fabs(maxsize.length - 86400.0) > 0.001)
+      if (fabs(minsize.width - 36.0) > 0.001 ||
+         fabs(minsize.length - 36.0) > 0.001 ||
+          fabs(maxsize.width - 1080.0) > 0.001 ||
+         fabs(maxsize.length - 86400.0) > 0.001)
       {
         printf("FAIL (got min=%.3fx%.3f, max=%.3fx%.3f, "
               "expected min=36x36, max=1080x86400)\n", minsize.width,
@@ -686,9 +691,9 @@ main(int  argc,                             /* I - Number of command-line arguments */
       status ++;
     }
 
-   /*
-    * ppdMarkOptions with PWG and IPP size names.
-    */
+    //
+    // ppdMarkOptions with PWG and IPP size names.
+    //
 
     fputs("ppdMarkOptions(media=iso-a4): ", stdout);
     num_options = cupsAddOption("media", "iso-a4", 0, &options);
@@ -747,9 +752,9 @@ main(int  argc,                             /* I - Number of command-line arguments */
     else
       puts("PASS");
 
-   /*
-    * Custom sizes...
-    */
+    //
+    // Custom sizes...
+    //
 
     fputs("ppdMarkOptions(media=Custom.8x10in): ", stdout);
     num_options = cupsAddOption("media", "Custom.8x10in", 0, &options);
@@ -768,9 +773,9 @@ main(int  argc,                             /* I - Number of command-line arguments */
     else
       puts("PASS");
 
-   /*
-    * Test localization...
-    */
+    //
+    // Test localization...
+    //
 
     fputs("ppdLocalizeIPPReason(text): ", stdout);
     if (ppdLocalizeIPPReason(ppd, "foo", NULL, buffer, sizeof(buffer)) &&
@@ -842,9 +847,9 @@ main(int  argc,                             /* I - Number of command-line arguments */
       printf("FAIL (\"%s\" instead of \"Number 1 Foo Reason\")\n", buffer);
     }
 
-   /*
-    * cupsMarkerName localization...
-    */
+    //
+    // cupsMarkerName localization...
+    //
 
     putenv("LANG=en");
     putenv("LC_ALL=en");
@@ -907,9 +912,9 @@ main(int  argc,                             /* I - Number of command-line arguments */
 
     ppdClose(ppd);
 
-   /*
-    * Test new constraints...
-    */
+    //
+    // Test new constraints...
+    //
 
     fputs("ppdOpenFile(\"ppd/test2.ppd\"): ", stdout);
 
@@ -917,8 +922,8 @@ main(int  argc,                             /* I - Number of command-line arguments */
       puts("PASS");
     else
     {
-      ppd_status_t     err;            /* Last error in file */
-      int              line;           /* Line number in file */
+      ppd_status_t     err;            // Last error in file
+      int              line;           // Line number in file
 
 
       status ++;
@@ -1039,17 +1044,19 @@ main(int  argc,                         /* I - Number of command-line arguments */
       status ++;
     }
 
-   /*
-    * ppdPageSizeLimits
-    */
+    //
+    // ppdPageSizeLimits
+    //
 
     ppdMarkDefaults(ppd);
 
     fputs("ppdPageSizeLimits(default): ", stdout);
     if (ppdPageSizeLimits(ppd, &minsize, &maxsize))
     {
-      if (fabs(minsize.width - 36.0) > 0.001 || fabs(minsize.length - 36.0) > 0.001 ||
-          fabs(maxsize.width - 1080.0) > 0.001 || fabs(maxsize.length - 86400.0) > 0.001)
+      if (fabs(minsize.width - 36.0) > 0.001 ||
+         fabs(minsize.length - 36.0) > 0.001 ||
+          fabs(maxsize.width - 1080.0) > 0.001 ||
+         fabs(maxsize.length - 86400.0) > 0.001)
       {
         printf("FAIL (got min=%.0fx%.0f, max=%.0fx%.0f, "
               "expected min=36x36, max=1080x86400)\n", minsize.width,
@@ -1070,8 +1077,10 @@ main(int  argc,                          /* I - Number of command-line arguments */
     fputs("ppdPageSizeLimits(InputSlot=Manual): ", stdout);
     if (ppdPageSizeLimits(ppd, &minsize, &maxsize))
     {
-      if (fabs(minsize.width - 100.0) > 0.001 || fabs(minsize.length - 100.0) > 0.001 ||
-          fabs(maxsize.width - 1000.0) > 0.001 || fabs(maxsize.length - 1000.0) > 0.001)
+      if (fabs(minsize.width - 100.0) > 0.001 ||
+         fabs(minsize.length - 100.0) > 0.001 ||
+          fabs(maxsize.width - 1000.0) > 0.001 ||
+         fabs(maxsize.length - 1000.0) > 0.001)
       {
         printf("FAIL (got min=%.0fx%.0f, max=%.0fx%.0f, "
               "expected min=100x100, max=1000x1000)\n", minsize.width,
@@ -1092,8 +1101,10 @@ main(int  argc,                          /* I - Number of command-line arguments */
     fputs("ppdPageSizeLimits(Quality=Photo): ", stdout);
     if (ppdPageSizeLimits(ppd, &minsize, &maxsize))
     {
-      if (fabs(minsize.width - 200.0) > 0.001 || fabs(minsize.length - 200.0) > 0.001 ||
-          fabs(maxsize.width - 1000.0) > 0.001 || fabs(maxsize.length - 1000.0) > 0.001)
+      if (fabs(minsize.width - 200.0) > 0.001 ||
+         fabs(minsize.length - 200.0) > 0.001 ||
+          fabs(maxsize.width - 1000.0) > 0.001 ||
+         fabs(maxsize.length - 1000.0) > 0.001)
       {
         printf("FAIL (got min=%.0fx%.0f, max=%.0fx%.0f, "
               "expected min=200x200, max=1000x1000)\n", minsize.width,
@@ -1114,8 +1125,10 @@ main(int  argc,                          /* I - Number of command-line arguments */
     fputs("ppdPageSizeLimits(Quality=Photo): ", stdout);
     if (ppdPageSizeLimits(ppd, &minsize, &maxsize))
     {
-      if (fabs(minsize.width - 300.0) > 0.001 || fabs(minsize.length - 300.0) > 0.001 ||
-          fabs(maxsize.width - 1080.0) > 0.001 || fabs(maxsize.length - 86400.0) > 0.001)
+      if (fabs(minsize.width - 300.0) > 0.001 ||
+         fabs(minsize.length - 300.0) > 0.001 ||
+          fabs(maxsize.width - 1080.0) > 0.001 ||
+         fabs(maxsize.length - 86400.0) > 0.001)
       {
         printf("FAIL (got min=%.0fx%.0f, max=%.0fx%.0f, "
               "expected min=300x300, max=1080x86400)\n", minsize.width,
@@ -1175,8 +1188,8 @@ main(int  argc,                           /* I - Number of command-line arguments */
           (s = strcasestr(argv[1], ".ppd")) == NULL ||
           s[4] != '\0')
   {
-    /* First argument is not FILE.ppd but DIR or DIR,DIR,... ->
-       PPD directory list -> See whether we have valid PPD collection */
+    // First argument is not FILE.ppd but DIR or DIR,DIR,... ->
+    // PPD directory list -> See whether we have valid PPD collection
 
     cups_array_t *dirlist = _ppdArrayNewStrings(argv[1], ',');
     cups_array_t *ppd_collections = cupsArrayNew(NULL, NULL);
@@ -1255,8 +1268,8 @@ main(int  argc,                           /* I - Number of command-line arguments */
       if ((ppd = ppdOpen2(ppdCollectionGetPPD(testname, ppd_collections,
                                              _log, NULL))) == NULL)
       {
-       ppd_status_t    err;            /* Last error in file */
-       int             line;           /* Line number in file */
+       ppd_status_t    err;            // Last error in file
+       int             line;           // Line number in file
 
        status ++;
        err = ppdLastError(&line);
@@ -1296,9 +1309,9 @@ main(int  argc,                           /* I - Number of command-line arguments */
   }
   else
   {
-    const char *name;                  /* PPD name */
-    char       *filename;              /* Name of actual file containing PPD */
-    struct stat        fileinfo;               /* File information */
+    const char *name;                  // PPD name
+    char       *filename;              // Name of actual file containing PPD
+    struct stat        fileinfo;               // File information
 
     name = argv[1];
     filename = strdup(name);
@@ -1313,8 +1326,8 @@ main(int  argc,                           /* I - Number of command-line arguments */
 
     if (S_ISLNK(fileinfo.st_mode))
     {
-      char     realfile[1024];         /* Real file path */
-      ssize_t  realsize;               /* Size of real file path */
+      char     realfile[1024];         // Real file path
+      ssize_t  realsize;               // Size of real file path
 
 
       if ((realsize = readlink(filename, realfile, sizeof(realfile) - 1)) < 0)
@@ -1341,8 +1354,8 @@ main(int  argc,                           /* I - Number of command-line arguments */
     if ((ppd = ppdOpen2(ppdCollectionGetPPD(name, NULL, _log, NULL))) ==
        NULL)
     {
-      ppd_status_t     err;            /* Last error in file */
-      int              line;           /* Line number in file */
+      ppd_status_t     err;            // Last error in file
+      int              line;           // Line number in file
 
 
       status ++;
@@ -1352,16 +1365,16 @@ main(int  argc,                         /* I - Number of command-line arguments */
     }
     else
     {
-      int              j, k;           /* Looping vars */
-      ppd_group_t      *group;         /* Option group */
-      ppd_option_t     *option;        /* Option */
-      ppd_coption_t    *coption;       /* Custom option */
-      ppd_cparam_t     *cparam;        /* Custom parameter */
-      ppd_const_t      *c;             /* UIConstraints */
-      char             lang[255],      /* LANG environment variable */
-                       lc_all[255],    /* LC_ALL environment variable */
-                       lc_ctype[255],  /* LC_CTYPE environment variable */
-                       lc_messages[255];/* LC_MESSAGES environment variable */
+      int              j, k;           // Looping vars
+      ppd_group_t      *group;         // Option group
+      ppd_option_t     *option;        // Option
+      ppd_coption_t    *coption;       // Custom option
+      ppd_cparam_t     *cparam;        // Custom parameter
+      ppd_const_t      *c;             // UIConstraints
+      char             lang[255],      // LANG environment variable
+                       lc_all[255],    // LC_ALL environment variable
+                       lc_ctype[255],  // LC_CTYPE environment variable
+                       lc_messages[255];// LC_MESSAGES environment variable
 
 
       if (argc > 2)
@@ -1413,7 +1426,8 @@ main(int  argc,                           /* I - Number of command-line arguments */
              switch (cparam->type)
              {
                case PPD_CUSTOM_UNKNOWN :
-                   printf("              %s(%s): PPD_CUSTOM_UNKNOWN (error)\n", cparam->name, cparam->text);
+                   printf("              %s(%s): PPD_CUSTOM_UNKNOWN (error)\n",
+                          cparam->name, cparam->text);
                    break;
 
                case PPD_CUSTOM_CURVE :
@@ -1523,14 +1537,14 @@ main(int  argc,                         /* I - Number of command-line arguments */
 #ifdef __APPLE__
   if (getenv("MallocStackLogging") && getenv("MallocStackLoggingNoCompact"))
   {
-    char       command[1024];          /* malloc_history command */
+    char       command[1024];          // malloc_history command
 
     snprintf(command, sizeof(command), "malloc_history %d -all_by_size",
             getpid());
     fflush(stdout);
     system(command);
   }
-#endif /* __APPLE__ */
+#endif // __APPLE__
 
   ppdClose(ppd);
 
@@ -1538,17 +1552,17 @@ main(int  argc,                         /* I - Number of command-line arguments */
 }
 
 
-/*
- * 'do_ppd_tests()' - Test the default option commands in a PPD file.
- */
+//
+// 'do_ppd_tests()' - Test the default option commands in a PPD file.
+//
 
-static int                             /* O - Number of errors */
-do_ppd_tests(const char    *filename,  /* I - PPD file */
-             int           num_options,        /* I - Number of options */
-             cups_option_t *options)   /* I - Options */
+static int                             // O - Number of errors
+do_ppd_tests(const char    *filename,  // I - PPD file
+             int           num_options,        // I - Number of options
+             cups_option_t *options)   // I - Options
 {
-  ppd_file_t           *ppd;           /* PPD file data */
-  cups_page_header2_t  header;         /* Page header */
+  ppd_file_t           *ppd;           // PPD file data
+  cups_page_header2_t  header;         // Page header
 
 
   printf("\"%s\": ", filename);
@@ -1556,8 +1570,8 @@ do_ppd_tests(const char    *filename,     /* I - PPD file */
 
   if ((ppd = ppdOpenFile(filename)) == NULL)
   {
-    ppd_status_t       status;         /* Status from PPD loader */
-    int                        line;           /* Line number containing error */
+    ppd_status_t       status;         // Status from PPD loader
+    int                        line;           // Line number containing error
 
 
     status = ppdLastError(&line);
@@ -1587,21 +1601,21 @@ do_ppd_tests(const char    *filename,   /* I - PPD file */
 }
 
 
-/*
- * 'do_ps_tests()' - Test standard PostScript commands.
- */
+//
+// 'do_ps_tests()' - Test standard PostScript commands.
+//
 
 static int
 do_ps_tests(void)
 {
-  cups_page_header2_t  header;         /* Page header */
-  int                  preferred_bits; /* Preferred bits */
-  int                  errors = 0;     /* Number of errors */
+  cups_page_header2_t  header;         // Page header
+  int                  preferred_bits; // Preferred bits
+  int                  errors = 0;     // Number of errors
 
 
- /*
-  * Test PS exec code...
-  */
+  //
+  // Test PS exec code...
+  //
 
   fputs("ppdRasterExecPS(\"setpagedevice\"): ", stdout);
   fflush(stdout);
@@ -1713,18 +1727,16 @@ do_ps_tests(void)
 }
 
 
-
-
-/*
- * 'print_changes()' - Print differences in the page header.
- */
+//
+// 'print_changes()' - Print differences in the page header.
+//
 
 static void
 print_changes(
-    cups_page_header2_t *header,       /* I - Actual page header */
-    cups_page_header2_t *expected)     /* I - Expected page header */
+    cups_page_header2_t *header,       // I - Actual page header
+    cups_page_header2_t *expected)     // I - Expected page header
 {
-  int  i;                              /* Looping var */
+  int  i;                              // Looping var
 
 
   if (strcmp(header->MediaClass, expected->MediaClass))
@@ -1878,7 +1890,8 @@ print_changes(
            expected->cupsColorOrder);
 
   if (header->cupsColorSpace != expected->cupsColorSpace)
-    printf("    cupsColorSpace %s, expected %s\n", _ppdRasterColorSpaceString(header->cupsColorSpace),
+    printf("    cupsColorSpace %s, expected %s\n",
+          _ppdRasterColorSpaceString(header->cupsColorSpace),
            _ppdRasterColorSpaceString(expected->cupsColorSpace));
 
   if (header->cupsCompression != expected->cupsCompression)
@@ -1901,7 +1914,8 @@ print_changes(
     printf("    cupsNumColors %d, expected %d\n", header->cupsNumColors,
            expected->cupsNumColors);
 
-  if (fabs(header->cupsBorderlessScalingFactor - expected->cupsBorderlessScalingFactor) > 0.001)
+  if (fabs(header->cupsBorderlessScalingFactor -
+          expected->cupsBorderlessScalingFactor) > 0.001)
     printf("    cupsBorderlessScalingFactor %g, expected %g\n",
            header->cupsBorderlessScalingFactor,
            expected->cupsBorderlessScalingFactor);
index 18eadaed3692a68e52ae9d0f3ec25a50b5ce9c78..5ead9039424a9b1fe0a6987bbd31e2c502ccf2b4 100644 (file)
@@ -1,31 +1,32 @@
-/*
- * Private threading definitions for libppd.
- *
- * Copyright 2009-2017 by Apple Inc.
- *
- * Licensed under Apache License v2.0.  See the file "LICENSE" for more information.
- */
+//
+// Private threading definitions for libppd.
+//
+// Copyright 2009-2017 by Apple Inc.
+//
+// Licensed under Apache License v2.0.  See the file "LICENSE" for more
+// information.
+//
 
 #ifndef _PPD_THREAD_PRIVATE_H_
 #  define _PPD_THREAD_PRIVATE_H_
 
-/*
- * Include necessary headers...
- */
+//
+// Include necessary headers...
+//
 
 #  include "config.h"
 
 
-/*
- * C++ magic...
- */
+//
+// C++ magic...
+//
 
 #  ifdef __cplusplus
 extern "C" {
-#  endif /* __cplusplus */
+#  endif // __cplusplus
 
 
-#  ifdef HAVE_PTHREAD_H                        /* POSIX threading */
+#  ifdef HAVE_PTHREAD_H                        // POSIX threading
 #    include <pthread.h>
 typedef pthread_mutex_t _ppd_mutex_t;
 typedef pthread_key_t  _ppd_threadkey_t;
@@ -34,14 +35,14 @@ typedef pthread_key_t       _ppd_threadkey_t;
 #    define _ppdThreadGetData(k) pthread_getspecific(k)
 #    define _ppdThreadSetData(k,p) pthread_setspecific(k,p)
 
-#  elif defined(_WIN32)                        /* Windows threading */
+#  elif defined(_WIN32)                        // Windows threading
 #    include <winsock2.h>
 #    include <windows.h>
 typedef struct _ppd_mutex_s
 {
-  int                  m_init;         /* Flag for on-demand initialization */
+  int                  m_init;         // Flag for on-demand initialization
   CRITICAL_SECTION     m_criticalSection;
-                                       /* Win32 Critical Section */
+                                       // Win32 Critical Section
 } _ppd_mutex_t;
 typedef DWORD  _ppd_threadkey_t;
 #    define _PPD_MUTEX_INITIALIZER { 0, 0 }
@@ -49,19 +50,19 @@ typedef DWORD       _ppd_threadkey_t;
 #    define _ppdThreadGetData(k) TlsGetValue(k)
 #    define _ppdThreadSetData(k,p) TlsSetValue(k,p)
 
-#  else                                        /* No threading */
+#  else                                        // No threading
 typedef char   _ppd_mutex_t;
 typedef void   *_ppd_threadkey_t;
 #    define _PPD_MUTEX_INITIALIZER 0
 #    define _PPD_THREADKEY_INITIALIZER (void *)0
 #    define _ppdThreadGetData(k) k
 #    define _ppdThreadSetData(k,p) k=p
-#  endif /* HAVE_PTHREAD_H */
+#  endif // HAVE_PTHREAD_H
 
 
-/*
- * Functions...
- */
+//
+// Functions...
+//
 
 extern void    _ppdMutexInit(_ppd_mutex_t *mutex);
 extern void    _ppdMutexLock(_ppd_mutex_t *mutex);
@@ -69,5 +70,5 @@ extern void   _ppdMutexUnlock(_ppd_mutex_t *mutex);
 
 #  ifdef __cplusplus
 }
-#  endif /* __cplusplus */
-#endif /* !_PPD_THREAD_PRIVATE_H_ */
+#  endif // __cplusplus
+#endif // !_PPD_THREAD_PRIVATE_H_
index 1c05231ea17f5cf2e4fc47db5c46b22fb3a0e098..d62f0011d23da33e6abdd796a7a21a8f8f22f6de 100644 (file)
@@ -1,48 +1,48 @@
-/*
- * Threading primitives for libppd.
- *
- * Copyright © 2009-2018 by Apple Inc.
- *
- * Licensed under Apache License v2.0.  See the file "LICENSE" for more
- * information.
- */
-
-/*
- * Include necessary headers...
- */
+//
+// Threading primitives for libppd.
+//
+// Copyright © 2009-2018 by Apple Inc.
+//
+// Licensed under Apache License v2.0.  See the file "LICENSE" for more
+// information.
+//
+
+//
+// Include necessary headers...
+//
 
 #include "thread-private.h"
 
 
 #if defined(HAVE_PTHREAD_H)
-/*
- * '_ppdMutexInit()' - Initialize a mutex.
- */
+//
+// '_ppdMutexInit()' - Initialize a mutex.
+//
 
 void
-_ppdMutexInit(_ppd_mutex_t *mutex)     /* I - Mutex */
+_ppdMutexInit(_ppd_mutex_t *mutex)     // I - Mutex
 {
   pthread_mutex_init(mutex, NULL);
 }
 
 
-/*
- * '_ppdMutexLock()' - Lock a mutex.
- */
+//
+// '_ppdMutexLock()' - Lock a mutex.
+//
 
 void
-_ppdMutexLock(_ppd_mutex_t *mutex)     /* I - Mutex */
+_ppdMutexLock(_ppd_mutex_t *mutex)     // I - Mutex
 {
   pthread_mutex_lock(mutex);
 }
 
 
-/*
- * '_ppdMutexUnlock()' - Unlock a mutex.
- */
+//
+// '_ppdMutexUnlock()' - Unlock a mutex.
+//
 
 void
-_ppdMutexUnlock(_ppd_mutex_t *mutex)   /* I - Mutex */
+_ppdMutexUnlock(_ppd_mutex_t *mutex)   // I - Mutex
 {
   pthread_mutex_unlock(mutex);
 }
@@ -52,27 +52,27 @@ _ppdMutexUnlock(_ppd_mutex_t *mutex)        /* I - Mutex */
 #  include <process.h>
 
 static _ppd_mutex_t    ppd_global_mutex = _CUPS_MUTEX_INITIALIZER;
-                                        /* Global critical section */
+                                        // Global critical section
 
 
-/*
- * '_ppdMutexInit()' - Initialize a mutex.
- */
+//
+// '_ppdMutexInit()' - Initialize a mutex.
+//
 
 void
-_ppdMutexInit(_ppd_mutex_t *mutex)     /* I - Mutex */
+_ppdMutexInit(_ppd_mutex_t *mutex)     // I - Mutex
 {
   InitializeCriticalSection(&mutex->m_criticalSection);
   mutex->m_init = 1;
 }
 
 
-/*
- * '_ppdMutexLock()' - Lock a mutex.
- */
+//
+// '_ppdMutexLock()' - Lock a mutex.
+//
 
 void
-_ppdMutexLock(_ppd_mutex_t *mutex)     /* I - Mutex */
+_ppdMutexLock(_ppd_mutex_t *mutex)     // I - Mutex
 {
   if (!mutex->m_init)
   {
@@ -91,51 +91,51 @@ _ppdMutexLock(_ppd_mutex_t *mutex)  /* I - Mutex */
 }
 
 
-/*
- * '_ppdMutexUnlock()' - Unlock a mutex.
- */
+//
+// '_ppdMutexUnlock()' - Unlock a mutex.
+//
 
 void
-_ppdMutexUnlock(_ppd_mutex_t *mutex)   /* I - Mutex */
+_ppdMutexUnlock(_ppd_mutex_t *mutex)   // I - Mutex
 {
   LeaveCriticalSection(&mutex->m_criticalSection);
 }
 
 
-#else /* No threading */
+#else // No threading
 
 
-/*
- * '_ppdMutexInit()' - Initialize a mutex.
- */
+//
+// '_ppdMutexInit()' - Initialize a mutex.
+//
 
 void
-_ppdMutexInit(_ppd_mutex_t *mutex)     /* I - Mutex */
+_ppdMutexInit(_ppd_mutex_t *mutex)     // I - Mutex
 {
   (void)mutex;
 }
 
 
-/*
- * '_ppdMutexLock()' - Lock a mutex.
- */
+//
+// '_ppdMutexLock()' - Lock a mutex.
+//
 
 void
-_ppdMutexLock(_ppd_mutex_t *mutex)     /* I - Mutex */
+_ppdMutexLock(_ppd_mutex_t *mutex)     // I - Mutex
 {
   (void)mutex;
 }
 
 
-/*
- * '_ppdMutexUnlock()' - Unlock a mutex.
- */
+//
+// '_ppdMutexUnlock()' - Unlock a mutex.
+//
 
 void
-_ppdMutexUnlock(_ppd_mutex_t *mutex)   /* I - Mutex */
+_ppdMutexUnlock(_ppd_mutex_t *mutex)   // I - Mutex
 {
   (void)mutex;
 }
 
 
-#endif /* HAVE_PTHREAD_H */
+#endif // HAVE_PTHREAD_H