]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
Mirror 1.1.x changes...
authormike <mike@7a7537e8-13f0-0310-91df-b6672ffda945>
Fri, 24 Jan 2003 20:45:20 +0000 (20:45 +0000)
committermike <mike@7a7537e8-13f0-0310-91df-b6672ffda945>
Fri, 24 Jan 2003 20:45:20 +0000 (20:45 +0000)
git-svn-id: svn+ssh://src.apple.com/svn/cups/cups.org/branches/branch-1.2@3147 7a7537e8-13f0-0310-91df-b6672ffda945

23 files changed:
CHANGES-1.1.txt
cups/dest.c
cups/encode.c
cups/http-addr.c
cups/http.c
cups/ipp-support.c
cups/ipp.c
cups/ipp.h
cups/language.c
cups/md5passwd.c
cups/ppd.c
cups/tempfile.c
cups/testlang.c
cups/usersys.c
cups/util.c
filter/image-colorspace.c
filter/image-gif.c
scheduler/auth.c
scheduler/cert.c
scheduler/client.c
scheduler/cups-lpd.c
scheduler/cups-polld.c
scheduler/log.c

index 6f86bc2c5bc9d343f60d0570fb491a03d4543f76..8d5b8043234f6f3dcd5f4a7c4c06260759562413 100644 (file)
@@ -3,6 +3,8 @@ CHANGES-1.1.txt
 
 CHANGES IN CUPS V1.1.19
 
+       - Merged several weight-reducing changes into the CUPS
+         baseline donated by Apple.
        - Added preliminary support for CDSA; patch provided by
          Apple.
        - Implicit classes are now created from identical
index 0c7144e48e9c4dff8adfc16b389763ca0da20bbd..075d4f1e6dd661365592025c7d8c6d811c1e26c5 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * "$Id: dest.c,v 1.18.2.11 2003/01/07 18:26:24 mike Exp $"
+ * "$Id: dest.c,v 1.18.2.12 2003/01/24 20:45:10 mike Exp $"
  *
  *   User-defined destination (and option) support for the Common UNIX
  *   Printing System (CUPS).
@@ -668,7 +668,7 @@ cups_get_sdests(ipp_op_t    op,             /* I - get-printers or get-classes */
   cups_lang_t  *language;              /* Default language */
   const char   *name;                  /* printer-name attribute */
   char         job_sheets[1024];       /* job-sheets option */
-  static const char    *pattrs[] =     /* Attributes we're interested in */
+  static const char * const pattrs[] = /* Attributes we're interested in */
                {
                  "printer-name",
                  "job-sheets-default"
@@ -794,5 +794,5 @@ cups_get_sdests(ipp_op_t    op,             /* I - get-printers or get-classes */
 
 
 /*
- * End of "$Id: dest.c,v 1.18.2.11 2003/01/07 18:26:24 mike Exp $".
+ * End of "$Id: dest.c,v 1.18.2.12 2003/01/24 20:45:10 mike Exp $".
  */
index c6b656cf71798841a6692e6c6aba9d254dd05337..2bf6abb5ec7204ec931e98b601b7f9ecf4da97d5 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * "$Id: encode.c,v 1.1.2.10 2003/01/07 18:26:24 mike Exp $"
+ * "$Id: encode.c,v 1.1.2.11 2003/01/24 20:45:11 mike Exp $"
  *
  *   Option encoding routines for the Common UNIX Printing System (CUPS).
  *
@@ -49,7 +49,7 @@ typedef struct
   ipp_tag_t    value_tag;
 } ipp_option_t;
 
-static ipp_option_t    ipp_options[] =
+static const ipp_option_t ipp_options[] =
                        {
                          { "blackplot",                IPP_TAG_BOOLEAN },
                          { "brightness",               IPP_TAG_INTEGER },
@@ -380,5 +380,5 @@ cupsEncodeOptions(ipp_t         *ipp,               /* I - Request to add to */
 
 
 /*
- * End of "$Id: encode.c,v 1.1.2.10 2003/01/07 18:26:24 mike Exp $".
+ * End of "$Id: encode.c,v 1.1.2.11 2003/01/24 20:45:11 mike Exp $".
  */
index f5d0705fce2d46c69e16118aec504e9ab7567719..12c5e7f5de1040fa1a8b198c68862e79f7048a1c 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * "$Id: http-addr.c,v 1.1.2.9 2003/01/14 14:34:14 mike Exp $"
+ * "$Id: http-addr.c,v 1.1.2.10 2003/01/24 20:45:11 mike Exp $"
  *
  *   HTTP address routines for the Common UNIX Printing System (CUPS).
  *
@@ -217,9 +217,10 @@ httpGetHostByName(const char *name)        /* I - Hostname or IP address */
   static char          *packed_ptr[2]; /* Pointer to packed address */
   static struct hostent        host_ip;        /* Host entry for IP address */
 
+
 #if defined(__APPLE__)
   /* OS X hack to avoid it's ocassional long delay in lookupd */
-  static char sLoopback[] = "127.0.0.1";
+  static const char sLoopback[] = "127.0.0.1";
   if (strcmp(name, "localhost") == 0)
     name = sLoopback;
 #endif /* __APPLE__ */
@@ -276,5 +277,5 @@ httpGetHostByName(const char *name) /* I - Hostname or IP address */
 
 
 /*
- * End of "$Id: http-addr.c,v 1.1.2.9 2003/01/14 14:34:14 mike Exp $".
+ * End of "$Id: http-addr.c,v 1.1.2.10 2003/01/24 20:45:11 mike Exp $".
  */
index 2e2c7adee126c0990b7f51b032b4d88c7dc7e7a4..8e628743b1d7f21090b418796cae5b8b90ce8aae 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * "$Id: http.c,v 1.82.2.24 2003/01/24 19:19:42 mike Exp $"
+ * "$Id: http.c,v 1.82.2.25 2003/01/24 20:45:11 mike Exp $"
  *
  *   HTTP routines for the Common UNIX Printing System (CUPS).
  *
@@ -122,7 +122,7 @@ static OSStatus             CDSAWriteFunc(SSLConnectionRef connection, const void *data, si
  * Local globals...
  */
 
-static const char      *http_fields[] =
+static const char * const http_fields[] =
                        {
                          "Accept-Language",
                          "Accept-Ranges",
@@ -152,7 +152,7 @@ static const char   *http_fields[] =
                          "User-Agent",
                          "WWW-Authenticate"
                        };
-static const char      *days[7] =
+static const char * const days[7] =
                        {
                          "Sun",
                          "Mon",
@@ -162,7 +162,7 @@ static const char   *days[7] =
                          "Fri",
                          "Sat"
                        };
-static const char      *months[12] =
+static const char * const months[12] =
                        {
                          "Jan",
                          "Feb",
@@ -1684,7 +1684,7 @@ httpEncode64(char       *out,     /* I - String to write to */
              const char *in)   /* I - String to read from */
 {
   char         *outptr;        /* Output pointer */
-  static char  base64[] =      /* Base64 characters... */
+  static const char base64[] = /* Base64 characters... */
                {
                  "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
                  "abcdefghijklmnopqrstuvwxyz"
@@ -1800,8 +1800,8 @@ http_send(http_t       *http,     /* I - HTTP data */
   int          i;              /* Looping var */
   char         *ptr,           /* Pointer in buffer */
                buf[1024];      /* Encoded URI buffer */
-  static const char *codes[] = /* Request code strings */
-               {
+  static const char * const codes[] =
+               {               /* Request code strings */
                  NULL,
                  "OPTIONS",
                  "GET",
@@ -1816,7 +1816,7 @@ http_send(http_t       *http,     /* I - HTTP data */
                  "TRACE",
                  "CLOSE"
                };
-  static const char *hex = "0123456789ABCDEF";
+  static const char hex[] = "0123456789ABCDEF";
                                /* Hex digits */
 
 
@@ -2263,5 +2263,5 @@ CDSAWriteFunc(SSLConnectionRef connection,        /* I  - SSL/TLS connection */
 
 
 /*
- * End of "$Id: http.c,v 1.82.2.24 2003/01/24 19:19:42 mike Exp $".
+ * End of "$Id: http.c,v 1.82.2.25 2003/01/24 20:45:11 mike Exp $".
  */
index a0b2c639e2b2421959d3561ea6077adc551d43ea..fc1e9b529ffb18b318cc30b3f84617f2e01c02f0 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * "$Id: ipp-support.c,v 1.2.2.2 2003/01/07 21:58:03 mike Exp $"
+ * "$Id: ipp-support.c,v 1.2.2.3 2003/01/24 20:45:12 mike Exp $"
  *
  *   Internet Printing Protocol support functions for the Common UNIX
  *   Printing System (CUPS).
@@ -61,7 +61,7 @@ const char *                                  /* O - Text string */
 ippErrorString(ipp_status_t error)             /* I - Error status */
 {
   static char  unknown[255];                   /* Unknown error statuses */
-  static const char *status_oks[] =            /* "OK" status codes */
+  static const char * const status_oks[] =     /* "OK" status codes */
                {
                  "successful-ok",
                  "successful-ok-ignored-or-substituted-attributes",
@@ -71,7 +71,7 @@ ippErrorString(ipp_status_t error)            /* I - Error status */
                  "successful-ok-too-many-events",
                  "successful-ok-but-cancel-subscription"
                },
-               *status_400s[] =                /* Client errors */
+               * const status_400s[] =         /* Client errors */
                {
                  "client-error-bad-request",
                  "client-error-forbidden",
@@ -98,7 +98,7 @@ ippErrorString(ipp_status_t error)            /* I - Error status */
                  "client-error-ignored-all-notifications",
                  "client-error-print-support-file-not-found"
                },
-               *status_500s[] =                /* Server errors */
+               * const status_500s[] =         /* Server errors */
                {
                  "server-error-internal-error",
                  "server-error-operation-not-supported",
@@ -171,5 +171,5 @@ ippSetPort(int p)                           /* I - Port number to use */
 
 
 /*
- * End of "$Id: ipp-support.c,v 1.2.2.2 2003/01/07 21:58:03 mike Exp $".
+ * End of "$Id: ipp-support.c,v 1.2.2.3 2003/01/24 20:45:12 mike Exp $".
  */
index a7d912db1a0e7be2674783a6b448278c3fea44f4..e91b1d86ecccc2bf44534fcb4e1a736a112db2a9 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * "$Id: ipp.c,v 1.55.2.26 2003/01/16 13:48:10 mike Exp $"
+ * "$Id: ipp.c,v 1.55.2.27 2003/01/24 20:45:12 mike Exp $"
  *
  *   Internet Printing Protocol support functions for the Common UNIX
  *   Printing System (CUPS).
@@ -408,13 +408,13 @@ ippAddString(ipp_t      *ipp,                     /* I - IPP request */
  */
 
 ipp_attribute_t *                              /* O - New attribute */
-ippAddStrings(ipp_t      *ipp,                 /* I - IPP request */
-              ipp_tag_t  group,                        /* I - IPP group */
-             ipp_tag_t  type,                  /* I - Type of attribute */
-             const char *name,                 /* I - Name of attribute */
-             int        num_values,            /* I - Number of values */
-             const char *charset,              /* I - Character set */
-             const char **values)              /* I - Values */
+ippAddStrings(ipp_t              *ipp,         /* I - IPP request */
+              ipp_tag_t          group,                /* I - IPP group */
+             ipp_tag_t          type,          /* I - Type of attribute */
+             const char         *name,         /* I - Name of attribute */
+             int                num_values,    /* I - Number of values */
+             const char         *charset,      /* I - Character set */
+             const char * const *values)       /* I - Values */
 {
   int                  i;                      /* Looping var */
   ipp_attribute_t      *attr;                  /* New attribute */
@@ -2562,5 +2562,5 @@ ipp_write_mem(ipp_mem_t   *m,                     /* I - Memory buffer */
 
 
 /*
- * End of "$Id: ipp.c,v 1.55.2.26 2003/01/16 13:48:10 mike Exp $".
+ * End of "$Id: ipp.c,v 1.55.2.27 2003/01/24 20:45:12 mike Exp $".
  */
index fb72ab84e8e8d285caa9b82ee2b3789ca767003c..96052aa6c641172d1131c3b89d8ce1840249085d 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * "$Id: ipp.h,v 1.36.2.13 2003/01/07 21:58:04 mike Exp $"
+ * "$Id: ipp.h,v 1.36.2.14 2003/01/24 20:45:13 mike Exp $"
  *
  *   Internet Printing Protocol definitions for the Common UNIX Printing
  *   System (CUPS).
@@ -417,7 +417,7 @@ extern ipp_attribute_t      *ippAddResolution(ipp_t *ipp, ipp_tag_t group, const char
 extern ipp_attribute_t *ippAddResolutions(ipp_t *ipp, ipp_tag_t group, const char *name, int num_values, ipp_res_t units, const int *xres, const int *yres);
 extern ipp_attribute_t *ippAddSeparator(ipp_t *ipp);
 extern ipp_attribute_t *ippAddString(ipp_t *ipp, ipp_tag_t group, ipp_tag_t type, const char *name, const char *charset, const char *value);
-extern ipp_attribute_t *ippAddStrings(ipp_t *ipp, ipp_tag_t group, ipp_tag_t type, const char *name, int num_values, const char *charset, const char **values);
+extern ipp_attribute_t *ippAddStrings(ipp_t *ipp, ipp_tag_t group, ipp_tag_t type, const char *name, int num_values, const char *charset, const char * const *values);
 extern time_t          ippDateToTime(const ipp_uchar_t *date);
 extern void            ippDelete(ipp_t *ipp);
 extern void            ippDeleteAttribute(ipp_t *ipp, ipp_attribute_t *attr);
@@ -457,5 +457,5 @@ extern void         _ipp_free_attr(ipp_attribute_t *);
 #endif /* !_IPP_IPP_H_ */
 
 /*
- * End of "$Id: ipp.h,v 1.36.2.13 2003/01/07 21:58:04 mike Exp $".
+ * End of "$Id: ipp.h,v 1.36.2.14 2003/01/24 20:45:13 mike Exp $".
  */
index 771aec90478b799449806c270dd09be6a1a52d20..7309838cfc7ac1ef83c1fb742afcfd094f553c33 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * "$Id: language.c,v 1.20.2.11 2003/01/07 18:26:27 mike Exp $"
+ * "$Id: language.c,v 1.20.2.12 2003/01/24 20:45:13 mike Exp $"
  *
  *   I18N/language support for the Common UNIX Printing System (CUPS).
  *
@@ -51,7 +51,7 @@
 
 static cups_lang_t     *lang_cache = NULL;     /* Language string cache */
 static const char      *lang_blank = "";       /* Blank constant string */
-static const char      *lang_encodings[] =     /* Encoding strings */
+static const char * const lang_encodings[] =   /* Encoding strings */
                        {
                          "us-ascii",           "iso-8859-1",
                          "iso-8859-2",         "iso-8859-3",
@@ -120,7 +120,7 @@ static const char   *lang_encodings[] =     /* Encoding strings */
                          "euc-cn",             "euc-jp",
                          "euc-kr",             "euc-tw"
                        };
-static const char      *lang_default[] =       /* Default POSIX locale */
+static const char *const lang_default[] =      /* Default POSIX locale */
                        {
 #include "cups_C.h"
                          NULL
@@ -153,9 +153,9 @@ const char *                                /* O - Character encoding */
 cupsLangEncoding(cups_lang_t *lang)    /* I - Language data */
 {
   if (lang == NULL)
-    return (lang_encodings[0]);
+    return ((char*)lang_encodings[0]);
   else
-    return (lang_encodings[lang->encoding]);
+    return ((char*)lang_encodings[lang->encoding]);
 }
 
 
@@ -480,5 +480,5 @@ cupsLangGet(const char *language) /* I - Language or locale */
 
 
 /*
- * End of "$Id: language.c,v 1.20.2.11 2003/01/07 18:26:27 mike Exp $".
+ * End of "$Id: language.c,v 1.20.2.12 2003/01/24 20:45:13 mike Exp $".
  */
index 7d38fdcaaeb1d4b36cb6b8a4e9e376722728aec2..82896bb986fb079df54d0712595d9abeb82a008c 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * "$Id: md5passwd.c,v 1.5.2.6 2003/01/07 18:26:27 mike Exp $"
+ * "$Id: md5passwd.c,v 1.5.2.7 2003/01/24 20:45:14 mike Exp $"
  *
  *   MD5 password support for the Common UNIX Printing System (CUPS).
  *
@@ -125,7 +125,7 @@ httpMD5String(const md5_byte_t *sum,        /* I - MD5 sum data */
 {
   int          i;                      /* Looping var */
   char         *md5ptr;                /* Pointer into MD5 string */
-  static char  *hex = "0123456789abcdef";
+  static const char hex[] = "0123456789abcdef";
                                        /* Hex digits */
 
 
@@ -146,5 +146,5 @@ httpMD5String(const md5_byte_t *sum,        /* I - MD5 sum data */
 
 
 /*
- * End of "$Id: md5passwd.c,v 1.5.2.6 2003/01/07 18:26:27 mike Exp $".
+ * End of "$Id: md5passwd.c,v 1.5.2.7 2003/01/24 20:45:14 mike Exp $".
  */
index 177d1b625c01fa98168e5d4ffa2d0f91fcdeedb8..d144d1a09e26b6821d5ee25ea2dfcd3579f5db76 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * "$Id: ppd.c,v 1.51.2.25 2003/01/15 14:52:50 mike Exp $"
+ * "$Id: ppd.c,v 1.51.2.26 2003/01/24 20:45:14 mike Exp $"
  *
  *   PPD file routines for the Common UNIX Printing System (CUPS).
  *
@@ -2054,7 +2054,7 @@ static void
 ppd_fix(char *string)                  /* IO - String to fix */
 {
   unsigned char                *p;             /* Pointer into string */
-  static unsigned char lut[32] =       /* Lookup table for characters */
+  static const unsigned char lut[32] = /* Lookup table for characters */
                        {
                          0x20,
                          0x20,
@@ -2582,5 +2582,5 @@ ppd_read(FILE *fp,                        /* I - File to read from */
 
 
 /*
- * End of "$Id: ppd.c,v 1.51.2.25 2003/01/15 14:52:50 mike Exp $".
+ * End of "$Id: ppd.c,v 1.51.2.26 2003/01/24 20:45:14 mike Exp $".
  */
index bd0e755dc90ea0d3245dc234212c061b6edb989f..d58e899c338ebd935bb4207c77d9aaff13c6cadf 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * "$Id: tempfile.c,v 1.1.2.8 2003/01/15 16:08:44 mike Exp $"
+ * "$Id: tempfile.c,v 1.1.2.9 2003/01/24 20:45:14 mike Exp $"
  *
  *   Temp file utilities for the Common UNIX Printing System (CUPS).
  *
@@ -65,7 +65,7 @@ cupsTempFd(char *filename,            /* I - Pointer to buffer */
 #else
   struct timeval curtime;              /* Current time */
 #endif /* WIN32 */
-  static char  buf[1024] = "";         /* Buffer if you pass in NULL and 0 */
+  static char  *buf = NULL;            /* Buffer if you pass in NULL and 0 */
 
 
  /*
@@ -74,8 +74,14 @@ cupsTempFd(char *filename,           /* I - Pointer to buffer */
 
   if (filename == NULL)
   {
+    if (buf == NULL)
+      buf = calloc(1024, sizeof(char));
+
+    if (buf == NULL)
+      return (-1);
+
     filename = buf;
-    len      = sizeof(buf);
+    len      = 1024;
   }
 
  /*
@@ -211,5 +217,5 @@ cupsTempFile(char *filename,                /* I - Pointer to buffer */
 
 
 /*
- * End of "$Id: tempfile.c,v 1.1.2.8 2003/01/15 16:08:44 mike Exp $".
+ * End of "$Id: tempfile.c,v 1.1.2.9 2003/01/24 20:45:14 mike Exp $".
  */
index 0003dee4621f026c3ce3e68502620451f55e697b..797c4997a4672f2f09b35ec2fcba7f31873dde2f 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * "$Id: testlang.c,v 1.1.2.2 2003/01/07 18:26:30 mike Exp $"
+ * "$Id: testlang.c,v 1.1.2.3 2003/01/24 20:45:15 mike Exp $"
  *
  *   HTTP test program for the Common UNIX Printing System (CUPS).
  *
@@ -45,7 +45,7 @@ main(int  argc,                               /* I - Number of command-line arguments */
      char *argv[])                     /* I - Command-line arguments */
 {
   cups_lang_t          *language;      /* Message catalog */
-  static const char    *charsets[] =   /* Character sets */
+  static const char * const charsets[] =/* Character sets */
                        {
                          "us-ascii",
                          "iso-8859-1",
@@ -92,5 +92,5 @@ main(int  argc,                               /* I - Number of command-line arguments */
 
 
 /*
- * End of "$Id: testlang.c,v 1.1.2.2 2003/01/07 18:26:30 mike Exp $".
+ * End of "$Id: testlang.c,v 1.1.2.3 2003/01/24 20:45:15 mike Exp $".
  */
index a60673b4e1a6424a98ebea8349f7fe6387757d7a..e00c2f99c8e03f60e21547b06f52d5517e27aa74 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * "$Id: usersys.c,v 1.14.2.6 2003/01/07 18:26:31 mike Exp $"
+ * "$Id: usersys.c,v 1.14.2.7 2003/01/24 20:45:15 mike Exp $"
  *
  *   User, system, and password routines for the Common UNIX Printing
  *   System (CUPS).
@@ -80,7 +80,7 @@ cupsEncryption(void)
   FILE         *fp;                    /* client.conf file */
   char         *encryption;            /* CUPS_ENCRYPTION variable */
   const char   *home;                  /* Home directory of user */
-  static char  line[1024];             /* Line from file */
+  char         line[1024];             /* Line from file */
 
 
  /*
@@ -196,7 +196,7 @@ cupsServer(void)
   FILE         *fp;                    /* client.conf file */
   char         *server;                /* Pointer to server name */
   const char   *home;                  /* Home directory of user */
-  static char  line[1024];             /* Line from file */
+  char         line[1024];             /* Line from file */
 
 
  /*
@@ -456,5 +456,5 @@ cups_get_line(char *buf,    /* I - Line buffer */
 
 
 /*
- * End of "$Id: usersys.c,v 1.14.2.6 2003/01/07 18:26:31 mike Exp $".
+ * End of "$Id: usersys.c,v 1.14.2.7 2003/01/24 20:45:15 mike Exp $".
  */
index f68a1830ceeb0cb7dc5179f3c9e290757cc72b23..cc1ca8a84a5edfd946dc6eb355c9f32f6b739d48 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * "$Id: util.c,v 1.81.2.21 2003/01/15 04:25:50 mike Exp $"
+ * "$Id: util.c,v 1.81.2.22 2003/01/24 20:45:15 mike Exp $"
  *
  *   Printing utilities for the Common UNIX Printing System (CUPS).
  *
@@ -717,7 +717,7 @@ cupsGetJobs(cups_job_t **jobs,              /* O - Job data */
                *title,                 /* job-name */
                *user;                  /* job-originating-user-name */
   char         uri[HTTP_MAX_URI];      /* URI for jobs */
-  static const char *attrs[] =         /* Requested attributes */
+  static const char * const attrs[] =  /* Requested attributes */
                {
                  "job-id",
                  "job-priority",
@@ -975,8 +975,8 @@ cupsGetPPD(const char *name)                /* I - Printer name */
   http_status_t        status;                 /* HTTP status from server */
   char         prompt[1024];           /* Prompt string */
   static char  filename[HTTP_MAX_URI]; /* Local filename */
-  static const char *requested_attrs[] =/* Requested attributes */
-               {
+  static const char * const requested_attrs[] =
+               {                       /* Requested attributes */
                  "printer-uri-supported",
                  "printer-type",
                  "member-uris"
@@ -1728,5 +1728,5 @@ cups_local_auth(http_t *http)     /* I - Connection */
 
 
 /*
- * End of "$Id: util.c,v 1.81.2.21 2003/01/15 04:25:50 mike Exp $".
+ * End of "$Id: util.c,v 1.81.2.22 2003/01/24 20:45:15 mike Exp $".
  */
index 1f093905b208719abc3dd77b1628bc9b4e9bcae9..253ee93c61a5c46034d07bba8ec6b762add5b086 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * "$Id: image-colorspace.c,v 1.22.2.8 2003/01/07 18:26:53 mike Exp $"
+ * "$Id: image-colorspace.c,v 1.22.2.9 2003/01/24 20:45:16 mike Exp $"
  *
  *   Colorspace conversions for the Common UNIX Printing System (CUPS).
  *
 #endif /* !M_SQRT1_2 */
 
 
+/*
+ * Lookup table structure...
+ */
+
+typedef int cups_clut_t[3][256];
+
+
 /*
  * Local globals...
  */
 
 static int             ImageHaveProfile = 0;
                                        /* Do we have a color profile? */
-static int             ImageDensity[256];
-                                       /* Ink/marker density LUT */
-static int             ImageMatrix[3][3][256];
-                                       /* Color transform matrix LUT */
+static int             *ImageDensity;  /* Ink/marker density LUT */
+static cups_clut_t     *ImageMatrix;   /* Color transform matrix LUT */
 static cups_cspace_t   ImageColorSpace = CUPS_CSPACE_RGB;
                                        /* Destination colorspace */
 
@@ -148,6 +153,27 @@ ImageSetProfile(float d,           /* I - Ink/marker density */
   float                m;                      /* Current matrix value */
   int          *im;                    /* Pointer into ImageMatrix */
 
+
+ /*
+  * Allocate memory for the profile data...
+  */
+
+  if (ImageMatrix == NULL)
+    ImageMatrix = calloc(3, sizeof(cups_clut_t));
+
+  if (ImageMatrix == NULL)
+    return;
+
+  if (ImageDensity == NULL)
+    ImageDensity = calloc(256, sizeof(int));
+
+  if (ImageDensity == NULL)
+    return;
+
+ /*
+  * Populate the profile lookup tables...
+  */
+
   ImageHaveProfile  = 1;
 
   for (i = 0, im = ImageMatrix[0][0]; i < 3; i ++)
@@ -964,16 +990,16 @@ ImageLut(ib_t       *pixels,      /* IO - Input/output pixels */
  */
 
 void
-ImageRGBAdjust(ib_t *pixels,   /* IO - Input/output pixels */
-               int  count,     /* I - Number of pixels to adjust */
-               int  saturation,        /* I - Color saturation (%) */
-               int  hue)       /* I - Color hue (degrees) */
+ImageRGBAdjust(ib_t *pixels,           /* IO - Input/output pixels */
+               int  count,             /* I - Number of pixels to adjust */
+               int  saturation,                /* I - Color saturation (%) */
+               int  hue)               /* I - Color hue (degrees) */
 {
-  int          i, j, k;        /* Looping vars */
-  float                mat[3][3];      /* Color adjustment matrix */
-  static int   last_sat = 100, /* Last saturation used */
-               last_hue = 0;   /* Last hue used */
-  static int   lut[3][3][256]; /* Lookup table for matrix */
+  int                  i, j, k;        /* Looping vars */
+  float                        mat[3][3];      /* Color adjustment matrix */
+  static int           last_sat = 100, /* Last saturation used */
+                       last_hue = 0;   /* Last hue used */
+  static cups_clut_t   *lut = NULL;    /* Lookup table for matrix */
 
 
   if (saturation != last_sat ||
@@ -987,6 +1013,16 @@ ImageRGBAdjust(ib_t *pixels,      /* IO - Input/output pixels */
     saturate(mat, saturation * 0.01);
     huerotate(mat, (float)hue);
 
+   /*
+    * Allocate memory for the lookup table...
+    */
+
+    if (lut == NULL)
+      lut = calloc(3, sizeof(cups_clut_t));
+
+    if (lut == NULL)
+      return;
+
    /*
     * Convert the matrix into a 3x3 array of lookup tables...
     */
@@ -1504,5 +1540,5 @@ zshear(float mat[3][3],   /* I - Matrix */
 
 
 /*
- * End of "$Id: image-colorspace.c,v 1.22.2.8 2003/01/07 18:26:53 mike Exp $".
+ * End of "$Id: image-colorspace.c,v 1.22.2.9 2003/01/24 20:45:16 mike Exp $".
  */
index b374250bde2ddf6cbe8ea1de40c9897ee1d6bb88..f477cdec0a61007cd278c84d17329dc4d0de88ba 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * "$Id: image-gif.c,v 1.8.2.8 2003/01/07 18:26:54 mike Exp $"
+ * "$Id: image-gif.c,v 1.8.2.9 2003/01/24 20:45:16 mike Exp $"
  *
  *   GIF image routines for the Common UNIX Printing System (CUPS).
  *
@@ -48,6 +48,7 @@
 #define GIF_COLORMAP   0x80
 
 typedef ib_t   gif_cmap_t[256][4];
+typedef short  gif_table_t[4096];
 
 
 /*
@@ -353,7 +354,7 @@ gif_get_code(FILE *fp,              /* I - File to read from */
                        lastbit,        /* Last bit in buffer */
                        done,           /* Done with this buffer? */
                        last_byte;      /* Last byte in buffer */
-  static unsigned char bits[8] =       /* Bit masks for codes */
+  static const unsigned char bits[8] = /* Bit masks for codes */
                        {
                          0x01, 0x02, 0x04, 0x08,
                          0x10, 0x20, 0x40, 0x80
@@ -443,21 +444,21 @@ gif_read_lzw(FILE *fp,                    /* I - File to read from */
             int  first_time,           /* I - 1 = first time, 0 = not first time */
             int  input_code_size)      /* I - Code size in bits */
 {
-  int          i,                      /* Looping var */
-               code,                   /* Current code */
-               incode;                 /* Input code */
-  static short fresh = 0,              /* 1 = empty buffers */
-               code_size,              /* Current code size */
-               set_code_size,          /* Initial code size set */
-               max_code,               /* Maximum code used */
-               max_code_size,          /* Maximum code size */
-               firstcode,              /* First code read */
-               oldcode,                /* Last code read */
-               clear_code,             /* Clear code for LZW input */
-               end_code,               /* End code for LZW input */
-               table[2][4096],         /* String table */
-               stack[8192],            /* Output stack */
-               *sp;                    /* Current stack pointer */
+  int                  i,              /* Looping var */
+                       code,           /* Current code */
+                       incode;         /* Input code */
+  static short         fresh = 0,      /* 1 = empty buffers */
+                       code_size,      /* Current code size */
+                       set_code_size,  /* Initial code size set */
+                       max_code,       /* Maximum code used */
+                       max_code_size,  /* Maximum code size */
+                       firstcode,      /* First code read */
+                       oldcode,        /* Last code read */
+                       clear_code,     /* Clear code for LZW input */
+                       end_code,       /* End code for LZW input */
+                       *stack = NULL,  /* Output stack */
+                       *sp;            /* Current stack pointer */
+  static gif_table_t   *table = NULL;  /* String table */
 
 
   if (first_time)
@@ -473,6 +474,22 @@ gif_read_lzw(FILE *fp,                     /* I - File to read from */
     max_code_size = 2 * clear_code;
     max_code      = clear_code + 2;
 
+   /*
+    * Allocate memory for buffers...
+    */
+
+    if (table == NULL)
+      table = calloc(2, sizeof(gif_table_t));
+
+    if (table == NULL)
+      return (-1);
+
+    if (stack == NULL)
+      stack = calloc(8192, sizeof(short));
+
+    if (stack == NULL)
+      return (-1);
+
    /*
     * Initialize input buffers...
     */
@@ -599,16 +616,18 @@ gif_read_image(FILE       *fp,            /* I - Input file */
               gif_cmap_t cmap,         /* I - Colormap */
               int        interlace)    /* I - Non-zero = interlaced image */
 {
-  unsigned char        code_size;              /* Code size */
-  ib_t         *pixels,                /* Pixel buffer */
-               *temp;                  /* Current pixel */
-  int          xpos,                   /* Current X position */
-               ypos,                   /* Current Y position */
-               pass;                   /* Current pass */
-  int          pixel;                  /* Current pixel */
-  int          bpp;                    /* Bytes per pixel */
-  static int   xpasses[4] = { 8, 8, 4, 2 },
-               ypasses[5] = { 0, 4, 2, 1, 999999 };
+  unsigned char                code_size;      /* Code size */
+  ib_t                 *pixels,        /* Pixel buffer */
+                       *temp;          /* Current pixel */
+  int                  xpos,           /* Current X position */
+                       ypos,           /* Current Y position */
+                       pass;           /* Current pass */
+  int                  pixel;          /* Current pixel */
+  int                  bpp;            /* Bytes per pixel */
+  static const int     xpasses[4] =    /* X interleaving */
+                       { 8, 8, 4, 2 },
+                       ypasses[5] =    /* Y interleaving */
+                       { 0, 4, 2, 1, 999999 };
 
 
   bpp       = ImageGetDepth(img);
@@ -671,5 +690,5 @@ gif_read_image(FILE       *fp,              /* I - Input file */
 
 
 /*
- * End of "$Id: image-gif.c,v 1.8.2.8 2003/01/07 18:26:54 mike Exp $".
+ * End of "$Id: image-gif.c,v 1.8.2.9 2003/01/24 20:45:16 mike Exp $".
  */
index 7e8fb652c28fbf1e564dd4d168091e3bbd8ed52e..2c5545e80ffc82803d1609b424cc953c0947f304 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * "$Id: auth.c,v 1.41.2.18 2003/01/15 04:25:53 mike Exp $"
+ * "$Id: auth.c,v 1.41.2.19 2003/01/24 20:45:17 mike Exp $"
  *
  *   Authorization routines for the Common UNIX Printing System (CUPS).
  *
@@ -716,7 +716,7 @@ FindBest(const char   *path,        /* I - Resource path */
                *best;          /* Best match for location so far */
   int          bestlen;        /* Length of best match */
   int          limit;          /* Limit field */
-  static int   limits[] =      /* Map http_status_t to AUTH_LIMIT_xyz */
+  static const int limits[] =  /* Map http_status_t to AUTH_LIMIT_xyz */
                {
                  AUTH_LIMIT_ALL,
                  AUTH_LIMIT_OPTIONS,
@@ -891,7 +891,7 @@ IsAuthorized(client_t *con) /* I - Connection */
   struct spwd  *spw;           /* Shadow password data */
 #  endif /* HAVE_SHADOW_H */
 #endif /* HAVE_LIBPAM */
-  static const char *states[] =        /* HTTP client states... */
+  static const char * const states[] = /* HTTP client states... */
                {
                  "WAITING",
                  "OPTIONS",
@@ -1730,5 +1730,5 @@ to64(char          *s,    /* O - Output string */
 
 
 /*
- * End of "$Id: auth.c,v 1.41.2.18 2003/01/15 04:25:53 mike Exp $".
+ * End of "$Id: auth.c,v 1.41.2.19 2003/01/24 20:45:17 mike Exp $".
  */
index e8179dfd98d058c5a5ee3ca6f9e06ce61b4ed052..2516458ee0b826212deb5512bc511fa91d9e4efc 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * "$Id: cert.c,v 1.7.2.8 2003/01/07 18:27:15 mike Exp $"
+ * "$Id: cert.c,v 1.7.2.9 2003/01/24 20:45:18 mike Exp $"
  *
  *   Authentication certificate routines for the Common UNIX
  *   Printing System (CUPS).
@@ -53,7 +53,7 @@ AddCert(int        pid,                       /* I - Process ID */
   int          fd;                     /* Certificate file */
   char         filename[1024];         /* Certificate filename */
   struct group *grp;                   /* System group */
-  static const char *hex = "0123456789ABCDEF";
+  static const char hex[] = "0123456789ABCDEF";
                                        /* Hex constants... */
 
 
@@ -293,5 +293,5 @@ InitCerts(void)
 
 
 /*
- * End of "$Id: cert.c,v 1.7.2.8 2003/01/07 18:27:15 mike Exp $".
+ * End of "$Id: cert.c,v 1.7.2.9 2003/01/24 20:45:18 mike Exp $".
  */
index dd86ec6e58487ea703bacc48cfc3fa14cfbd31d3..94193ede175dbe280b2815d7513e342d0ef2c969 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * "$Id: client.c,v 1.91.2.39 2003/01/24 19:19:43 mike Exp $"
+ * "$Id: client.c,v 1.91.2.40 2003/01/24 20:45:18 mike Exp $"
  *
  *   Client routines for the Common UNIX Printing System (CUPS) scheduler.
  *
@@ -59,7 +59,8 @@
 static int             check_if_modified(client_t *con,
                                          struct stat *filestats);
 static void            decode_auth(client_t *con);
-static char            *get_file(client_t *con, struct stat *filestats);
+static char            *get_file(client_t *con, struct stat *filestats, 
+                                 char *filename, int len);
 static http_status_t   install_conf_file(client_t *con);
 static int             pipe_command(client_t *con, int infile, int *outfile,
                                     char *command, char *options);
@@ -680,6 +681,7 @@ ReadClient(client_t *con)   /* I - Client to read from */
   ipp_state_t   ipp_state;     /* State of IPP transfer */
   int          bytes;          /* Number of bytes to POST */
   char         *filename;      /* Name of file for GET/HEAD */
+  char         buf[1024];      /* Buffer for real filename */
   struct stat  filestats;      /* File information */
   mime_type_t  *type;          /* MIME type of file */
   printer_t    *p;             /* Printer */
@@ -1138,7 +1140,8 @@ ReadClient(client_t *con) /* I - Client to read from */
              * Serve a file...
              */
 
-              if ((filename = get_file(con, &filestats)) == NULL)
+              if ((filename = get_file(con, &filestats, buf,
+                                      sizeof(buf))) == NULL)
              {
                if (!SendError(con, HTTP_NOT_FOUND))
                {
@@ -1412,7 +1415,8 @@ ReadClient(client_t *con) /* I - Client to read from */
 
              break;
            }
-           else if ((filename = get_file(con, &filestats)) == NULL)
+           else if ((filename = get_file(con, &filestats, buf,
+                                         sizeof(buf))) == NULL)
            {
              if (!SendHeader(con, HTTP_NOT_FOUND, "text/html"))
              {
@@ -2328,13 +2332,14 @@ decode_auth(client_t *con)              /* I - Client to decode to */
  * 'get_file()' - Get a filename and state info.
  */
 
-static char *                  /* O - Real filename */
-get_file(client_t    *con,     /* I - Client connection */
-         struct stat *filestats)/* O - File information */
+static char *                  /* O  - Real filename */
+get_file(client_t    *con,     /* I  - Client connection */
+         struct stat *filestats,/* O  - File information */
+         char        *filename,        /* IO - Filename buffer */
+         int         len)      /* I  - Buffer length */
 {
   int          status;         /* Status of filesystem calls */
   char         *params;        /* Pointer to parameters in URI */
-  static char  filename[1024]; /* Filename buffer */
 
 
  /*
@@ -2342,14 +2347,14 @@ get_file(client_t    *con,      /* I - Client connection */
   */
 
   if (strncmp(con->uri, "/ppd/", 5) == 0)
-    snprintf(filename, sizeof(filename), "%s%s", ServerRoot, con->uri);
+    snprintf(filename, len, "%s%s", ServerRoot, con->uri);
   else if (strncmp(con->uri, "/admin/conf/", 12) == 0)
-    snprintf(filename, sizeof(filename), "%s%s", ServerRoot, con->uri + 11);
+    snprintf(filename, len, "%s%s", ServerRoot, con->uri + 11);
   else if (con->language != NULL)
-    snprintf(filename, sizeof(filename), "%s/%s%s", DocumentRoot, con->language->language,
+    snprintf(filename, len, "%s/%s%s", DocumentRoot, con->language->language,
             con->uri);
   else
-    snprintf(filename, sizeof(filename), "%s%s", DocumentRoot, con->uri);
+    snprintf(filename, len, "%s%s", DocumentRoot, con->uri);
 
   if ((params = strchr(filename, '?')) != NULL)
     *params = '\0';
@@ -2368,7 +2373,7 @@ get_file(client_t    *con,        /* I - Client connection */
     if (strncmp(con->uri, "/ppd/", 5) != 0 &&
         strncmp(con->uri, "/admin/conf/", 12) != 0)
     {
-      snprintf(filename, sizeof(filename), "%s%s", DocumentRoot, con->uri);
+      snprintf(filename, len, "%s%s", DocumentRoot, con->uri);
 
       status = stat(filename, filestats);
     }
@@ -2381,9 +2386,9 @@ get_file(client_t    *con,        /* I - Client connection */
   if (!status && S_ISDIR(filestats->st_mode))
   {
     if (filename[strlen(filename) - 1] == '/')
-      strlcat(filename, "index.html", sizeof(filename));
+      strlcat(filename, "index.html", len);
     else
-      strlcat(filename, "/index.html", sizeof(filename));
+      strlcat(filename, "/index.html", len);
 
     status = stat(filename, filestats);
   }
@@ -2960,5 +2965,5 @@ CDSAWriteFunc(SSLConnectionRef connection,        /* I  - SSL/TLS connection */
 
 
 /*
- * End of "$Id: client.c,v 1.91.2.39 2003/01/24 19:19:43 mike Exp $".
+ * End of "$Id: client.c,v 1.91.2.40 2003/01/24 20:45:18 mike Exp $".
  */
index e5639eb2a6ae6139cbdf3f3696070a112ce689b1..a1de24f9b342643d8f404a31cdcba603a29426c7 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * "$Id: cups-lpd.c,v 1.24.2.11 2003/01/07 18:27:18 mike Exp $"
+ * "$Id: cups-lpd.c,v 1.24.2.12 2003/01/24 20:45:19 mike Exp $"
  *
  *   Line Printer Daemon interface for the Common UNIX Printing System (CUPS).
  *
@@ -921,7 +921,7 @@ send_state(const char *dest,                /* I - Destination */
   char         uri[HTTP_MAX_URI];      /* Printer URI */
   char         queue[256],             /* Printer/class queue */
                *instance;              /* Printer/class instance */
-  static const char *ranks[10] =       /* Ranking strings */
+  static const char * const ranks[10] =        /* Ranking strings */
                {
                  "th",
                  "st",
@@ -934,8 +934,8 @@ send_state(const char *dest,                /* I - Destination */
                  "th",
                  "th"
                };
-  static const char *requested[] =     /* Requested attributes */
-               {
+  static const char * const requested[] =
+               {                       /* Requested attributes */
                  "job-id",
                  "job-k-octets",
                  "job-state",
@@ -1285,5 +1285,5 @@ smart_gets(char *s,       /* I - Pointer to line buffer */
 
 
 /*
- * End of "$Id: cups-lpd.c,v 1.24.2.11 2003/01/07 18:27:18 mike Exp $".
+ * End of "$Id: cups-lpd.c,v 1.24.2.12 2003/01/24 20:45:19 mike Exp $".
  */
index 7ab8e2150dc8951f2c662e521ee4f80799860bef..d9be2d3183e23b1356f727237caaef2201fe31d2 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * "$Id: cups-polld.c,v 1.5.2.10 2003/01/23 16:27:18 mike Exp $"
+ * "$Id: cups-polld.c,v 1.5.2.11 2003/01/24 20:45:20 mike Exp $"
  *
  *   Polling daemon for the Common UNIX Printing System (CUPS).
  *
@@ -175,7 +175,7 @@ poll_server(http_t      *http,              /* I - HTTP connection */
   ipp_pstate_t         state;          /* printer-state */
   struct sockaddr_in   addr;           /* Broadcast address */
   char                 packet[1540];   /* Data packet */
-  static const char    *attrs[] =      /* Requested attributes */
+  static const char * const attrs[] =  /* Requested attributes */
                        {
                          "printer-info",
                          "printer-location",
@@ -379,5 +379,5 @@ poll_server(http_t      *http,              /* I - HTTP connection */
 
 
 /*
- * End of "$Id: cups-polld.c,v 1.5.2.10 2003/01/23 16:27:18 mike Exp $".
+ * End of "$Id: cups-polld.c,v 1.5.2.11 2003/01/24 20:45:20 mike Exp $".
  */
index 4b7aeaccbb083b9d2d2ad0cfcb3f6c1144f08188..88f278654989ef06f39abda32f06a24fc99cbbe5 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * "$Id: log.c,v 1.19.2.7 2003/01/07 18:27:25 mike Exp $"
+ * "$Id: log.c,v 1.19.2.8 2003/01/24 20:45:20 mike Exp $"
  *
  *   Log file routines for the Common UNIX Printing System (CUPS).
  *
@@ -58,8 +58,8 @@ GetDateTime(time_t t)         /* I - Time value */
 {
   struct tm    *date;          /* Date/time value */
   static char  s[1024];        /* Date/time string */
-  static const char *months[12] =/* Months */
-               {
+  static const char * const months[12] =
+               {               /* Months */
                  "Jan",
                  "Feb",
                  "Mar",
@@ -116,7 +116,7 @@ LogMessage(int        level,        /* I - Log level */
   int          len;            /* Length of message */
   char         line[1024];     /* Line for output file */
   va_list      ap;             /* Argument pointer */
-  static char  levels[] =      /* Log levels... */
+  static const char levels[] = /* Log levels... */
                {
                  ' ',
                  'X',
@@ -130,7 +130,7 @@ LogMessage(int        level,        /* I - Log level */
                  'd'
                };
 #ifdef HAVE_VSYSLOG
-  static int   syslevels[] =   /* SYSLOG levels... */
+  static const int syslevels[] =/* SYSLOG levels... */
                {
                  0,
                  LOG_EMERG,
@@ -261,8 +261,8 @@ int                         /* O - 1 on success, 0 on error */
 LogRequest(client_t      *con, /* I - Request to log */
            http_status_t code) /* I - Response code */
 {
-  static const char *states[] =        /* HTTP client states... */
-               {
+  static const char * const states[] =
+               {               /* HTTP client states... */
                  "WAITING",
                  "OPTIONS",
                  "GET",
@@ -441,5 +441,5 @@ check_log_file(FILE       **log,    /* IO - Log file */
 
 
 /*
- * End of "$Id: log.c,v 1.19.2.7 2003/01/07 18:27:25 mike Exp $".
+ * End of "$Id: log.c,v 1.19.2.8 2003/01/24 20:45:20 mike Exp $".
  */