]> git.ipfire.org Git - thirdparty/cups.git/blobdiff - ppdc/ppdc-option.cxx
Fix source file header text duplication text duplication.
[thirdparty/cups.git] / ppdc / ppdc-option.cxx
index 3eb46aaa693739a5c5937efdddeb16e729f9d79c..dcefd107b95b5872c9b67b891b79928d4ebc752e 100644 (file)
@@ -1,31 +1,21 @@
 //
-// "$Id$"
+// Option class for the CUPS PPD Compiler.
 //
-//   Option class for the CUPS PPD Compiler.
+// Copyright 2007-2011 by Apple Inc.
+// Copyright 2002-2005 by Easy Software Products.
 //
-//   Copyright 2007 by Apple Inc.
-//   Copyright 2002-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 "LICENSE.txt"
-//   which should have been included with this file.  If this file is
-//   file is missing or damaged, see the license at "http://www.cups.org/".
-//
-// Contents:
-//
-//   ppdcOption::ppdcOption()    - Create a new option.
-//   ppdcOption::ppdcOption()    - Copy a new option.
-//   ppdcOption::~ppdcOption()   - Destroy an option.
-//   ppdcOption::find_choice()   - Find an option choice.
-//   ppdcOption::set_defchoice() - Set the default choice.
+// These coded instructions, statements, and computer programs are the
+// property of Apple Inc. and are protected by Federal copyright
+// law.  Distribution and use rights are outlined in the file "LICENSE.txt"
+// which should have been included with this file.  If this file is
+// missing or damaged, see the license at "http://www.cups.org/".
 //
 
 //
 // Include necessary headers...
 //
 
-#include "ppdc.h"
+#include "ppdc-private.h"
 
 
 //
@@ -37,9 +27,9 @@ ppdcOption::ppdcOption(ppdcOptType    ot,     // I - Option type
                       const char     *t,       // I - Option text
                       ppdcOptSection s,        // I - Section
                        float          o)       // I - Ordering number
+  : ppdcShared()
 {
-//  printf("ppdcOption(ot=%d, n=\"%s\", t=\"%s\"), this=%p\n",
-//         ot, n, t, this);
+  PPDC_NEW;
 
   type      = ot;
   name      = new ppdcString(n);
@@ -57,10 +47,12 @@ ppdcOption::ppdcOption(ppdcOptType    ot,   // I - Option type
 
 ppdcOption::ppdcOption(ppdcOption *o)          // I - Template option
 {
-  o->name->get();
-  o->text->get();
+  PPDC_NEW;
+
+  o->name->retain();
+  o->text->retain();
   if (o->defchoice)
-    o->defchoice->get();
+    o->defchoice->retain();
 
   type      = o->type;
   name      = o->name;
@@ -78,11 +70,13 @@ ppdcOption::ppdcOption(ppdcOption *o)               // I - Template option
 
 ppdcOption::~ppdcOption()
 {
+  PPDC_DELETE;
+
   name->release();
   text->release();
   if (defchoice)
     defchoice->release();
-  delete choices;
+  choices->release();
 }
 
 
@@ -97,7 +91,7 @@ ppdcOption::find_choice(const char *n)                // I - Name of choice
 
 
   for (c = (ppdcChoice *)choices->first(); c; c = (ppdcChoice *)choices->next())
-    if (!strcasecmp(n, c->name->value))
+    if (!_cups_strcasecmp(n, c->name->value))
       return (c);
 
   return (0);
@@ -115,12 +109,7 @@ ppdcOption::set_defchoice(ppdcChoice *c)   // I - Choice
     defchoice->release();
 
   if (c->name)
-    c->name->get();
+    c->name->retain();
 
   defchoice = c->name;
 }
-
-
-//
-// End of "$Id$".
-//