]> git.ipfire.org Git - thirdparty/cups.git/blobdiff - cups/ipp-private.h
Add --help usage for all System V commands (Issue #5326)
[thirdparty/cups.git] / cups / ipp-private.h
index 70729cf591ebb7058ea6a24c30f77365c1f9732c..fa5e4355030f097e3a4180e75f67b183a36dfe42 100644 (file)
@@ -1,18 +1,11 @@
 /*
- * "$Id: ipp-private.h 7259 2008-01-28 22:26:04Z mike $"
+ * Private IPP definitions for CUPS.
  *
- *   Private IPP definitions for CUPS.
+ * Copyright © 2007-2018 by Apple Inc.
+ * Copyright © 1997-2006 by Easy Software Products.
  *
- *   Copyright 2007-2011 by Apple Inc.
- *   Copyright 1997-2006 by Easy Software Products.
- *
- *   These coded instructions, statements, and computer programs are the
- *   property of Apple Inc. and are protected by Federal copyright
- *   law.  Distribution and use rights are outlined in the file "LICENSE.txt"
- *   which should have been included with this file.  If this file is
- *   file is missing or damaged, see the license at "http://www.cups.org/".
- *
- *   This file is subject to the Apple OS-Developed Software exception.
+ * Licensed under Apache License v2.0.  See the file "LICENSE" for more
+ * information.
  */
 
 #ifndef _CUPS_IPP_PRIVATE_H_
@@ -22,7 +15,7 @@
  * Include necessary headers...
  */
 
-#  include <cups/ipp.h>
+#  include <cups/cups.h>
 
 
 /*
@@ -70,7 +63,7 @@ typedef union _ipp_request_u          /**** Request Header ****/
   }            status;
 
   /**** New in CUPS 1.1.19 ****/
-  struct                               /* Event Header @since CUPS 1.1.19/Mac OS X 10.3@ */
+  struct                               /* Event Header @since CUPS 1.1.19/macOS 10.3@ */
   {
     ipp_uchar_t        version[2];             /* Protocol version number */
     ipp_status_t status_code;          /* Status code */
@@ -78,8 +71,6 @@ typedef union _ipp_request_u          /**** Request Header ****/
   }            event;
 } _ipp_request_t;
 
-/**** New in CUPS 1.1.19 ****/
-
 typedef union _ipp_value_u             /**** Attribute Value ****/
 {
   int          integer;                /* Integer/enumerated value */
@@ -114,10 +105,10 @@ typedef union _ipp_value_u                /**** Attribute Value ****/
   }            unknown;                /* Unknown attribute type */
 
 /**** New in CUPS 1.1.19 ****/
-  ipp_t                *collection;            /* Collection value @since CUPS 1.1.19/Mac OS X 10.3@ */
+  ipp_t                *collection;            /* Collection value @since CUPS 1.1.19/macOS 10.3@ */
 } _ipp_value_t;
 
-struct _ipp_attribute_s                /**** Attribute ****/
+struct _ipp_attribute_s                        /**** IPP attribute ****/
 {
   ipp_attribute_t *next;               /* Next attribute in list */
   ipp_tag_t    group_tag,              /* Job/Printer/Operation group tag */
@@ -137,13 +128,16 @@ struct _ipp_s                             /**** IPP Request/Response/Notification ****/
   ipp_tag_t            curtag;         /* Current attribute group tag */
 
 /**** New in CUPS 1.2 ****/
-  ipp_attribute_t      *prev;          /* Previous attribute (for read) @since CUPS 1.2/Mac OS X 10.5@ */
+  ipp_attribute_t      *prev;          /* Previous attribute (for read) @since CUPS 1.2/macOS 10.5@ */
 
 /**** New in CUPS 1.4.4 ****/
-  int                  use;            /* Use count @since CUPS 1.4.4/Mac OS X 10.6.?@ */
+  int                  use;            /* Use count @since CUPS 1.4.4/macOS 10.6.?@ */
+/**** New in CUPS 2.0 ****/
+  int                  atend,          /* At end of list? */
+                       curindex;       /* Current attribute index for hierarchical search */
 };
 
-typedef struct                         /**** Attribute mapping data ****/
+typedef struct _ipp_option_s           /**** Attribute mapping data ****/
 {
   int          multivalue;             /* Option has multiple values? */
   const char   *name;                  /* Option/attribute name */
@@ -151,14 +145,68 @@ typedef struct                            /**** Attribute mapping data ****/
   ipp_tag_t    group_tag;              /* Group tag for this attribute */
   ipp_tag_t    alt_group_tag;          /* Alternate group tag for this
                                         * attribute */
+  const ipp_op_t *operations;          /* Allowed operations for this attr */
 } _ipp_option_t;
 
+typedef struct _ipp_file_s _ipp_file_t;/**** File Parser ****/
+typedef struct _ipp_vars_s _ipp_vars_t;/**** Variables ****/
+
+typedef int (*_ipp_fattr_cb_t)(_ipp_file_t *f, void *user_data, const char *attr);
+                                       /**** File Attribute (Filter) Callback ****/
+typedef int (*_ipp_ferror_cb_t)(_ipp_file_t *f, void *user_data, const char *error);
+                                       /**** File Parser Error Callback ****/
+typedef int (*_ipp_ftoken_cb_t)(_ipp_file_t *f, _ipp_vars_t *v, void *user_data, const char *token);
+                                       /**** File Parser Token Callback ****/
+
+struct _ipp_vars_s                     /**** Variables ****/
+{
+  char         *uri,                   /* URI for printer */
+               scheme[64],             /* Scheme from URI */
+               username[256],          /* Username from URI */
+               *password,              /* Password from URI (if any) */
+               host[256],              /* Hostname from URI */
+               portstr[32],            /* Port number string */
+               resource[1024];         /* Resource path from URI */
+  int          port;                   /* Port number from URI */
+  int          num_vars;               /* Number of variables */
+  cups_option_t        *vars;                  /* Array of variables */
+  int          password_tries;         /* Number of retries for password */
+  _ipp_fattr_cb_t attrcb;              /* Attribute (filter) callback */
+  _ipp_ferror_cb_t errorcb;            /* Error callback */
+  _ipp_ftoken_cb_t tokencb;            /* Token callback */
+};
+
+struct _ipp_file_s                     /**** File Parser */
+{
+  const char           *filename;      /* Filename */
+  cups_file_t          *fp;            /* File pointer */
+  int                  linenum;        /* Current line number */
+  ipp_t                        *attrs;         /* Attributes */
+  ipp_tag_t            group_tag;      /* Current group for new attributes */
+};
+
 
 /*
  * Prototypes for private functions...
  */
 
-extern _ipp_option_t   *_ippFindOption(const char *name);
+/* encode.c */
+#ifdef DEBUG
+extern const char      *_ippCheckOptions(void) _CUPS_PRIVATE;
+#endif /* DEBUG */
+extern _ipp_option_t   *_ippFindOption(const char *name) _CUPS_PRIVATE;
+
+/* ipp-file.c */
+extern ipp_t           *_ippFileParse(_ipp_vars_t *v, const char *filename, void *user_data) _CUPS_PRIVATE;
+extern int             _ippFileReadToken(_ipp_file_t *f, char *token, size_t tokensize) _CUPS_PRIVATE;
+
+/* ipp-vars.c */
+extern void            _ippVarsDeinit(_ipp_vars_t *v) _CUPS_PRIVATE;
+extern void            _ippVarsExpand(_ipp_vars_t *v, char *dst, const char *src, size_t dstsize) _CUPS_NONNULL(1,2,3) _CUPS_PRIVATE;
+extern const char      *_ippVarsGet(_ipp_vars_t *v, const char *name) _CUPS_PRIVATE;
+extern void            _ippVarsInit(_ipp_vars_t *v, _ipp_fattr_cb_t attrcb, _ipp_ferror_cb_t errorcb, _ipp_ftoken_cb_t tokencb) _CUPS_PRIVATE;
+extern const char      *_ippVarsPasswordCB(const char *prompt, http_t *http, const char *method, const char *resource, void *user_data) _CUPS_PRIVATE;
+extern int             _ippVarsSet(_ipp_vars_t *v, const char *name, const char *value) _CUPS_PRIVATE;
 
 
 /*
@@ -169,7 +217,3 @@ extern _ipp_option_t        *_ippFindOption(const char *name);
 }
 #  endif /* __cplusplus */
 #endif /* !_CUPS_IPP_H_ */
-
-/*
- * End of "$Id: ipp-private.h 7259 2008-01-28 22:26:04Z mike $".
- */