]> git.ipfire.org Git - thirdparty/cups.git/blobdiff - scheduler/mime.h
Load cups into easysw/current.
[thirdparty/cups.git] / scheduler / mime.h
index cd023fa8a6dfa9e9357a39373e13cbf7a1812d75..87e2fa625f7c33edf374277c63875af76eb39d76 100644 (file)
@@ -1,25 +1,16 @@
 /*
- * "$Id: mime.h 4970 2006-01-24 14:05:45Z mike $"
+ * "$Id: mime.h 6649 2007-07-11 21:46:42Z mike $"
  *
  *   MIME type/conversion database definitions for the Common UNIX Printing System (CUPS).
  *
- *   Copyright 1997-2006 by Easy Software Products, all rights reserved.
+ *   Copyright 2007 by Apple Inc.
+ *   Copyright 1997-2007 by Easy Software Products, all rights reserved.
  *
  *   These coded instructions, statements, and computer programs are the
- *   property of Easy Software Products and are protected by Federal
- *   copyright law.  Distribution and use rights are outlined in the file
- *   "LICENSE.txt" which should have been included with this file.  If this
- *   file is missing or damaged please contact Easy Software Products
- *   at:
- *
- *       Attn: CUPS Licensing Information
- *       Easy Software Products
- *       44141 Airport View Drive, Suite 204
- *       Hollywood, Maryland 20636 USA
- *
- *       Voice: (301) 373-9600
- *       EMail: cups-info@cups.org
- *         WWW: http://www.cups.org
+ *   property of Apple Inc. and are protected by Federal copyright
+ *   law.  Distribution and use rights are outlined in the file "LICENSE.txt"
+ *   which should have been included with this file.  If this file is
+ *   file is missing or damaged, see the license at "http://www.cups.org/".
  */
 
 #ifndef _CUPS_MIME_H_
@@ -34,9 +25,9 @@
  * C++ magic...
  */
 
-#  ifdef _cplusplus
+#  ifdef __cplusplus
 extern "C" {
-#  endif /* _cplusplus */
+#  endif /* __cplusplus */
 
 
 /*
@@ -46,7 +37,7 @@ extern "C" {
 #  define MIME_MAX_SUPER       16              /* Maximum size of supertype name */
 #  define MIME_MAX_TYPE                IPP_MAX_NAME    /* Maximum size of type name */
 #  define MIME_MAX_FILTER      256             /* Maximum size of filter pathname */
-#  define MIME_MAX_BUFFER      8192            /* Maximum size of file buffer */
+#  define MIME_MAX_BUFFER      4096            /* Maximum size of file buffer */
 
 
 /*
@@ -70,9 +61,9 @@ typedef enum
   MIME_MAGIC_ISTRING                   /* Case-insensitive string matches */
 } mime_op_t;
 
-typedef struct mime_magic_str          /**** MIME Magic Data ****/
+typedef struct _mime_magic_s           /**** MIME Magic Data ****/
 {
-  struct mime_magic_str        *prev,          /* Previous rule */
+  struct _mime_magic_s *prev,          /* Previous rule */
                        *next,          /* Next rule */
                        *parent,        /* Parent rules */
                        *child;         /* Child rules */
@@ -92,14 +83,14 @@ typedef struct mime_magic_str               /**** MIME Magic Data ****/
   }            value;
 } mime_magic_t;
 
-typedef struct                         /**** MIME Type Data ****/
+typedef struct _mime_type_s            /**** MIME Type Data ****/
 {
   mime_magic_t *rules;                 /* Rules used to detect this type */
   char         super[MIME_MAX_SUPER],  /* Super-type name ("image", "application", etc.) */
                type[MIME_MAX_TYPE];    /* Type name ("png", "postscript", etc.) */
 } mime_type_t;
 
-typedef struct                         /**** MIME Conversion Filter Data ****/
+typedef struct _mime_filter_s          /**** MIME Conversion Filter Data ****/
 {
   mime_type_t  *src,                   /* Source type */
                *dst;                   /* Destination type */
@@ -107,10 +98,11 @@ typedef struct                             /**** MIME Conversion Filter Data ****/
   char         filter[MIME_MAX_FILTER];/* Filter program to use */
 } mime_filter_t;
 
-typedef struct                         /**** MIME Database ****/
+typedef struct _mime_s                 /**** MIME Database ****/
 {
   cups_array_t *types;                 /* File types */
   cups_array_t *filters;               /* Type conversion filters */
+  cups_array_t *srcs;                  /* Filters sorted by source type */
 } mime_t;
 
 
@@ -129,7 +121,7 @@ extern mime_type_t  *mimeAddType(mime_t *mime, const char *super,
 extern int             mimeAddTypeRule(mime_type_t *mt, const char *rule);
 extern void            mimeDeleteType(mime_t *mime, mime_type_t *mt);
 extern mime_type_t     *mimeFileType(mime_t *mime, const char *pathname,
-                                     int *compression);
+                                     const char *filename, int *compression);
 extern mime_type_t     *mimeFirstType(mime_t *mime);
 extern mime_type_t     *mimeNextType(mime_t *mime);
 extern int             mimeNumTypes(mime_t *mime);
@@ -141,16 +133,18 @@ extern mime_filter_t      *mimeAddFilter(mime_t *mime, mime_type_t *src,
                                       const char *filter);
 extern void            mimeDeleteFilter(mime_t *mime, mime_filter_t *filter);
 extern cups_array_t    *mimeFilter(mime_t *mime, mime_type_t *src,
-                                   mime_type_t *dst, int *cost, int max_depth);
+                                   mime_type_t *dst, int *cost);
+extern mime_filter_t   *mimeFilterLookup(mime_t *mime, mime_type_t *src,
+                                         mime_type_t *dst);
 extern mime_filter_t   *mimeFirstFilter(mime_t *mime);
 extern mime_filter_t   *mimeNextFilter(mime_t *mime);
 extern int             mimeNumFilters(mime_t *mime);
 
-#  ifdef _cplusplus
+#  ifdef __cplusplus
 }
-#  endif /* _cplusplus */
+#  endif /* __cplusplus */
 #endif /* !_CUPS_MIME_H_ */
 
 /*
- * End of "$Id: mime.h 4970 2006-01-24 14:05:45Z mike $".
+ * End of "$Id: mime.h 6649 2007-07-11 21:46:42Z mike $".
  */