]> git.ipfire.org Git - thirdparty/cups.git/blobdiff - filter/textcommon.c
Merge changes from CUPS 1.5.1-r9875.
[thirdparty/cups.git] / filter / textcommon.c
index f8a2634f9a2402cc91a1bbdf67b87e9c75f6f141..8101cafba873234495d697ae42290614f2cf4aa5 100644 (file)
@@ -1,9 +1,9 @@
 /*
  * "$Id: textcommon.c 6649 2007-07-11 21:46:42Z mike $"
  *
- *   Common text filter routines for the Common UNIX Printing System (CUPS).
+ *   Common text filter routines for CUPS.
  *
- *   Copyright 2007-2009 by Apple Inc.
+ *   Copyright 2007-2011 by Apple Inc.
  *   Copyright 1997-2007 by Easy Software Products.
  *
  *   These coded instructions, statements, and computer programs are the
@@ -26,7 +26,7 @@
  */
 
 #include "textcommon.h"
-#include <cups/i18n.h>
+#include <cups/language-private.h>
 
 
 /*
@@ -515,7 +515,7 @@ TextMain(const char *name,  /* I - Name of filter */
   if (argc < 6 || argc > 7)
   {
     _cupsLangPrintf(stderr,
-                    _("Usage: %s job-id user title copies options [file]\n"),
+                    _("Usage: %s job-id user title copies options [file]"),
                     name);
     return (1);
   }
@@ -548,8 +548,8 @@ TextMain(const char *name,  /* I - Name of filter */
   num_options = cupsParseOptions(argv[5], 0, &options);
 
   if ((val = cupsGetOption("prettyprint", num_options, options)) != NULL &&
-      strcasecmp(val, "no") && strcasecmp(val, "off") &&
-      strcasecmp(val, "false"))
+      _cups_strcasecmp(val, "no") && _cups_strcasecmp(val, "off") &&
+      _cups_strcasecmp(val, "false"))
   {
     PageLeft     = 72.0f;
     PageRight    = PageWidth - 36.0f;
@@ -564,25 +564,25 @@ TextMain(const char *name,        /* I - Name of filter */
       NumKeywords = 0;
       Keywords    = NULL;
     }
-    else if (strcasecmp(val, "application/x-cshell") == 0)
+    else if (_cups_strcasecmp(val, "application/x-cshell") == 0)
     {
       PrettyPrint = PRETTY_SHELL;
       NumKeywords = sizeof(csh_keywords) / sizeof(csh_keywords[0]);
       Keywords    = csh_keywords;
     }
-    else if (strcasecmp(val, "application/x-csource") == 0)
+    else if (_cups_strcasecmp(val, "application/x-csource") == 0)
     {
       PrettyPrint = PRETTY_CODE;
       NumKeywords = sizeof(code_keywords) / sizeof(code_keywords[0]);
       Keywords    = code_keywords;
     }
-    else if (strcasecmp(val, "application/x-perl") == 0)
+    else if (_cups_strcasecmp(val, "application/x-perl") == 0)
     {
       PrettyPrint = PRETTY_PERL;
       NumKeywords = sizeof(perl_keywords) / sizeof(perl_keywords[0]);
       Keywords    = perl_keywords;
     }
-    else if (strcasecmp(val, "application/x-shell") == 0)
+    else if (_cups_strcasecmp(val, "application/x-shell") == 0)
     {
       PrettyPrint = PRETTY_SHELL;
       NumKeywords = sizeof(sh_keywords) / sizeof(sh_keywords[0]);
@@ -601,8 +601,8 @@ TextMain(const char *name,  /* I - Name of filter */
   if ((val = cupsGetOption("wrap", num_options, options)) == NULL)
     WrapLines = 1;
   else
-    WrapLines = !strcasecmp(val, "true") || !strcasecmp(val, "on") ||
-                !strcasecmp(val, "yes");
+    WrapLines = !_cups_strcasecmp(val, "true") || !_cups_strcasecmp(val, "on") ||
+                !_cups_strcasecmp(val, "yes");
 
   if ((val = cupsGetOption("columns", num_options, options)) != NULL)
   {
@@ -610,7 +610,8 @@ TextMain(const char *name,  /* I - Name of filter */
 
     if (PageColumns < 1)
     {
-      _cupsLangPrintf(stderr, _("ERROR: Bad columns value %d\n"), PageColumns);
+      _cupsLangPrintFilter(stderr, "ERROR", _("Bad columns value %d."),
+                           PageColumns);
       return (1);
     }
   }
@@ -621,7 +622,8 @@ TextMain(const char *name,  /* I - Name of filter */
 
     if (CharsPerInch <= 0.0)
     {
-      _cupsLangPrintf(stderr, _("ERROR: Bad cpi value %f\n"), CharsPerInch);
+      _cupsLangPrintFilter(stderr, "ERROR", _("Bad cpi value %f."),
+                           CharsPerInch);
       return (1);
     }
   }
@@ -632,7 +634,8 @@ TextMain(const char *name,  /* I - Name of filter */
 
     if (LinesPerInch <= 0.0)
     {
-      _cupsLangPrintf(stderr, _("ERROR: Bad lpi value %f\n"), LinesPerInch);
+      _cupsLangPrintFilter(stderr, "ERROR", _("Bad lpi value %f."),
+                           LinesPerInch);
       return (1);
     }
   }
@@ -1089,7 +1092,7 @@ TextMain(const char *name,        /* I - Name of filter */
          }
 
           column ++;
-          break;          
+          break;
     }
 
    /*