]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
Fixed all constant arrays to use "const" modifier.
authormike <mike@7a7537e8-13f0-0310-91df-b6672ffda945>
Mon, 12 Jul 1999 16:09:42 +0000 (16:09 +0000)
committermike <mike@7a7537e8-13f0-0310-91df-b6672ffda945>
Mon, 12 Jul 1999 16:09:42 +0000 (16:09 +0000)
git-svn-id: svn+ssh://src.apple.com/svn/cups/cups.org/trunk@519 7a7537e8-13f0-0310-91df-b6672ffda945

19 files changed:
cups/cups.h
cups/filter.c
cups/http.c
cups/http.h
cups/ipp.c
cups/ipp.h
cups/language.c
cups/language.h
cups/mark.c
cups/mime.c
cups/mime.h
cups/options.c
cups/page.c
cups/ppd.c
cups/ppd.h
cups/testppd.c
cups/type.c
cups/usersys.c
cups/util.c

index 1851cf307bd7c2b3b9c05a9fda7ead254f4f7125..9fc3c3210c651663cc4846213a3bd62ba36045a3 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * "$Id: cups.h,v 1.16 1999/07/12 12:42:49 mike Exp $"
+ * "$Id: cups.h,v 1.17 1999/07/12 16:09:34 mike Exp $"
  *
  *   API definitions for the Common UNIX Printing System (CUPS).
  *
@@ -106,30 +106,31 @@ typedef struct                            /**** Printer Options ****/
  * Functions...
  */
 
-extern int             cupsCancelJob(char *printer, int job);
+extern int             cupsCancelJob(const char *printer, int job);
 #define                        cupsDoRequest(http,request,resource) cupsDoFileRequest((http),(request),(resource),NULL)
 extern ipp_t           *cupsDoFileRequest(http_t *http, ipp_t *request,
-                                          char *resource, char *filename);
+                                          const char *resource, const char *filename);
 extern int             cupsGetClasses(char ***classes);
-extern char            *cupsGetDefault(void);
-extern char            *cupsGetPPD(char *printer);
+extern const char      *cupsGetDefault(void);
+extern const char      *cupsGetPPD(const char *printer);
 extern int             cupsGetPrinters(char ***printers);
-extern int             cupsPrintFile(char *printer, char *filename, char *title,
-                                     int num_options, cups_option_t *options);
+extern int             cupsPrintFile(const char *printer, const char *filename,
+                                     const char *title, int num_options,
+                                     cups_option_t *options);
 
-extern int             cupsAddOption(char *name, char *value, int num_options,
-                                     cups_option_t **options);
+extern int             cupsAddOption(const char *name, const char *value,
+                                     int num_options, cups_option_t **options);
 extern void            cupsFreeOptions(int num_options, cups_option_t *options);
-extern char            *cupsGetOption(char *name, int num_options,
+extern const char      *cupsGetOption(const char *name, int num_options,
                                       cups_option_t *options);
-extern int             cupsParseOptions(char *arg, int num_options,
+extern int             cupsParseOptions(const char *arg, int num_options,
                                         cups_option_t **options);
 extern int             cupsMarkOptions(ppd_file_t *ppd, int num_options,
                                        cups_option_t *options);
 
-extern char            *cupsGetPassword(const char *prompt);
-extern char            *cupsServer();
-extern char            *cupsUser();
+extern const char      *cupsGetPassword(const char *prompt);
+extern const char      *cupsServer(void);
+extern const char      *cupsUser(void);
 
 #  ifdef __cplusplus
 }
@@ -138,5 +139,5 @@ extern char         *cupsUser();
 #endif /* !_CUPS_CUPS_H_ */
 
 /*
- * End of "$Id: cups.h,v 1.16 1999/07/12 12:42:49 mike Exp $".
+ * End of "$Id: cups.h,v 1.17 1999/07/12 16:09:34 mike Exp $".
  */
index fd6294a8be5a5b067304a3f26a139d23b29c189b..67ec81176e89229a8f801b139223bda9c6e2d151 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * "$Id: filter.c,v 1.8 1999/06/18 18:36:08 mike Exp $"
+ * "$Id: filter.c,v 1.9 1999/07/12 16:09:35 mike Exp $"
  *
  *   File type conversion routines for the Common UNIX Printing System (CUPS).
  *
@@ -58,7 +58,7 @@ mimeAddFilter(mime_t      *mime,      /* I - MIME database */
               mime_type_t *src,                /* I - Source type */
              mime_type_t *dst,         /* I - Destination type */
               int         cost,                /* I - Relative time/resource cost */
-             char        *filter)      /* I - Filter program to run */
+             const char  *filter)      /* I - Filter program to run */
 {
   mime_filter_t        *temp;                  /* New filter */
 
@@ -293,5 +293,5 @@ lookup(mime_t      *mime,   /* I - MIME database */
 
 
 /*
- * End of "$Id: filter.c,v 1.8 1999/06/18 18:36:08 mike Exp $".
+ * End of "$Id: filter.c,v 1.9 1999/07/12 16:09:35 mike Exp $".
  */
index de03012b1cc617720a57414f36a8880cc9777f9e..f995177a4936267722bad01a16b81eb0530d7631 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * "$Id: http.c,v 1.38 1999/07/09 13:08:37 mike Exp $"
+ * "$Id: http.c,v 1.39 1999/07/12 16:09:35 mike Exp $"
  *
  *   HTTP routines for the Common UNIX Printing System (CUPS) scheduler.
  *
  * Local functions...
  */
 
-static http_field_t    http_field(char *name);
-static int             http_send(http_t *http, http_state_t request, char *uri);
+static http_field_t    http_field(const char *name);
+static int             http_send(http_t *http, http_state_t request,
+                                 const char *uri);
 
 
 /*
  * Local globals...
  */
 
-static char            *http_fields[] =
+static const char      *http_fields[] =
                        {
                          "Accept-Language",
                          "Accept-Ranges",
@@ -127,7 +128,7 @@ static char         *http_fields[] =
                          "User-Agent",
                          "WWW-Authenticate"
                        };
-static char            *days[7] =
+static const char      *days[7] =
                        {
                          "Sun",
                          "Mon",
@@ -137,7 +138,7 @@ static char         *days[7] =
                          "Fri",
                          "Sat"
                        };
-static char            *months[12] =
+static const char      *months[12] =
                        {
                          "Jan",
                          "Feb",
@@ -213,8 +214,8 @@ httpClose(http_t *http)             /* I - Connection to close */
  */
 
 http_t *                       /* O - New HTTP connection */
-httpConnect(char *host,                /* I - Host to connect to */
-            int  port)         /* I - Port number */
+httpConnect(const char *host,  /* I - Host to connect to */
+            int        port)   /* I - Port number */
 {
   http_t               *http;          /* New HTTP connection */
   struct hostent       *hostaddr;      /* Host address data */
@@ -331,12 +332,12 @@ httpReconnect(http_t *http)       /* I - HTTP data */
  */
 
 void
-httpSeparate(char *uri,                /* I - Universal Resource Identifier */
-             char *method,     /* O - Method (http, https, etc.) */
-            char *username,    /* O - Username */
-            char *host,        /* O - Hostname */
-            int  *port,        /* O - Port number to use */
-             char *resource)   /* O - Resource/filename */
+httpSeparate(const char *uri,          /* I - Universal Resource Identifier */
+             char       *method,       /* O - Method (http, https, etc.) */
+            char       *username,      /* O - Username */
+            char       *host,          /* O - Hostname */
+            int        *port,          /* O - Port number to use */
+             char       *resource)     /* O - Resource/filename */
 {
   char *ptr;                   /* Pointer into string... */
 
@@ -378,7 +379,7 @@ httpSeparate(char *uri,             /* I - Universal Resource Identifier */
       * OK, we have "hostname:port[/resource]"...
       */
 
-      *port = strtol(uri, &uri, 10);
+      *port = strtol(uri, (char **)&uri, 10);
 
       if (*uri == '/')
         strcpy(resource, uri);
@@ -494,7 +495,7 @@ httpSeparate(char *uri,             /* I - Universal Resource Identifier */
 void
 httpSetField(http_t       *http,       /* I - HTTP data */
              http_field_t field,       /* I - Field index */
-            char         *value)       /* I - Value */
+            const char   *value)       /* I - Value */
 {
   strncpy(http->fields[field], value, HTTP_MAX_VALUE - 1);
   http->fields[field][HTTP_MAX_VALUE - 1] = '\0';
@@ -506,8 +507,8 @@ httpSetField(http_t       *http,    /* I - HTTP data */
  */
 
 int                                    /* O - Status of call (0 = success) */
-httpDelete(http_t *http,               /* I - HTTP data */
-           char   *uri)                        /* I - URI to delete */
+httpDelete(http_t     *http,           /* I - HTTP data */
+           const char *uri)            /* I - URI to delete */
 {
   return (http_send(http, HTTP_DELETE, uri));
 }
@@ -518,8 +519,8 @@ httpDelete(http_t *http,            /* I - HTTP data */
  */
 
 int                                    /* O - Status of call (0 = success) */
-httpGet(http_t *http,                  /* I - HTTP data */
-        char   *uri)                   /* I - URI to get */
+httpGet(http_t     *http,              /* I - HTTP data */
+        const char *uri)               /* I - URI to get */
 {
   return (http_send(http, HTTP_GET, uri));
 }
@@ -530,8 +531,8 @@ httpGet(http_t *http,                       /* I - HTTP data */
  */
 
 int                                    /* O - Status of call (0 = success) */
-httpHead(http_t *http,                 /* I - HTTP data */
-         char   *uri)                  /* I - URI for head */
+httpHead(http_t     *http,             /* I - HTTP data */
+         const char *uri)              /* I - URI for head */
 {
   return (http_send(http, HTTP_HEAD, uri));
 }
@@ -542,8 +543,8 @@ httpHead(http_t *http,                      /* I - HTTP data */
  */
 
 int                                    /* O - Status of call (0 = success) */
-httpOptions(http_t *http,              /* I - HTTP data */
-            char   *uri)               /* I - URI for options */
+httpOptions(http_t     *http,          /* I - HTTP data */
+            const char *uri)           /* I - URI for options */
 {
   return (http_send(http, HTTP_OPTIONS, uri));
 }
@@ -554,8 +555,8 @@ httpOptions(http_t *http,           /* I - HTTP data */
  */
 
 int                                    /* O - Status of call (0 = success) */
-httpPost(http_t *http,                 /* I - HTTP data */
-         char   *uri)                  /* I - URI for post */
+httpPost(http_t     *http,             /* I - HTTP data */
+         const char *uri)              /* I - URI for post */
 {
   httpGetLength(http);
 
@@ -568,8 +569,8 @@ httpPost(http_t *http,                      /* I - HTTP data */
  */
 
 int                                    /* O - Status of call (0 = success) */
-httpPut(http_t *http,                  /* I - HTTP data */
-        char   *uri)                   /* I - URI to put */
+httpPut(http_t     *http,              /* I - HTTP data */
+        const char *uri)               /* I - URI to put */
 {
   httpGetLength(http);
 
@@ -582,8 +583,8 @@ httpPut(http_t *http,                       /* I - HTTP data */
  */
 
 int                                    /* O - Status of call (0 = success) */
-httpTrace(http_t *http,                        /* I - HTTP data */
-          char   *uri)                 /* I - URI for trace */
+httpTrace(http_t     *http,            /* I - HTTP data */
+          const char *uri)             /* I - URI for trace */
 {
   return (http_send(http, HTTP_TRACE, uri));
 }
@@ -698,9 +699,9 @@ httpRead(http_t *http,                      /* I - HTTP data */
  */
  
 int                                    /* O - Number of bytes written */
-httpWrite(http_t *http,                        /* I - HTTP data */
-          char   *buffer,              /* I - Buffer for data */
-         int    length)                /* I - Number of bytes to write */
+httpWrite(http_t     *http,            /* I - HTTP data */
+          const char *buffer,          /* I - Buffer for data */
+         int        length)            /* I - Number of bytes to write */
 {
   int          tbytes,                 /* Total bytes sent */
                bytes;                  /* Bytes sent */
@@ -897,7 +898,7 @@ httpPrintf(http_t     *http,                /* I - HTTP data */
  * 'httpStatus()' - Return a short string describing a HTTP status code.
  */
 
-char *                                 /* O - String or NULL */
+const char *                           /* O - String or NULL */
 httpStatus(http_status_t status)       /* I - HTTP status code */
 {
   switch (status)
@@ -938,7 +939,7 @@ httpStatus(http_status_t status)    /* I - HTTP status code */
  * 'httpGetDateString()' - Get a formatted date/time string from a time value.
  */
 
-char *                                 /* O - Date/time string */
+const char *                           /* O - Date/time string */
 httpGetDateString(time_t t)            /* I - UNIX time */
 {
   struct tm    *tdate;
@@ -959,7 +960,7 @@ httpGetDateString(time_t t)         /* I - UNIX time */
  */
 
 time_t                                 /* O - UNIX time */
-httpGetDateTime(char *s)               /* I - Date/time string */
+httpGetDateTime(const char *s)         /* I - Date/time string */
 {
   int          i;                      /* Looping var */
   struct tm    tdate;                  /* Time/date structure */
@@ -1104,8 +1105,8 @@ httpUpdate(http_t *http)          /* I - HTTP data */
  */
 
 char *                         /* O - Decoded string */
-httpDecode64(char *out,                /* I - String to write to */
-             char *in)         /* I - String to read from */
+httpDecode64(char       *out,  /* I - String to write to */
+             const char *in)   /* I - String to read from */
 {
   int  pos,                    /* Bit position */
        base64;                 /* Value of this character */
@@ -1175,8 +1176,8 @@ httpDecode64(char *out,           /* I - String to write to */
  */
 
 char *                         /* O - Encoded string */
-httpEncode64(char *out,                /* I - String to write to */
-             char *in)         /* I - String to read from */
+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... */
@@ -1226,7 +1227,7 @@ httpEncode64(char *out,           /* I - String to write to */
  *                     content-length or transfer-encoding fields.
  */
 
-int
+int                            /* O - Content length */
 httpGetLength(http_t *http)    /* I - HTTP data */
 {
   if (strcasecmp(http->fields[HTTP_FIELD_TRANSFER_ENCODING], "chunked") == 0)
@@ -1261,7 +1262,7 @@ httpGetLength(http_t *http)       /* I - HTTP data */
  */
 
 static http_field_t            /* O - Field index */
-http_field(char *name)         /* I - String name */
+http_field(const char *name)   /* I - String name */
 {
   int  i;                      /* Looping var */
 
@@ -1281,12 +1282,12 @@ http_field(char *name)          /* I - String name */
 static int                     /* O - 0 on success, non-zero on error */
 http_send(http_t       *http,  /* I - HTTP data */
           http_state_t request,        /* I - Request code */
-         char         *uri)    /* I - URI */
+         const char   *uri)    /* I - URI */
 {
   int          i;              /* Looping var */
   char         *ptr,           /* Pointer in buffer */
                buf[1024];      /* Encoded URI buffer */
-  static char  *codes[] =      /* Request code strings */
+  static const char *codes[] = /* Request code strings */
                {
                  NULL,
                  "OPTIONS",
@@ -1302,7 +1303,7 @@ http_send(http_t       *http,     /* I - HTTP data */
                  "TRACE",
                  "CLOSE"
                };
-  static char  *hex = "0123456789ABCDEF";
+  static const char *hex = "0123456789ABCDEF";
                                /* Hex digits */
 
 
@@ -1370,5 +1371,5 @@ http_send(http_t       *http,     /* I - HTTP data */
 
 
 /*
- * End of "$Id: http.c,v 1.38 1999/07/09 13:08:37 mike Exp $".
+ * End of "$Id: http.c,v 1.39 1999/07/12 16:09:35 mike Exp $".
  */
index c2b849b718fa81b97a914d7a2ef95ffb83e8c503..db529946263190dc3d47fe2f5744bb6f0b9a43ec 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * "$Id: http.h,v 1.20 1999/07/09 13:08:38 mike Exp $"
+ * "$Id: http.h,v 1.21 1999/07/12 16:09:36 mike Exp $"
  *
  *   Hyper-Text Transport Protocol definitions for the Common UNIX Printing
  *   System (CUPS).
@@ -248,31 +248,31 @@ typedef struct
 #  define              httpClearFields(http)   memset((http)->fields, 0, sizeof((http)->fields)),\
                                                httpSetField((http), HTTP_FIELD_HOST, (http)->hostname)
 extern void            httpClose(http_t *http);
-extern http_t          *httpConnect(char *host, int port);
-extern int             httpDelete(http_t *http, char *uri);
+extern http_t          *httpConnect(const char *host, int port);
+extern int             httpDelete(http_t *http, const char *uri);
 extern void            httpFlush(http_t *http);
-extern int             httpGet(http_t *http, char *uri);
+extern int             httpGet(http_t *http, const char *uri);
 extern char            *httpGets(char *line, int length, http_t *http);
-extern char            *httpGetDateString(time_t t);
-extern time_t          httpGetDateTime(char *s);
+extern const char      *httpGetDateString(time_t t);
+extern time_t          httpGetDateTime(const char *s);
 #  define              httpGetField(http,field)        (http)->fields[field]
-extern int             httpHead(http_t *http, char *uri);
+extern int             httpHead(http_t *http, const char *uri);
 extern void            httpInitialize(void);
-extern int             httpOptions(http_t *http, char *uri);
-extern int             httpPost(http_t *http, char *uri);
+extern int             httpOptions(http_t *http, const char *uri);
+extern int             httpPost(http_t *http, const char *uri);
 extern int             httpPrintf(http_t *http, const char *format, ...);
-extern int             httpPut(http_t *http, char *uri);
+extern int             httpPut(http_t *http, const char *uri);
 extern int             httpRead(http_t *http, char *buffer, int length);
 extern int             httpReconnect(http_t *http);
-extern void            httpSeparate(char *uri, char *method, char *username,
+extern void            httpSeparate(const char *uri, char *method, char *username,
                                     char *host, int *port, char *resource);
-extern void            httpSetField(http_t *http, http_field_t field, char *value);
-extern char            *httpStatus(http_status_t status);
-extern int             httpTrace(http_t *http, char *uri);
+extern void            httpSetField(http_t *http, http_field_t field, const char *value);
+extern const char      *httpStatus(http_status_t status);
+extern int             httpTrace(http_t *http, const char *uri);
 extern http_status_t   httpUpdate(http_t *http);
-extern int             httpWrite(http_t *http, char *buffer, int length);
-extern char            *httpEncode64(char *out, char *in);
-extern char            *httpDecode64(char *out, char *in);
+extern int             httpWrite(http_t *http, const char *buffer, int length);
+extern char            *httpEncode64(char *out, const char *in);
+extern char            *httpDecode64(char *out, const char *in);
 extern int             httpGetLength(http_t *http);
 
 
@@ -286,5 +286,5 @@ extern int          httpGetLength(http_t *http);
 #endif /* !_CUPS_HTTP_H_ */
 
 /*
- * End of "$Id: http.h,v 1.20 1999/07/09 13:08:38 mike Exp $".
+ * End of "$Id: http.h,v 1.21 1999/07/12 16:09:36 mike Exp $".
  */
index c1c584b3a08332d53dfba1b3f864c0f8f3e684c7..fb3138835f4e36ebd0704655bff045485becdc2d 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * "$Id: ipp.c,v 1.19 1999/06/25 12:41:22 mike Exp $"
+ * "$Id: ipp.c,v 1.20 1999/07/12 16:09:36 mike Exp $"
  *
  *   Internet Printing Protocol support functions for the Common UNIX
  *   Printing System (CUPS).
@@ -73,10 +73,10 @@ static int          ipp_read(http_t *http, char *buffer, int length);
  */
 
 ipp_attribute_t *                      /* O - New attribute */
-ippAddBoolean(ipp_t     *ipp,          /* I - IPP request */
-              ipp_tag_t group,         /* I - IPP group */
-              char      *name,         /* I - Name of attribute */
-              char      value)         /* I - Value of attribute */
+ippAddBoolean(ipp_t      *ipp,         /* I - IPP request */
+              ipp_tag_t  group,                /* I - IPP group */
+              const char *name,                /* I - Name of attribute */
+              char       value)                /* I - Value of attribute */
 {
   ipp_attribute_t      *attr;          /* New attribute */
 
@@ -103,11 +103,11 @@ ippAddBoolean(ipp_t     *ipp,             /* I - IPP request */
  */
 
 ipp_attribute_t *                      /* O - New attribute */
-ippAddBooleans(ipp_t     *ipp,         /* I - IPP request */
-               ipp_tag_t group,                /* I - IPP group */
-              char      *name,         /* I - Name of attribute */
-              int       num_values,    /* I - Number of values */
-              char      *values)       /* I - Values */
+ippAddBooleans(ipp_t      *ipp,                /* I - IPP request */
+               ipp_tag_t  group,       /* I - IPP group */
+              const char *name,        /* I - Name of attribute */
+              int        num_values,   /* I - Number of values */
+              const char *values)      /* I - Values */
 {
   int                  i;              /* Looping var */
   ipp_attribute_t      *attr;          /* New attribute */
@@ -141,7 +141,7 @@ ippAddBooleans(ipp_t     *ipp,              /* I - IPP request */
 ipp_attribute_t *                      /* O - New attribute */
 ippAddDate(ipp_t       *ipp,           /* I - IPP request */
            ipp_tag_t   group,          /* I - IPP group */
-          char        *name,           /* I - Name of attribute */
+          const char  *name,           /* I - Name of attribute */
           ipp_uchar_t *value)          /* I - Value */
 {
   ipp_attribute_t      *attr;          /* New attribute */
@@ -170,11 +170,11 @@ ippAddDate(ipp_t       *ipp,              /* I - IPP request */
  */
 
 ipp_attribute_t *                      /* O - New attribute */
-ippAddInteger(ipp_t     *ipp,          /* I - IPP request */
-              ipp_tag_t group,         /* I - IPP group */
-             ipp_tag_t type,           /* I - Type of attribute */
-              char      *name,         /* I - Name of attribute */
-              int       value)         /* I - Value of attribute */
+ippAddInteger(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        value)                /* I - Value of attribute */
 {
   ipp_attribute_t      *attr;          /* New attribute */
 
@@ -202,12 +202,12 @@ ippAddInteger(ipp_t     *ipp,             /* I - IPP request */
  */
 
 ipp_attribute_t *                      /* O - New attribute */
-ippAddIntegers(ipp_t     *ipp,         /* I - IPP request */
-               ipp_tag_t group,                /* I - IPP group */
-              ipp_tag_t type,          /* I - Type of attribute */
-              char      *name,         /* I - Name of attribute */
-              int       num_values,    /* I - Number of values */
-              int       *values)       /* I - Values */
+ippAddIntegers(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 int  *values)      /* I - Values */
 {
   int                  i;              /* Looping var */
   ipp_attribute_t      *attr;          /* New attribute */
@@ -236,12 +236,12 @@ ippAddIntegers(ipp_t     *ipp,            /* I - IPP request */
  */
 
 ipp_attribute_t *                      /* O - New attribute */
-ippAddString(ipp_t     *ipp,           /* I - IPP request */
-             ipp_tag_t group,          /* I - IPP group */
-            ipp_tag_t type,            /* I - Type of attribute */
-             char      *name,          /* I - Name of attribute */
-             char      *charset,       /* I - Character set */
-             char      *value)         /* I - Value */
+ippAddString(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 */
+             const char *charset,      /* I - Character set */
+             const char *value)                /* I - Value */
 {
   ipp_attribute_t      *attr;          /* New attribute */
 
@@ -267,13 +267,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 */
-             char      *name,          /* I - Name of attribute */
-             int       num_values,     /* I - Number of values */
-             char      *charset,       /* I - Character set */
-             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 **values)      /* I - Values */
 {
   int                  i;              /* Looping var */
   ipp_attribute_t      *attr;          /* New attribute */
@@ -309,11 +309,11 @@ ippAddStrings(ipp_t     *ipp,             /* I - IPP request */
  */
 
 ipp_attribute_t *                      /* O - New attribute */
-ippAddRange(ipp_t     *ipp,            /* I - IPP request */
-            ipp_tag_t group,           /* I - IPP group */
-           char      *name,            /* I - Name of attribute */
-           int       lower,            /* I - Lower value */
-           int       upper)            /* I - Upper value */
+ippAddRange(ipp_t      *ipp,           /* I - IPP request */
+            ipp_tag_t  group,          /* I - IPP group */
+           const char *name,           /* I - Name of attribute */
+           int        lower,           /* I - Lower value */
+           int        upper)           /* I - Upper value */
 {
   ipp_attribute_t      *attr;          /* New attribute */
 
@@ -339,12 +339,12 @@ ippAddRange(ipp_t     *ipp,               /* I - IPP request */
  */
 
 ipp_attribute_t *                      /* O - New attribute */
-ippAddRanges(ipp_t     *ipp,           /* I - IPP request */
-             ipp_tag_t group,          /* I - IPP group */
-            char      *name,           /* I - Name of attribute */
-            int       num_values,      /* I - Number of values */
-            int       *lower,          /* I - Lower values */
-            int       *upper)          /* I - Upper values */
+ippAddRanges(ipp_t      *ipp,          /* I - IPP request */
+             ipp_tag_t  group,         /* I - IPP group */
+            const char *name,          /* I - Name of attribute */
+            int        num_values,     /* I - Number of values */
+            const int  *lower,         /* I - Lower values */
+            const int  *upper)         /* I - Upper values */
 {
   int                  i;              /* Looping var */
   ipp_attribute_t      *attr;          /* New attribute */
@@ -376,12 +376,12 @@ ippAddRanges(ipp_t     *ipp,              /* I - IPP request */
  */
 
 ipp_attribute_t *                      /* O - New attribute */
-ippAddResolution(ipp_t     *ipp,       /* I - IPP request */
-                ipp_tag_t group,       /* I - IPP group */
-                char      *name,       /* I - Name of attribute */
-                ipp_res_t units,       /* I - Units for resolution */
-                int       xres,        /* I - X resolution */
-                int       yres)        /* I - Y resolution */
+ippAddResolution(ipp_t      *ipp,      /* I - IPP request */
+                ipp_tag_t  group,      /* I - IPP group */
+                const char *name,      /* I - Name of attribute */
+                ipp_res_t  units,      /* I - Units for resolution */
+                int        xres,       /* I - X resolution */
+                int        yres)       /* I - Y resolution */
 {
   ipp_attribute_t      *attr;          /* New attribute */
 
@@ -408,13 +408,13 @@ ippAddResolution(ipp_t     *ipp,  /* I - IPP request */
  */
 
 ipp_attribute_t *                      /* O - New attribute */
-ippAddResolutions(ipp_t     *ipp,      /* I - IPP request */
-                 ipp_tag_t group,      /* I - IPP group */
-                 char      *name,      /* I - Name of attribute */
-                 int       num_values, /* I - Number of values */
-                 ipp_res_t units,      /* I - Units for resolution */
-                 int       *xres,      /* I - X resolutions */
-                 int       *yres)      /* I - Y resolutions */
+ippAddResolutions(ipp_t      *ipp,     /* I - IPP request */
+                 ipp_tag_t  group,     /* I - IPP group */
+                 const char *name,     /* I - Name of attribute */
+                 int        num_values,/* I - Number of values */
+                 ipp_res_t  units,     /* I - Units for resolution */
+                 const int  *xres,     /* I - X resolutions */
+                 const int  *yres)     /* I - Y resolutions */
 {
   int                  i;              /* Looping var */
   ipp_attribute_t      *attr;          /* New attribute */
@@ -472,8 +472,8 @@ ippAddSeparator(ipp_t *ipp)         /* I - IPP request */
  *                      in seconds.
  */
 
-time_t                         /* O - UNIX time value */
-ippDateToTime(ipp_uchar_t *date)/* I - RFC 1903 date info */
+time_t                                 /* O - UNIX time value */
+ippDateToTime(const ipp_uchar_t *date) /* I - RFC 1903 date info */
 {
   struct tm    unixdate;       /* UNIX date/time info */
   time_t       t;              /* Computed time */
@@ -578,9 +578,9 @@ ippDelete(ipp_t *ipp)               /* I - IPP request */
  */
 
 ipp_attribute_t        *                       /* O - Matching attribute */
-ippFindAttribute(ipp_t     *ipp,       /* I - IPP request */
-                 char      *name,      /* I - Name of attribute */
-                ipp_tag_t type)        /* I - Type of attribute */
+ippFindAttribute(ipp_t      *ipp,      /* I - IPP request */
+                 const char *name,     /* I - Name of attribute */
+                ipp_tag_t  type)       /* I - Type of attribute */
 {
   ipp_attribute_t      *attr;  /* Current atttribute */
 
@@ -991,7 +991,7 @@ ippRead(http_t *http,               /* I - HTTP data */
  * 'ippTimeToDate()' - Convert from UNIX time to RFC 1903 format.
  */
 
-ipp_uchar_t *                          /* O - RFC-1903 date/time data */
+const ipp_uchar_t *                    /* O - RFC-1903 date/time data */
 ippTimeToDate(time_t t)                        /* I - UNIX time value */
 {
   struct tm            *unixdate;      /* UNIX unixdate/time info */
@@ -1377,7 +1377,7 @@ ippWrite(http_t *http,            /* I - HTTP data */
 int                            /* O - Port number */
 ippPort(void)
 {
-  char         *server_port;   /* SERVER_PORT environment variable */
+  const char   *server_port;   /* SERVER_PORT environment variable */
   struct servent *port;                /* Port number info */  
 
 
@@ -1454,7 +1454,6 @@ ipp_read(http_t *http,    /* I - Client connection */
 }
 
 
-
 /*
- * End of "$Id: ipp.c,v 1.19 1999/06/25 12:41:22 mike Exp $".
+ * End of "$Id: ipp.c,v 1.20 1999/07/12 16:09:36 mike Exp $".
  */
index 3190b69108af757a105633f99bdd9a27285acc9f..32c2c918e6bf801384f27f9317549f0a36ce788f 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * "$Id: ipp.h,v 1.15 1999/05/19 18:00:52 mike Exp $"
+ * "$Id: ipp.h,v 1.16 1999/07/12 16:09:37 mike Exp $"
  *
  *   Internet Printing Protocol definitions for the Common UNIX Printing
  *   System (CUPS).
@@ -306,25 +306,25 @@ typedef struct                    /**** Request State ****/
  * Prototypes...
  */
 
-extern time_t          ippDateToTime(ipp_uchar_t *date);
-extern ipp_attribute_t *ippAddBoolean(ipp_t *ipp, ipp_tag_t group, char *name, char value);
-extern ipp_attribute_t *ippAddBooleans(ipp_t *ipp, ipp_tag_t group, char *name, int num_values, char *values);
-extern ipp_attribute_t *ippAddDate(ipp_t *ipp, ipp_tag_t group, char *name, ipp_uchar_t *value);
-extern ipp_attribute_t *ippAddInteger(ipp_t *ipp, ipp_tag_t group, ipp_tag_t type, char *name, int value);
-extern ipp_attribute_t *ippAddIntegers(ipp_t *ipp, ipp_tag_t group, ipp_tag_t type, char *name, int num_values, int *values);
-extern ipp_attribute_t *ippAddRange(ipp_t *ipp, ipp_tag_t group, char *name, int lower, int upper);
-extern ipp_attribute_t *ippAddRanges(ipp_t *ipp, ipp_tag_t group, char *name, int num_values, int *lower, int *upper);
-extern ipp_attribute_t *ippAddResolution(ipp_t *ipp, ipp_tag_t group, char *name, ipp_res_t units, int xres, int yres);
-extern ipp_attribute_t *ippAddResolutions(ipp_t *ipp, ipp_tag_t group, char *name, int num_values, ipp_res_t units, int *xres, int *yres);
+extern time_t          ippDateToTime(const ipp_uchar_t *date);
+extern ipp_attribute_t *ippAddBoolean(ipp_t *ipp, ipp_tag_t group, const char *name, char value);
+extern ipp_attribute_t *ippAddBooleans(ipp_t *ipp, ipp_tag_t group, const char *name, int num_values, const char *values);
+extern ipp_attribute_t *ippAddDate(ipp_t *ipp, ipp_tag_t group, const char *name, ipp_uchar_t *value);
+extern ipp_attribute_t *ippAddInteger(ipp_t *ipp, ipp_tag_t group, ipp_tag_t type, const char *name, int value);
+extern ipp_attribute_t *ippAddIntegers(ipp_t *ipp, ipp_tag_t group, ipp_tag_t type, const char *name, int num_values, const int *values);
+extern ipp_attribute_t *ippAddRange(ipp_t *ipp, ipp_tag_t group, const char *name, int lower, int upper);
+extern ipp_attribute_t *ippAddRanges(ipp_t *ipp, ipp_tag_t group, const char *name, int num_values, const int *lower, const int *upper);
+extern ipp_attribute_t *ippAddResolution(ipp_t *ipp, ipp_tag_t group, const char *name, ipp_res_t units, int xres, int yres);
+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, char *name, char *charset, char *value);
-extern ipp_attribute_t *ippAddStrings(ipp_t *ipp, ipp_tag_t group, ipp_tag_t type, char *name, int num_values, char *charset, char **values);
+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 void            ippDelete(ipp_t *ipp);
-extern ipp_attribute_t *ippFindAttribute(ipp_t *ipp, char *name, ipp_tag_t type);
+extern ipp_attribute_t *ippFindAttribute(ipp_t *ipp, const char *name, ipp_tag_t type);
 extern size_t          ippLength(ipp_t *ipp);
 extern ipp_t           *ippNew(void);
 extern ipp_state_t     ippRead(http_t *http, ipp_t *ipp);
-extern ipp_uchar_t     *ippTimeToDate(time_t t);
+extern const ipp_uchar_t *ippTimeToDate(time_t t);
 extern ipp_state_t     ippWrite(http_t *http, ipp_t *ipp);
 extern int             ippPort(void);
 
@@ -338,5 +338,5 @@ extern int          ippPort(void);
 #endif /* !_CUPS_IPP_H_ */
 
 /*
- * End of "$Id: ipp.h,v 1.15 1999/05/19 18:00:52 mike Exp $".
+ * End of "$Id: ipp.h,v 1.16 1999/07/12 16:09:37 mike Exp $".
  */
index e4abee4194d92e5c356587e2eb007fe7e5002280..62a1edc1137fb892f92983e454693fdf72a1c305 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * "$Id: language.c,v 1.9 1999/06/18 18:36:09 mike Exp $"
+ * "$Id: language.c,v 1.10 1999/07/12 16:09:37 mike Exp $"
  *
  *   I18N/language support for the Common UNIX Printing System (CUPS).
  *
@@ -127,10 +127,11 @@ cupsLangFree(cups_lang_t *lang)   /* I - Language to free */
  */
 
 cups_lang_t *                  /* O - Language data */
-cupsLangGet(char *language)    /* I - Language or locale */
+cupsLangGet(const char *language) /* I - Language or locale */
 {
   int          i, count;       /* Looping vars */
-  char         real[16],       /* Real language name */
+  char         langname[16],   /* Requested language name */
+               real[16],       /* Real language name */
                filename[1024], /* Filename for language locale file */
                *localedir;     /* Directory for locale files */
   FILE         *fp;            /* Language locale file pointer */
@@ -149,26 +150,28 @@ cupsLangGet(char *language)       /* I - Language or locale */
   */
 
   if (language == NULL || language[0] == '\0')
-    language = "C";
+    strcpy(langname, "C");
+  else
+    strcpy(langname, language);
 
-  if (strlen(language) < 2)
+  if (strlen(langname) < 2)
     strcpy(real, "C");
   else
   {
-    real[0] = tolower(language[0]);
-    real[1] = tolower(language[1]);
+    real[0] = tolower(langname[0]);
+    real[1] = tolower(langname[1]);
 
-    if (language[2] == '_' || language[2] == '-')
+    if (langname[2] == '_' || langname[2] == '-')
     {
       real[2]     = '_';
-      real[3]     = toupper(language[3]);
-      real[4]     = toupper(language[4]);
+      real[3]     = toupper(langname[3]);
+      real[4]     = toupper(langname[4]);
       real[5]     = '\0';
-      language[5] = '\0';
+      langname[5] = '\0';
     }
     else
     {
-      language[2] = '\0';
+      langname[2] = '\0';
       real[2]     = '\0';
     }
   }
@@ -201,7 +204,7 @@ cupsLangGet(char *language) /* I - Language or locale */
   */
 
   for (lang = lang_cache; lang != NULL; lang = lang->next)
-    if (strcmp(lang->language, language) == 0)
+    if (strcmp(lang->language, langname) == 0)
     {
       lang->used ++;
 
@@ -288,7 +291,7 @@ cupsLangGet(char *language) /* I - Language or locale */
   */
 
   lang->used ++;
-  strcpy(lang->language, language);
+  strcpy(lang->language, langname);
 
   for (i = 0; i < (sizeof(lang_encodings) / sizeof(lang_encodings[0])); i ++)
     if (strcmp(lang_encodings[i], line) == 0)
@@ -366,5 +369,5 @@ cupsLangGet(char *language) /* I - Language or locale */
 
 
 /*
- * End of "$Id: language.c,v 1.9 1999/06/18 18:36:09 mike Exp $".
+ * End of "$Id: language.c,v 1.10 1999/07/12 16:09:37 mike Exp $".
  */
index b951b12cc2c788975ae0a13b3dfdf096f8ec3b19..e220079eac61298c97fcd5c9c6a89c0d0222c643 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * "$Id: language.h,v 1.10 1999/07/12 12:42:50 mike Exp $"
+ * "$Id: language.h,v 1.11 1999/07/12 16:09:37 mike Exp $"
  *
  *   Multi-language support for the Common UNIX Printing System (CUPS).
  *
@@ -181,7 +181,7 @@ typedef struct cups_lang_str        /**** Language Cache Structure ****/
 extern char            *cupsLangEncoding(cups_lang_t *lang);
 extern void            cupsLangFlush(void);
 extern void            cupsLangFree(cups_lang_t *lang);
-extern cups_lang_t     *cupsLangGet(char *language);
+extern cups_lang_t     *cupsLangGet(const char *language);
 #  define              cupsLangString(lang,msg) (lang)->messages[(msg)]
 
 #  ifdef __cplusplus
@@ -191,5 +191,5 @@ extern cups_lang_t  *cupsLangGet(char *language);
 #endif /* !_CUPS_LANGUAGE_H_ */
 
 /*
- * End of "$Id: language.h,v 1.10 1999/07/12 12:42:50 mike Exp $".
+ * End of "$Id: language.h,v 1.11 1999/07/12 16:09:37 mike Exp $".
  */
index 900df1a451aee101b7eda0ced564192a94ddd643..78d5213b079eeb2df84537569cb926d8050af2a7 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * "$Id: mark.c,v 1.13 1999/07/12 14:02:39 mike Exp $"
+ * "$Id: mark.c,v 1.14 1999/07/12 16:09:38 mike Exp $"
  *
  *   Option marking routines for the Common UNIX Printing System (CUPS).
  *
@@ -180,7 +180,7 @@ ppdConflicts(ppd_file_t *ppd)       /* I - PPD to check */
 
 ppd_choice_t *                         /* O - Choice pointer or NULL */
 ppdFindChoice(ppd_option_t *o,         /* I - Pointer to option */
-              char         *choice)    /* I - Name of choice */
+              const char   *choice)    /* I - Name of choice */
 {
   int          i;              /* Looping var */
   ppd_choice_t *c;             /* Current choice */
@@ -203,7 +203,7 @@ ppdFindChoice(ppd_option_t *o,              /* I - Pointer to option */
 
 ppd_choice_t *                         /* O - Pointer to choice or NULL */
 ppdFindMarkedChoice(ppd_file_t *ppd,   /* I - PPD file */
-                    char       *option)        /* I - Keyword/option name */
+                    const char *option)        /* I - Keyword/option name */
 {
   int          i;              /* Looping var */
   ppd_option_t *o;             /* Pointer to option */
@@ -227,7 +227,7 @@ ppdFindMarkedChoice(ppd_file_t *ppd,        /* I - PPD file */
 
 ppd_option_t *                         /* O - Pointer to option or NULL */
 ppdFindOption(ppd_file_t *ppd,         /* I - PPD file data */
-              char       *option)      /* I - Option/Keyword name */
+              const char *option)      /* I - Option/Keyword name */
 {
   int          i, j, k;        /* Looping vars */
   ppd_option_t *o;             /* Pointer to option */
@@ -260,8 +260,8 @@ ppdFindOption(ppd_file_t *ppd,              /* I - PPD file data */
 
 int                            /* O - Non-zero if option is marked */
 ppdIsMarked(ppd_file_t *ppd,   /* I - PPD file data */
-            char       *option,        /* I - Option/Keyword name */
-            char       *choice)        /* I - Choice name */
+            const char *option,        /* I - Option/Keyword name */
+            const char *choice)        /* I - Choice name */
 {
   ppd_option_t *o;             /* Option pointer */
   ppd_choice_t *c;             /* Choice pointer */
@@ -316,8 +316,8 @@ ppdMarkDefaults(ppd_file_t *ppd)/* I - PPD file record */
 
 int                                    /* O - Number of conflicts */
 ppdMarkOption(ppd_file_t *ppd,         /* I - PPD file record */
-              char       *option,      /* I - Keyword */
-              char       *choice)      /* I - Option name */
+              const char *option,      /* I - Keyword */
+              const char *choice)      /* I - Option name */
 {
   int          i;              /* Looping var */
   ppd_option_t *o;             /* Option pointer */
@@ -436,5 +436,5 @@ ppd_default(ppd_option_t *o)        /* I - Option to default */
 
 
 /*
- * End of "$Id: mark.c,v 1.13 1999/07/12 14:02:39 mike Exp $".
+ * End of "$Id: mark.c,v 1.14 1999/07/12 16:09:38 mike Exp $".
  */
index 3f23052de37ea377660748546e73191e8b3e6e08..d7bdd71185fe5dda3453a4d8e20eab27721c44f7 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * "$Id: mime.c,v 1.13 1999/06/18 18:36:10 mike Exp $"
+ * "$Id: mime.c,v 1.14 1999/07/12 16:09:38 mike Exp $"
  *
  *   MIME database file routines for the Common UNIX Printing System (CUPS).
  *
@@ -33,6 +33,9 @@
  * Revision History:
  *
  *   $Log: mime.c,v $
+ *   Revision 1.14  1999/07/12 16:09:38  mike
+ *   Fixed all constant arrays to use "const" modifier.
+ *
  *   Revision 1.13  1999/06/18 18:36:10  mike
  *   Fixed address to 44141 Airport View Drive...
  *
@@ -177,8 +180,8 @@ mimeDelete(mime_t *mime)    /* I - MIME database */
  */
 
 mime_t *                       /* O - Updated MIME database */
-mimeMerge(mime_t *mime,                /* I - MIME database to add to */
-          char   *pathname)    /* I - Directory to load */
+mimeMerge(mime_t     *mime,    /* I - MIME database to add to */
+          const char *pathname)        /* I - Directory to load */
 {
 #if defined(WIN32) || defined(__EMX__)
   HANDLE       dir;            /* Directory handle */
@@ -610,5 +613,5 @@ delete_rules(mime_magic_t *rules)   /* I - Rules to free */
 
 
 /*
- * End of "$Id: mime.c,v 1.13 1999/06/18 18:36:10 mike Exp $".
+ * End of "$Id: mime.c,v 1.14 1999/07/12 16:09:38 mike Exp $".
  */
index 5e9fcf5a7402ee9046efe1759f3a6b16c3f5227c..c1b1d57756715c73ff6bb02f383e32c047daf679 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * "$Id: mime.h,v 1.5 1999/06/18 18:36:11 mike Exp $"
+ * "$Id: mime.h,v 1.6 1999/07/12 16:09:39 mike Exp $"
  *
  *   MIME type/conversion database definitions for the Common UNIX Printing System (CUPS).
  *
@@ -114,16 +114,16 @@ typedef struct                            /**** MIME Database ****/
 
 extern void            mimeDelete(mime_t *mime);
 #define mimeLoad(pathname)     mimeMerge((mime_t *)0, (pathname));
-extern mime_t          *mimeMerge(mime_t *mime, char *pathname);
+extern mime_t          *mimeMerge(mime_t *mime, const char *pathname);
 extern mime_t          *mimeNew(void);
 
-extern mime_type_t     *mimeAddType(mime_t *mime, char *super, char *type);
-extern int             mimeAddTypeRule(mime_type_t *mt, char *rule);
-extern mime_type_t     *mimeFileType(mime_t *mime, char *pathname);
-extern mime_type_t     *mimeType(mime_t *mime, char *super, char *type);
+extern mime_type_t     *mimeAddType(mime_t *mime, const char *super, const char *type);
+extern int             mimeAddTypeRule(mime_type_t *mt, const char *rule);
+extern mime_type_t     *mimeFileType(mime_t *mime, const char *pathname);
+extern mime_type_t     *mimeType(mime_t *mime, const char *super, const char *type);
 
 extern mime_filter_t   *mimeAddFilter(mime_t *mime, mime_type_t *src, mime_type_t *dst,
-                                      int cost, char *filter);
+                                      int cost, const char *filter);
 extern mime_filter_t   *mimeFilter(mime_t *mime, mime_type_t *src, mime_type_t *dst,
                                    int *num_filters);
 
@@ -133,5 +133,5 @@ extern mime_filter_t        *mimeFilter(mime_t *mime, mime_type_t *src, mime_type_t *ds
 #endif /* !_MIME_H_ */
 
 /*
- * End of "$Id: mime.h,v 1.5 1999/06/18 18:36:11 mike Exp $".
+ * End of "$Id: mime.h,v 1.6 1999/07/12 16:09:39 mike Exp $".
  */
index f91cf8e7c53f81872bde46779a3ea1a3644036fa..6801a388739586e3e4eef618a0e521306f8655f8 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * "$Id: options.c,v 1.10 1999/07/12 14:02:40 mike Exp $"
+ * "$Id: options.c,v 1.11 1999/07/12 16:09:39 mike Exp $"
  *
  *   Option routines for the Common UNIX Printing System (CUPS).
  *
@@ -45,8 +45,8 @@
  */
 
 int                                            /* O - Number of options */
-cupsAddOption(char          *name,             /* I - Name of option */
-              char          *value,            /* I - Value of option */
+cupsAddOption(const char    *name,             /* I - Name of option */
+              const char    *value,            /* I - Value of option */
              int           num_options,        /* I - Number of options */
               cups_option_t **options)         /* IO - Pointer to options */
 {
@@ -128,8 +128,8 @@ cupsFreeOptions(int           num_options,  /* I - Number of options */
  * 'cupsGetOption()' - Get an option value.
  */
 
-char *                                 /* O - Option value or NULL */
-cupsGetOption(char          *name,     /* I - Name of option */
+const char *                           /* O - Option value or NULL */
+cupsGetOption(const char    *name,     /* I - Name of option */
               int           num_options,/* I - Number of options */
               cups_option_t *options)  /* I - Options */
 {
@@ -152,7 +152,7 @@ cupsGetOption(char          *name,  /* I - Name of option */
  */
 
 int                                            /* O - Number of options found */
-cupsParseOptions(char          *arg,           /* I - Argument to parse */
+cupsParseOptions(const char    *arg,           /* I - Argument to parse */
                  int           num_options,    /* I - Number of options */
                  cups_option_t **options)      /* O - Options found */
 {
@@ -374,5 +374,5 @@ cupsMarkOptions(ppd_file_t    *ppd,         /* I - PPD file */
 
 
 /*
- * End of "$Id: options.c,v 1.10 1999/07/12 14:02:40 mike Exp $".
+ * End of "$Id: options.c,v 1.11 1999/07/12 16:09:39 mike Exp $".
  */
index 69d479bbc4e38e8cd900eea5758b924b84804936..5f9991db573bce17b0cce71e31aa388a2c2734ef 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * "$Id: page.c,v 1.7 1999/07/12 14:02:40 mike Exp $"
+ * "$Id: page.c,v 1.8 1999/07/12 16:09:40 mike Exp $"
  *
  *   Page size functions for the Common UNIX Printing System (CUPS).
  *
@@ -45,7 +45,7 @@
 
 ppd_size_t *                   /* O - Size record for page or NULL */
 ppdPageSize(ppd_file_t *ppd,   /* I - PPD file record */
-            char       *name)  /* I - Size name */
+            const char *name)  /* I - Size name */
 {
   int  i;                      /* Looping var */
   float        w, l;                   /* Width and length of page */
@@ -154,7 +154,7 @@ ppdPageSize(ppd_file_t *ppd,        /* I - PPD file record */
 
 float                          /* O - Width of page in points or 0.0 */
 ppdPageWidth(ppd_file_t *ppd,  /* I - PPD file record */
-             char       *name) /* I - Size name */
+             const char *name) /* I - Size name */
 {
   ppd_size_t   *size;          /* Page size */
 
@@ -172,7 +172,7 @@ ppdPageWidth(ppd_file_t *ppd,       /* I - PPD file record */
 
 float                          /* O - Length of page in points or 0.0 */
 ppdPageLength(ppd_file_t *ppd, /* I - PPD file */
-              char       *name)        /* I - Size name */
+              const char *name)        /* I - Size name */
 {
   ppd_size_t   *size;          /* Page size */
 
@@ -185,5 +185,5 @@ ppdPageLength(ppd_file_t *ppd,      /* I - PPD file */
 
 
 /*
- * End of "$Id: page.c,v 1.7 1999/07/12 14:02:40 mike Exp $".
+ * End of "$Id: page.c,v 1.8 1999/07/12 16:09:40 mike Exp $".
  */
index 6cbc8bcdb4c10954ddd03e8c98a6df088ee062df..dfa7ecea87634ecec5aec4961c164eec0cebad7f 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * "$Id: ppd.c,v 1.27 1999/07/12 12:42:50 mike Exp $"
+ * "$Id: ppd.c,v 1.28 1999/07/12 16:09:40 mike Exp $"
  *
  *   PPD file routines for the Common UNIX Printing System (CUPS).
  *
@@ -1280,7 +1280,7 @@ ppdOpenFd(int fd)         /* I - File to read from */
  */
 
 ppd_file_t *                   /* O - PPD file record */
-ppdOpenFile(char *filename)    /* I - File to read from */
+ppdOpenFile(const char *filename) /* I - File to read from */
 {
   FILE         *fp;            /* File pointer */
   ppd_file_t   *ppd;           /* PPD file record */
@@ -1754,5 +1754,5 @@ ppd_fix(char *string)             /* IO - String to fix */
 
 
 /*
- * End of "$Id: ppd.c,v 1.27 1999/07/12 12:42:50 mike Exp $".
+ * End of "$Id: ppd.c,v 1.28 1999/07/12 16:09:40 mike Exp $".
  */
index cb2cc79f39ad7d626a584ae396b14e85a52757c8..a3fb72d4a29aa9aa5e0f3ad1ae504f45b164788c 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * "$Id: ppd.h,v 1.15 1999/05/17 18:11:46 mike Exp $"
+ * "$Id: ppd.h,v 1.16 1999/07/12 16:09:41 mike Exp $"
  *
  *   PostScript Printer Description definitions for the Common UNIX Printing
  *   System (CUPS).
@@ -209,20 +209,20 @@ extern int                ppdEmit(ppd_file_t *ppd, FILE *fp,
                                ppd_section_t section);
 extern int             ppdEmitFd(ppd_file_t *ppd, int fd,
                                  ppd_section_t section);
-extern int             ppdIsMarked(ppd_file_t *ppd, char *keyword,
-                                   char *option);
+extern int             ppdIsMarked(ppd_file_t *ppd, const char *keyword,
+                                   const char *option);
 extern void            ppdMarkDefaults(ppd_file_t *ppd);
-extern int             ppdMarkOption(ppd_file_t *ppd, char *keyword,
-                                     char *option);
-extern ppd_choice_t    *ppdFindChoice(ppd_option_t *o, char *option);
-extern ppd_choice_t    *ppdFindMarkedChoice(ppd_file_t *ppd, char *keyword);
-extern ppd_option_t    *ppdFindOption(ppd_file_t *ppd, char *keyword);
+extern int             ppdMarkOption(ppd_file_t *ppd, const char *keyword,
+                                     const char *option);
+extern ppd_choice_t    *ppdFindChoice(ppd_option_t *o, const char *option);
+extern ppd_choice_t    *ppdFindMarkedChoice(ppd_file_t *ppd, const char *keyword);
+extern ppd_option_t    *ppdFindOption(ppd_file_t *ppd, const char *keyword);
 extern ppd_file_t      *ppdOpen(FILE *fp);
 extern ppd_file_t      *ppdOpenFd(int fd);
-extern ppd_file_t      *ppdOpenFile(char *filename);
-extern float           ppdPageLength(ppd_file_t *ppd, char *name);
-extern ppd_size_t      *ppdPageSize(ppd_file_t *ppd, char *name);
-extern float           ppdPageWidth(ppd_file_t *ppd, char *name);
+extern ppd_file_t      *ppdOpenFile(const char *filename);
+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);
 
 /*
  * C++ magic...
@@ -234,5 +234,5 @@ extern float                ppdPageWidth(ppd_file_t *ppd, char *name);
 #endif /* !_CUPS_PPD_H_ */
 
 /*
- * End of "$Id: ppd.h,v 1.15 1999/05/17 18:11:46 mike Exp $".
+ * End of "$Id: ppd.h,v 1.16 1999/07/12 16:09:41 mike Exp $".
  */
index a47e3c555b9e55d1c49c6bc60de71e8770206795..7589ed716bb0bbfd8468a477bd2b6eebc90e504a 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * "$Id: testppd.c,v 1.12 1999/06/18 18:36:12 mike Exp $"
+ * "$Id: testppd.c,v 1.13 1999/07/12 16:09:41 mike Exp $"
  *
  *   PPD 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 */
 {
   int          i, j, k, m, n;  /* Looping vars */
-  char         *filename;      /* File to load */
+  const char   *filename;      /* File to load */
   ppd_file_t   *ppd;           /* PPD file record */
   ppd_size_t   *size;          /* Size record */
   ppd_group_t  *group;         /* UI group */
@@ -179,5 +179,5 @@ main(int  argc,                     /* I - Number of command-line arguments */
 
 
 /*
- * End of "$Id: testppd.c,v 1.12 1999/06/18 18:36:12 mike Exp $".
+ * End of "$Id: testppd.c,v 1.13 1999/07/12 16:09:41 mike Exp $".
  */
index e739bb288b37231794047d9be9882271588d150f..64a477fd225716036eda208a208ccba287698ef8 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * "$Id: type.c,v 1.8 1999/06/18 18:36:13 mike Exp $"
+ * "$Id: type.c,v 1.9 1999/07/12 16:09:41 mike Exp $"
  *
  *   MIME typing routines for the Common UNIX Printing System (CUPS).
  *
@@ -50,8 +50,8 @@
  */
 
 static int     compare(mime_type_t **, mime_type_t **);
-static int     checkrules(char *, FILE *, mime_magic_t *);
-static int     patmatch(char *, char *);
+static int     checkrules(const char *, FILE *, mime_magic_t *);
+static int     patmatch(const char *, const char *);
 
 
 /*
@@ -59,9 +59,9 @@ static int    patmatch(char *, char *);
  */
 
 mime_type_t *                  /* O - New (or existing) MIME type */
-mimeAddType(mime_t *mime,      /* I - MIME database */
-            char   *super,     /* I - Super-type name */
-           char   *type)       /* I - Type name */
+mimeAddType(mime_t     *mime,  /* I - MIME database */
+            const char *super, /* I - Super-type name */
+           const char *type)   /* I - Type name */
 {
   mime_type_t  *temp,          /* New MIME type */
                **types;        /* New MIME types array */
@@ -125,7 +125,7 @@ mimeAddType(mime_t *mime,   /* I - MIME database */
 
 int                                    /* O - 0 on success, -1 on failure */
 mimeAddTypeRule(mime_type_t *mt,       /* I - Type to add to */
-                char        *rule)     /* I - Rule to add */
+                const char  *rule)     /* I - Rule to add */
 {
   int          num_values,             /* Number of values seen */
                op,                     /* Operation code */
@@ -497,14 +497,14 @@ mimeAddTypeRule(mime_type_t *mt,  /* I - Type to add to */
  * 'mimeFileType()' - Determine the type of a file.
  */
 
-mime_type_t *                  /* O - Type of file */
-mimeFileType(mime_t *mime,     /* I - MIME database */
-             char   *pathname) /* I - Name of file to check */
+mime_type_t *                          /* O - Type of file */
+mimeFileType(mime_t     *mime,         /* I - MIME database */
+             const char *pathname)     /* I - Name of file to check */
 {
   int          i;              /* Looping var */
   FILE         *fp;            /* File pointer */
   mime_type_t  **types;        /* File types */
-  char         *filename;      /* Base filename of file */
+  const char   *filename;      /* Base filename of file */
 
 
  /*
@@ -556,9 +556,9 @@ mimeFileType(mime_t *mime,  /* I - MIME database */
  */
 
 mime_type_t *                  /* O - Matching file type definition */
-mimeType(mime_t *mime,         /* I - MIME database */
-         char   *super,                /* I - Super-type name */
-        char   *type)          /* I - Type name */
+mimeType(mime_t     *mime,     /* I - MIME database */
+         const char *super,    /* I - Super-type name */
+        const char *type)      /* I - Type name */
 {
   mime_type_t  key,            /* MIME type search key*/
                *keyptr,        /* Key pointer... */
@@ -620,7 +620,7 @@ compare(mime_type_t **t0,   /* I - First type */
  */
 
 static int                             /* O - 1 if match, 0 if no match */
-checkrules(char         *filename,     /* I - Filename */
+checkrules(const char   *filename,     /* I - Filename */
            FILE         *fp,           /* I - File to check */
            mime_magic_t *rules)                /* I - Rules to check */
 {
@@ -906,9 +906,9 @@ checkrules(char         *filename,  /* I - Filename */
  * 'patmatch()' - Pattern matching...
  */
 
-static int             /* O - 1 if match, 0 if no match */
-patmatch(char *s,      /* I - String to match against */
-         char *pat)    /* I - Pattern to match against */
+static int                     /* O - 1 if match, 0 if no match */
+patmatch(const char *s,                /* I - String to match against */
+         const char *pat)      /* I - Pattern to match against */
 {
  /*
   * Range check the input...
@@ -1007,5 +1007,5 @@ patmatch(char *s, /* I - String to match against */
 
 
 /*
- * End of "$Id: type.c,v 1.8 1999/06/18 18:36:13 mike Exp $".
+ * End of "$Id: type.c,v 1.9 1999/07/12 16:09:41 mike Exp $".
  */
index 92cac6a8da56e2118981fcddc4d4bf8dc1128029..d26cfc41996693a49d471c6d79915afd324536bf 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * "$Id: usersys.c,v 1.1 1999/06/21 18:46:15 mike Exp $"
+ * "$Id: usersys.c,v 1.2 1999/07/12 16:09:42 mike Exp $"
  *
  *   User, system, and password routines for the Common UNIX Printing
  *   System (CUPS).
@@ -45,7 +45,7 @@
  * 'cupsUser()' - Return the current user's name.
  */
 
-char *                                 /* O - User name */
+const char *                           /* O - User name */
 cupsUser(void)
 {
   return ("WindowsUser");
@@ -56,7 +56,7 @@ cupsUser(void)
  * 'cupsGetPassword()' - Get a password from the user...
  */
 
-char *                                 /* O - Password */
+const char *                           /* O - Password */
 cupsGetPassword(const char *prompt)    /* I - Prompt string */
 {
   return (NULL);
@@ -72,7 +72,7 @@ cupsGetPassword(const char *prompt)   /* I - Prompt string */
  * 'cupsUser()' - Return the current user's name.
  */
 
-char *                                 /* O - User name */
+const char *                           /* O - User name */
 cupsUser(void)
 {
   struct passwd        *pwd;                   /* User/password entry */
@@ -105,7 +105,7 @@ cupsUser(void)
  * 'cupsGetPassword()' - Get a password from the user...
  */
 
-char *                                 /* O - Password */
+const char *                           /* O - Password */
 cupsGetPassword(const char *prompt)    /* I - Prompt string */
 {
   return (getpass(prompt));
@@ -117,7 +117,7 @@ cupsGetPassword(const char *prompt) /* I - Prompt string */
  * 'cupsServer()' - Return the hostname of the default server...
  */
 
-char *                                 /* O - Server name */
+const char *                           /* O - Server name */
 cupsServer(void)
 {
   FILE         *fp;                    /* cupsd.conf file */
@@ -171,5 +171,5 @@ cupsServer(void)
 
 
 /*
- * End of "$Id: usersys.c,v 1.1 1999/06/21 18:46:15 mike Exp $".
+ * End of "$Id: usersys.c,v 1.2 1999/07/12 16:09:42 mike Exp $".
  */
index 5e04bc4ea59175ecef100677a3f3975fca2cd27d..447a718b4f9f3806bbb6cef252ae44cf3d3e48e8 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * "$Id: util.c,v 1.25 1999/07/12 12:42:50 mike Exp $"
+ * "$Id: util.c,v 1.26 1999/07/12 16:09:42 mike Exp $"
  *
  *   Printing utilities for the Common UNIX Printing System (CUPS).
  *
@@ -64,7 +64,7 @@ static http_t *cups_server = NULL;
  * Local functions...
  */
 
-static char    *cups_connect(char *name, char *printer, char *hostname);
+static char    *cups_connect(const char *name, char *printer, char *hostname);
 
 
 /*
@@ -72,8 +72,8 @@ static char   *cups_connect(char *name, char *printer, char *hostname);
  */
 
 int                            /* O - 1 on success, 0 on failure */
-cupsCancelJob(char *name,      /* I - Name of printer or class */
-              int  job)                /* I - Job ID */
+cupsCancelJob(const char *name,        /* I - Name of printer or class */
+              int        job)  /* I - Job ID */
 {
   char         printer[HTTP_MAX_URI],  /* Printer name */
                hostname[HTTP_MAX_URI], /* Hostname */
@@ -137,10 +137,10 @@ cupsCancelJob(char *name, /* I - Name of printer or class */
  */
 
 ipp_t *                                        /* O - Response data */
-cupsDoFileRequest(http_t *http,                /* I - HTTP connection to server */
-                  ipp_t  *request,     /* I - IPP request */
-                  char   *resource,    /* I - HTTP resource for POST */
-                 char   *filename)     /* I - File to send or NULL */
+cupsDoFileRequest(http_t     *http,    /* I - HTTP connection to server */
+                  ipp_t      *request, /* I - IPP request */
+                  const char *resource,        /* I - HTTP resource for POST */
+                 const char *filename) /* I - File to send or NULL */
 {
   ipp_t                *response;      /* IPP response data */
   char         length[255];    /* Content-Length field */
@@ -149,8 +149,8 @@ cupsDoFileRequest(http_t *http,             /* I - HTTP connection to server */
   struct stat  fileinfo;       /* File information */
   int          bytes;          /* Number of bytes read/written */
   char         buffer[8192];   /* Output buffer */
-  char         *password,      /* Password string */
-               plain[255],     /* Plaintext username:password */
+  const char   *password;      /* Password string */
+  char         plain[255],     /* Plaintext username:password */
                encode[255];    /* Encoded username:password */
   char         junk[8192];     /* Junk buffer for error data */
   static char  authstring[255] = "";
@@ -418,7 +418,7 @@ cupsGetClasses(char ***classes)     /* O - Classes */
  * 'cupsGetDefault()' - Get the default printer or class.
  */
 
-char *                         /* O - Default printer or NULL */
+const char *                   /* O - Default printer or NULL */
 cupsGetDefault(void)
 {
   ipp_t                *request,       /* IPP Request */
@@ -490,8 +490,8 @@ cupsGetDefault(void)
  * 'cupsGetPPD()' - Get the PPD file for a printer.
  */
 
-char *                         /* O - Filename for PPD file */
-cupsGetPPD(char *name)         /* I - Printer name */
+const char *                   /* O - Filename for PPD file */
+cupsGetPPD(const char *name)   /* I - Printer name */
 {
   FILE         *fp;                    /* PPD file */
   int          bytes;                  /* Number of bytes read */
@@ -655,9 +655,9 @@ cupsGetPrinters(char ***printers)   /* O - Printers */
  */
 
 int                                    /* O - Job ID */
-cupsPrintFile(char          *name,     /* I - Printer or class name */
-              char          *filename, /* I - File to print */
-             char          *title,     /* I - Title of job */
+cupsPrintFile(const char    *name,     /* I - Printer or class name */
+              const char    *filename, /* I - File to print */
+             const char    *title,     /* I - Title of job */
               int           num_options,/* I - Number of options */
              cups_option_t *options)   /* I - Options */
 {
@@ -893,10 +893,10 @@ cupsPrintFile(char          *name,        /* I - Printer or class name */
  * 'cups_connect()' - Connect to the specified host...
  */
 
-static char *                  /* I - Printer name if success, NULL if fail */
-cups_connect(char *name,       /* I - Destination (printer[@host]) */
-            char *printer,     /* O - Printer name */
-             char *hostname)   /* O - Hostname */
+static char *                          /* I - Printer name or NULL */
+cups_connect(const char *name,         /* I - Destination (printer[@host]) */
+            char       *printer,       /* O - Printer name */
+             char       *hostname)     /* O - Hostname */
 {
   char         hostbuf[HTTP_MAX_URI];
                                /* Name of host */
@@ -936,5 +936,5 @@ cups_connect(char *name,    /* I - Destination (printer[@host]) */
 
 
 /*
- * End of "$Id: util.c,v 1.25 1999/07/12 12:42:50 mike Exp $".
+ * End of "$Id: util.c,v 1.26 1999/07/12 16:09:42 mike Exp $".
  */