home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2009 February / PCWFEB09.iso / Software / Linux / SLAX 6.0.8 / slax-6.0.8.iso / slax / base / 006-devel.lzm / usr / include / cups / ipp.h < prev    next >
Encoding:
C/C++ Source or Header  |  2008-10-21  |  19.7 KB  |  498 lines

  1. /*
  2.  * "$Id: ipp.h 7721 2008-07-11 22:48:49Z mike $"
  3.  *
  4.  *   Internet Printing Protocol definitions for the Common UNIX Printing
  5.  *   System (CUPS).
  6.  *
  7.  *   Copyright 2007 by Apple Inc.
  8.  *   Copyright 1997-2006 by Easy Software Products.
  9.  *
  10.  *   These coded instructions, statements, and computer programs are the
  11.  *   property of Apple Inc. and are protected by Federal copyright
  12.  *   law.  Distribution and use rights are outlined in the file "LICENSE.txt"
  13.  *   which should have been included with this file.  If this file is
  14.  *   file is missing or damaged, see the license at "http://www.cups.org/".
  15.  *
  16.  *   This file is subject to the Apple OS-Developed Software exception.
  17.  */
  18.  
  19. #ifndef _CUPS_IPP_H_
  20. #  define _CUPS_IPP_H_
  21.  
  22. /*
  23.  * Include necessary headers...
  24.  */
  25.  
  26. #  include "http.h"
  27.  
  28.  
  29. /*
  30.  * C++ magic...
  31.  */
  32.  
  33. #  ifdef __cplusplus
  34. extern "C" {
  35. #  endif /* __cplusplus */
  36.  
  37.  
  38. /*
  39.  * IPP version string...
  40.  */
  41.  
  42. #  define IPP_VERSION        "\001\001"
  43.  
  44. /*
  45.  * IPP registered port number...
  46.  *
  47.  * Note: Applications should never use IPP_PORT, but instead use the
  48.  * ippPort() function to allow overrides via the IPP_PORT environment
  49.  * variable and services file if needed!
  50.  */
  51.  
  52. #  define IPP_PORT        631
  53.  
  54. /*
  55.  * Common limits...
  56.  */
  57.  
  58. #  define IPP_MAX_LENGTH    32767    /* Maximum size of any single value */
  59. #  define IPP_MAX_NAME        256    /* Maximum length of common name values */
  60. #  define IPP_MAX_VALUES    8    /* Power-of-2 allocation increment */
  61.  
  62.  
  63. /*
  64.  * Types and structures...
  65.  */
  66.  
  67. typedef enum ipp_tag_e            /**** Format tags for attributes... ****/
  68. {
  69.   IPP_TAG_ZERO = 0x00,            /* Zero tag - used for separators */
  70.   IPP_TAG_OPERATION,            /* Operation group */
  71.   IPP_TAG_JOB,                /* Job group */
  72.   IPP_TAG_END,                /* End-of-attributes */
  73.   IPP_TAG_PRINTER,            /* Printer group */
  74.   IPP_TAG_UNSUPPORTED_GROUP,        /* Unsupported attributes group */
  75.   IPP_TAG_SUBSCRIPTION,            /* Subscription group */
  76.   IPP_TAG_EVENT_NOTIFICATION,        /* Event group */
  77.   IPP_TAG_UNSUPPORTED_VALUE = 0x10,    /* Unsupported value */
  78.   IPP_TAG_DEFAULT,            /* Default value */
  79.   IPP_TAG_UNKNOWN,            /* Unknown value */
  80.   IPP_TAG_NOVALUE,            /* No-value value */
  81.   IPP_TAG_NOTSETTABLE = 0x15,        /* Not-settable value */
  82.   IPP_TAG_DELETEATTR,            /* Delete-attribute value */
  83.   IPP_TAG_ADMINDEFINE,            /* Admin-defined value */
  84.   IPP_TAG_INTEGER = 0x21,        /* Integer value */
  85.   IPP_TAG_BOOLEAN,            /* Boolean value */
  86.   IPP_TAG_ENUM,                /* Enumeration value */
  87.   IPP_TAG_STRING = 0x30,        /* Octet string value */
  88.   IPP_TAG_DATE,                /* Date/time value */
  89.   IPP_TAG_RESOLUTION,            /* Resolution value */
  90.   IPP_TAG_RANGE,            /* Range value */
  91.   IPP_TAG_BEGIN_COLLECTION,        /* Beginning of collection value */
  92.   IPP_TAG_TEXTLANG,            /* Text-with-language value */
  93.   IPP_TAG_NAMELANG,            /* Name-with-language value */
  94.   IPP_TAG_END_COLLECTION,        /* End of collection value */
  95.   IPP_TAG_TEXT = 0x41,            /* Text value */
  96.   IPP_TAG_NAME,                /* Name value */
  97.   IPP_TAG_KEYWORD = 0x44,        /* Keyword value */
  98.   IPP_TAG_URI,                /* URI value */
  99.   IPP_TAG_URISCHEME,            /* URI scheme value */
  100.   IPP_TAG_CHARSET,            /* Character set value */
  101.   IPP_TAG_LANGUAGE,            /* Language value */
  102.   IPP_TAG_MIMETYPE,            /* MIME media type value */
  103.   IPP_TAG_MEMBERNAME,            /* Collection member name value */
  104.   IPP_TAG_MASK = 0x7fffffff,        /* Mask for copied attribute values */
  105.   IPP_TAG_COPY = -0x7fffffff-1        /* Bitflag for copied attribute values */
  106. } ipp_tag_t;
  107.  
  108. typedef enum ipp_res_e            /**** Resolution units... ****/
  109. {
  110.   IPP_RES_PER_INCH = 3,            /* Pixels per inch */
  111.   IPP_RES_PER_CM            /* Pixels per centimeter */
  112. } ipp_res_t;
  113.  
  114. typedef enum ipp_finish_e        /**** Finishings... ****/
  115. {
  116.   IPP_FINISHINGS_NONE = 3,        /* No finishing */
  117.   IPP_FINISHINGS_STAPLE,        /* Staple (any location) */
  118.   IPP_FINISHINGS_PUNCH,            /* Punch (any location/count) */
  119.   IPP_FINISHINGS_COVER,            /* Add cover */
  120.   IPP_FINISHINGS_BIND,            /* Bind */
  121.   IPP_FINISHINGS_SADDLE_STITCH,        /* Staple interior */
  122.   IPP_FINISHINGS_EDGE_STITCH,        /* Stitch along any side */
  123.   IPP_FINISHINGS_FOLD,            /* Fold (any type) */
  124.   IPP_FINISHINGS_TRIM,            /* Trim (any type) */
  125.   IPP_FINISHINGS_BALE,            /* Bale (any type) */
  126.   IPP_FINISHINGS_BOOKLET_MAKER,        /* Fold to make booklet */
  127.   IPP_FINISHINGS_JOB_OFFSET,        /* Offset for binding (any type) */
  128.   IPP_FINISHINGS_STAPLE_TOP_LEFT = 20,    /* Staple top left corner */
  129.   IPP_FINISHINGS_STAPLE_BOTTOM_LEFT,    /* Staple bottom left corner */
  130.   IPP_FINISHINGS_STAPLE_TOP_RIGHT,    /* Staple top right corner */
  131.   IPP_FINISHINGS_STAPLE_BOTTOM_RIGHT,    /* Staple bottom right corner */
  132.   IPP_FINISHINGS_EDGE_STITCH_LEFT,    /* Stitch along left side */
  133.   IPP_FINISHINGS_EDGE_STITCH_TOP,    /* Stitch along top edge */
  134.   IPP_FINISHINGS_EDGE_STITCH_RIGHT,    /* Stitch along right side */
  135.   IPP_FINISHINGS_EDGE_STITCH_BOTTOM,    /* Stitch along bottom edge */
  136.   IPP_FINISHINGS_STAPLE_DUAL_LEFT,    /* Two staples on left */
  137.   IPP_FINISHINGS_STAPLE_DUAL_TOP,    /* Two staples on top */
  138.   IPP_FINISHINGS_STAPLE_DUAL_RIGHT,    /* Two staples on right */
  139.   IPP_FINISHINGS_STAPLE_DUAL_BOTTOM,    /* Two staples on bottom */
  140.   IPP_FINISHINGS_BIND_LEFT = 50,    /* Bind on left */
  141.   IPP_FINISHINGS_BIND_TOP,        /* Bind on top */
  142.   IPP_FINISHINGS_BIND_RIGHT,        /* Bind on right */
  143.   IPP_FINISHINGS_BIND_BOTTOM        /* Bind on bottom */
  144. } ipp_finish_t;
  145.  
  146. typedef enum ipp_orient_e        /**** Orientation... ****/
  147. {
  148.   IPP_PORTRAIT = 3,            /* No rotation */
  149.   IPP_LANDSCAPE,            /* 90 degrees counter-clockwise */
  150.   IPP_REVERSE_LANDSCAPE,        /* 90 degrees clockwise */
  151.   IPP_REVERSE_PORTRAIT            /* 180 degrees */
  152. } ipp_orient_t;
  153.  
  154. typedef enum ipp_quality_e        /**** Qualities... ****/
  155. {
  156.   IPP_QUALITY_DRAFT = 3,        /* Draft quality */
  157.   IPP_QUALITY_NORMAL,            /* Normal quality */
  158.   IPP_QUALITY_HIGH            /* High quality */
  159. } ipp_quality_t;
  160.  
  161. typedef enum ipp_jstate_e        /**** Job States.... */
  162. {
  163.   IPP_JOB_PENDING = 3,            /* Job is waiting to be printed */
  164.   IPP_JOB_HELD,                /* Job is held for printing */
  165.   IPP_JOB_PROCESSING,            /* Job is currently printing */
  166.   IPP_JOB_STOPPED,            /* Job has been stopped */
  167.   IPP_JOB_CANCELED,            /* Job has been canceled */
  168.   IPP_JOB_ABORTED,            /* Job has aborted due to error */
  169.   IPP_JOB_COMPLETED            /* Job has completed successfully */
  170. } ipp_jstate_t;
  171. #define IPP_JOB_CANCELLED IPP_JOB_CANCELED
  172.  
  173. typedef enum ipp_pstate_e        /**** Printer States.... */
  174. {
  175.   IPP_PRINTER_IDLE = 3,            /* Printer is idle */
  176.   IPP_PRINTER_PROCESSING,        /* Printer is working */
  177.   IPP_PRINTER_STOPPED            /* Printer is stopped */
  178. } ipp_pstate_t;
  179.  
  180. typedef enum ipp_state_e        /**** IPP states... ****/
  181. {
  182.   IPP_ERROR = -1,            /* An error occurred */
  183.   IPP_IDLE,                /* Nothing is happening/request completed */
  184.   IPP_HEADER,                /* The request header needs to be sent/received */
  185.   IPP_ATTRIBUTE,            /* One or more attributes need to be sent/received */
  186.   IPP_DATA                /* IPP request data needs to be sent/received */
  187. } ipp_state_t;
  188.  
  189. typedef enum ipp_op_e            /**** IPP operations... ****/
  190. {
  191.   IPP_PRINT_JOB = 0x0002,        /* Print a single file */
  192.   IPP_PRINT_URI,            /* Print a single URL @private@ */
  193.   IPP_VALIDATE_JOB,            /* Validate job options */
  194.   IPP_CREATE_JOB,            /* Create an empty print job */
  195.   IPP_SEND_DOCUMENT,            /* Add a file to a job */
  196.   IPP_SEND_URI,                /* Add a URL to a job @private@ */
  197.   IPP_CANCEL_JOB,            /* Cancel a job */
  198.   IPP_GET_JOB_ATTRIBUTES,        /* Get job attributes */
  199.   IPP_GET_JOBS,                /* Get a list of jobs */
  200.   IPP_GET_PRINTER_ATTRIBUTES,        /* Get printer attributes */
  201.   IPP_HOLD_JOB,                /* Hold a job for printing */
  202.   IPP_RELEASE_JOB,            /* Release a job for printing */
  203.   IPP_RESTART_JOB,            /* Reprint a job */
  204.   IPP_PAUSE_PRINTER = 0x0010,        /* Stop a printer */
  205.   IPP_RESUME_PRINTER,            /* Start a printer */
  206.   IPP_PURGE_JOBS,            /* Cancel all jobs */
  207.   IPP_SET_PRINTER_ATTRIBUTES,        /* Set printer attributes @private@ */
  208.   IPP_SET_JOB_ATTRIBUTES,        /* Set job attributes */
  209.   IPP_GET_PRINTER_SUPPORTED_VALUES,    /* Get supported attribute values */
  210.   IPP_CREATE_PRINTER_SUBSCRIPTION,    /* Create a printer subscription @since CUPS 1.2@ */
  211.   IPP_CREATE_JOB_SUBSCRIPTION,        /* Create a job subscription @since CUPS 1.2@ */
  212.   IPP_GET_SUBSCRIPTION_ATTRIBUTES,    /* Get subscription attributes @since CUPS 1.2@ */
  213.   IPP_GET_SUBSCRIPTIONS,        /* Get list of subscriptions @since CUPS 1.2@ */
  214.   IPP_RENEW_SUBSCRIPTION,        /* Renew a printer subscription @since CUPS 1.2@ */
  215.   IPP_CANCEL_SUBSCRIPTION,        /* Cancel a subscription @since CUPS 1.2@ */
  216.   IPP_GET_NOTIFICATIONS,        /* Get notification events @since CUPS 1.2@ */
  217.   IPP_SEND_NOTIFICATIONS,        /* Send notification events @private@ */
  218.   IPP_GET_PRINT_SUPPORT_FILES = 0x0021,    /* Get printer support files @private@ */
  219.   IPP_ENABLE_PRINTER,            /* Start a printer */
  220.   IPP_DISABLE_PRINTER,            /* Stop a printer */
  221.   IPP_PAUSE_PRINTER_AFTER_CURRENT_JOB,    /* Stop printer after the current job @private@ */
  222.   IPP_HOLD_NEW_JOBS,            /* Hold new jobs @private@ */
  223.   IPP_RELEASE_HELD_NEW_JOBS,        /* Release new jobs @private@ */
  224.   IPP_DEACTIVATE_PRINTER,        /* Stop a printer @private@ */
  225.   IPP_ACTIVATE_PRINTER,            /* Start a printer @private@ */
  226.   IPP_RESTART_PRINTER,            /* Restart a printer @private@ */
  227.   IPP_SHUTDOWN_PRINTER,            /* Turn a printer off @private@ */
  228.   IPP_STARTUP_PRINTER,            /* Turn a printer on @private@ */
  229.   IPP_REPROCESS_JOB,            /* Reprint a job @private@ */
  230.   IPP_CANCEL_CURRENT_JOB,        /* Cancel the current job @private@ */
  231.   IPP_SUSPEND_CURRENT_JOB,        /* Suspend the current job @private@ */
  232.   IPP_RESUME_JOB,            /* Resume the current job @private@ */
  233.   IPP_PROMOTE_JOB,            /* Promote a job to print sooner @private@ */
  234.   IPP_SCHEDULE_JOB_AFTER,        /* Schedule a job to print after another @private@ */
  235.   IPP_PRIVATE = 0x4000,            /* Reserved @private@ */
  236.   CUPS_GET_DEFAULT,            /* Get the default printer */
  237.   CUPS_GET_PRINTERS,            /* Get a list of printers and/or classes */
  238.   CUPS_ADD_MODIFY_PRINTER,        /* Add or modify a printer */
  239.   CUPS_DELETE_PRINTER,            /* Delete a printer */
  240.   CUPS_GET_CLASSES,            /* Get a list of classes @deprecated@ */
  241.   CUPS_ADD_MODIFY_CLASS,        /* Add or modify a class */
  242.   CUPS_DELETE_CLASS,            /* Delete a class */
  243.   CUPS_ACCEPT_JOBS,            /* Accept new jobs on a printer */
  244.   CUPS_REJECT_JOBS,            /* Reject new jobs on a printer */
  245.   CUPS_SET_DEFAULT,            /* Set the default printer */
  246.   CUPS_GET_DEVICES,            /* Get a list of supported devices */
  247.   CUPS_GET_PPDS,            /* Get a list of supported drivers */
  248.   CUPS_MOVE_JOB,            /* Move a job to a different printer */
  249.   CUPS_AUTHENTICATE_JOB,        /* Authenticate a job @since CUPS 1.2@ */
  250.   CUPS_GET_PPD                /* Get a PPD file @since CUPS 1.3@ */
  251. } ipp_op_t;
  252.  
  253. /* Old names for the operations */
  254. #define CUPS_ADD_PRINTER    CUPS_ADD_MODIFY_PRINTER
  255. #define CUPS_ADD_CLASS        CUPS_ADD_MODIFY_CLASS
  256.  
  257. typedef enum ipp_status_e        /**** IPP status codes... ****/
  258. {
  259.   IPP_OK = 0x0000,            /* successful-ok */
  260.   IPP_OK_SUBST,                /* successful-ok-ignored-or-substituted-attributes */
  261.   IPP_OK_CONFLICT,            /* successful-ok-conflicting-attributes */
  262.   IPP_OK_IGNORED_SUBSCRIPTIONS,        /* successful-ok-ignored-subscriptions */
  263.   IPP_OK_IGNORED_NOTIFICATIONS,        /* successful-ok-ignored-notifications */
  264.   IPP_OK_TOO_MANY_EVENTS,        /* successful-ok-too-many-events */
  265.   IPP_OK_BUT_CANCEL_SUBSCRIPTION,    /* successful-ok-but-cancel-subscription */
  266.   IPP_OK_EVENTS_COMPLETE,        /* successful-ok-events-complete */
  267.   IPP_REDIRECTION_OTHER_SITE = 0x200,    /*  */
  268.   CUPS_SEE_OTHER = 0x280,        /* cups-see-other */
  269.   IPP_BAD_REQUEST = 0x0400,        /* client-error-bad-request */
  270.   IPP_FORBIDDEN,            /* client-error-forbidden */
  271.   IPP_NOT_AUTHENTICATED,        /* client-error-not-authenticated */
  272.   IPP_NOT_AUTHORIZED,            /* client-error-not-authorized */
  273.   IPP_NOT_POSSIBLE,            /* client-error-not-possible */
  274.   IPP_TIMEOUT,                /* client-error-timeout */
  275.   IPP_NOT_FOUND,            /* client-error-not-found */
  276.   IPP_GONE,                /* client-error-gone */
  277.   IPP_REQUEST_ENTITY,            /* client-error-request-entity-too-large */
  278.   IPP_REQUEST_VALUE,            /* client-error-request-value-too-long */
  279.   IPP_DOCUMENT_FORMAT,            /* client-error-document-format-not-supported */
  280.   IPP_ATTRIBUTES,            /* client-error-attributes-or-values-not-supported */
  281.   IPP_URI_SCHEME,            /* client-error-uri-scheme-not-supported */
  282.   IPP_CHARSET,                /* client-error-charset-not-supported */
  283.   IPP_CONFLICT,                /* client-error-conflicting-attributes */
  284.   IPP_COMPRESSION_NOT_SUPPORTED,    /* client-error-compression-not-supported */
  285.   IPP_COMPRESSION_ERROR,        /* client-error-compression-error */
  286.   IPP_DOCUMENT_FORMAT_ERROR,        /* client-error-document-format-error */
  287.   IPP_DOCUMENT_ACCESS_ERROR,        /* client-error-document-access-error */
  288.   IPP_ATTRIBUTES_NOT_SETTABLE,        /* client-error-attributes-not-settable */
  289.   IPP_IGNORED_ALL_SUBSCRIPTIONS,    /* client-error-ignored-all-subscriptions */
  290.   IPP_TOO_MANY_SUBSCRIPTIONS,        /* client-error-too-many-subscriptions */
  291.   IPP_IGNORED_ALL_NOTIFICATIONS,    /* client-error-ignored-all-notifications */
  292.   IPP_PRINT_SUPPORT_FILE_NOT_FOUND,    /* client-error-print-support-file-not-found */
  293.  
  294.   IPP_INTERNAL_ERROR = 0x0500,        /* server-error-internal-error */
  295.   IPP_OPERATION_NOT_SUPPORTED,        /* server-error-operation-not-supported */
  296.   IPP_SERVICE_UNAVAILABLE,        /* server-error-service-unavailable */
  297.   IPP_VERSION_NOT_SUPPORTED,        /* server-error-version-not-supported */
  298.   IPP_DEVICE_ERROR,            /* server-error-device-error */
  299.   IPP_TEMPORARY_ERROR,            /* server-error-temporary-error */
  300.   IPP_NOT_ACCEPTING,            /* server-error-not-accepting-jobs */
  301.   IPP_PRINTER_BUSY,            /* server-error-busy */
  302.   IPP_ERROR_JOB_CANCELED,        /* server-error-job-canceled */
  303.   IPP_MULTIPLE_JOBS_NOT_SUPPORTED,    /* server-error-multiple-document-jobs-not-supported */
  304.   IPP_PRINTER_IS_DEACTIVATED        /* server-error-printer-is-deactivated */
  305. } ipp_status_t;
  306. #define IPP_ERROR_JOB_CANCELLED IPP_ERROR_JOB_CANCELED
  307.  
  308. typedef unsigned char ipp_uchar_t;    /**** Unsigned 8-bit integer/character ****/
  309.  
  310. /**** New in CUPS 1.2 ****/
  311. typedef ssize_t    (*ipp_iocb_t)(void *, ipp_uchar_t *, size_t);
  312.                     /**** IPP IO Callback Function @since CUPS 1.2@ ****/
  313.  
  314. typedef union ipp_request_u        /**** Request Header ****/
  315. {
  316.   struct                /* Any Header */
  317.   {
  318.     ipp_uchar_t    version[2];        /* Protocol version number */
  319.     int        op_status;        /* Operation ID or status code*/
  320.     int        request_id;        /* Request ID */
  321.   }        any;
  322.  
  323.   struct                /* Operation Header */
  324.   {
  325.     ipp_uchar_t    version[2];        /* Protocol version number */
  326.     ipp_op_t    operation_id;        /* Operation ID */
  327.     int        request_id;        /* Request ID */
  328.   }        op;
  329.  
  330.   struct                /* Status Header */
  331.   {
  332.     ipp_uchar_t    version[2];        /* Protocol version number */
  333.     ipp_status_t status_code;        /* Status code */
  334.     int        request_id;        /* Request ID */
  335.   }        status;
  336.  
  337.   /**** New in CUPS 1.1.19 ****/
  338.   struct                /* Event Header */
  339.   {
  340.     ipp_uchar_t    version[2];        /* Protocol version number */
  341.     ipp_status_t status_code;        /* Status code */
  342.     int        request_id;        /* Request ID */
  343.   }        event;
  344. } ipp_request_t;
  345.  
  346. /**** New in CUPS 1.1.19 ****/
  347. typedef struct ipp_s ipp_t;
  348.  
  349. typedef union ipp_value_u        /**** Attribute Value ****/
  350. {
  351.   int        integer;        /* Integer/enumerated value */
  352.  
  353.   char        boolean;        /* Boolean value */
  354.  
  355.   ipp_uchar_t    date[11];        /* Date/time value */
  356.  
  357.   struct
  358.   {
  359.     int        xres,            /* Horizontal resolution */
  360.         yres;            /* Vertical resolution */
  361.     ipp_res_t    units;            /* Resolution units */
  362.   }        resolution;        /* Resolution value */
  363.  
  364.   struct
  365.   {
  366.     int        lower,            /* Lower value */
  367.         upper;            /* Upper value */
  368.   }        range;            /* Range of integers value */
  369.  
  370.   struct
  371.   {
  372.     char    *charset;        /* Character set */
  373.     char    *text;            /* String */
  374.   }        string;            /* String with language value */
  375.  
  376.   struct
  377.   {
  378.     int        length;            /* Length of attribute */
  379.     void    *data;            /* Data in attribute */
  380.   }        unknown;        /* Unknown attribute type */
  381.  
  382. /**** New in CUPS 1.1.19 ****/
  383.   ipp_t        *collection;        /* Collection value */
  384. } ipp_value_t;
  385.  
  386. typedef struct ipp_attribute_s        /**** Attribute ****/
  387. {
  388.   struct ipp_attribute_s *next;        /* Next attribute in list */
  389.   ipp_tag_t    group_tag,        /* Job/Printer/Operation group tag */
  390.         value_tag;        /* What type of value is it? */
  391.   char        *name;            /* Name of attribute */
  392.   int        num_values;        /* Number of values */
  393.   ipp_value_t    values[1];        /* Values */
  394. } ipp_attribute_t;
  395.  
  396. struct ipp_s                /**** IPP Request/Response/Notification ****/
  397. {
  398.   ipp_state_t    state;            /* State of request */
  399.   ipp_request_t    request;        /* Request header */
  400.   ipp_attribute_t *attrs;        /* Attributes */
  401.   ipp_attribute_t *last;        /* Last attribute in list */
  402.   ipp_attribute_t *current;        /* Current attribute (for read/write) */
  403.   ipp_tag_t    curtag;            /* Current attribute group tag */
  404.  
  405. /**** New in CUPS 1.2 ****/
  406.   ipp_attribute_t *prev;        /* Previous attribute (for read) */
  407. };
  408.  
  409.  
  410. /*
  411.  * Prototypes...
  412.  */
  413.  
  414. extern ipp_attribute_t    *ippAddBoolean(ipp_t *ipp, ipp_tag_t group,
  415.                            const char *name, char value);
  416. extern ipp_attribute_t    *ippAddBooleans(ipp_t *ipp, ipp_tag_t group,
  417.                             const char *name, int num_values,
  418.                     const char *values);
  419. extern ipp_attribute_t    *ippAddDate(ipp_t *ipp, ipp_tag_t group,
  420.                         const char *name, const ipp_uchar_t *value);
  421. extern ipp_attribute_t    *ippAddInteger(ipp_t *ipp, ipp_tag_t group,
  422.                            ipp_tag_t type, const char *name,
  423.                        int value);
  424. extern ipp_attribute_t    *ippAddIntegers(ipp_t *ipp, ipp_tag_t group,
  425.                             ipp_tag_t type, const char *name,
  426.                     int num_values, const int *values);
  427. extern ipp_attribute_t    *ippAddRange(ipp_t *ipp, ipp_tag_t group,
  428.                          const char *name, int lower, int upper);
  429. extern ipp_attribute_t    *ippAddRanges(ipp_t *ipp, ipp_tag_t group,
  430.                           const char *name, int num_values,
  431.                       const int *lower, const int *upper);
  432. extern ipp_attribute_t    *ippAddResolution(ipp_t *ipp, ipp_tag_t group,
  433.                               const char *name, ipp_res_t units,
  434.                       int xres, int yres);
  435. extern ipp_attribute_t    *ippAddResolutions(ipp_t *ipp, ipp_tag_t group,
  436.                                const char *name, int num_values,
  437.                        ipp_res_t units, const int *xres,
  438.                        const int *yres);
  439. extern ipp_attribute_t    *ippAddSeparator(ipp_t *ipp);
  440. extern ipp_attribute_t    *ippAddString(ipp_t *ipp, ipp_tag_t group,
  441.                           ipp_tag_t type, const char *name,
  442.                       const char *charset, const char *value);
  443. extern ipp_attribute_t    *ippAddStrings(ipp_t *ipp, ipp_tag_t group,
  444.                            ipp_tag_t type, const char *name,
  445.                        int num_values, const char *charset,
  446.                        const char * const *values);
  447. extern time_t        ippDateToTime(const ipp_uchar_t *date);
  448. extern void        ippDelete(ipp_t *ipp);
  449. extern const char    *ippErrorString(ipp_status_t error);
  450. extern ipp_attribute_t    *ippFindAttribute(ipp_t *ipp, const char *name,
  451.                               ipp_tag_t type);
  452. extern ipp_attribute_t    *ippFindNextAttribute(ipp_t *ipp, const char *name,
  453.                                   ipp_tag_t type);
  454. extern size_t        ippLength(ipp_t *ipp);
  455. extern ipp_t        *ippNew(void);
  456. extern ipp_state_t    ippRead(http_t *http, ipp_t *ipp);
  457. extern const ipp_uchar_t *ippTimeToDate(time_t t);
  458. extern ipp_state_t    ippWrite(http_t *http, ipp_t *ipp);
  459. extern int        ippPort(void);
  460. extern void        ippSetPort(int p);
  461.  
  462. /**** New in CUPS 1.1.19 ****/
  463. extern ipp_attribute_t    *ippAddCollection(ipp_t *ipp, ipp_tag_t group,
  464.                               const char *name, ipp_t *value);
  465. extern ipp_attribute_t    *ippAddCollections(ipp_t *ipp, ipp_tag_t group,
  466.                                const char *name, int num_values,
  467.                        const ipp_t **values);
  468. extern void        ippDeleteAttribute(ipp_t *ipp, ipp_attribute_t *attr);
  469. extern ipp_state_t    ippReadFile(int fd, ipp_t *ipp);
  470. extern ipp_state_t    ippWriteFile(int fd, ipp_t *ipp);
  471.  
  472. /**** New in CUPS 1.2 ****/
  473. extern ipp_attribute_t    *ippAddOctetString(ipp_t *ipp, ipp_tag_t group,
  474.                                const char *name,
  475.                        const void *data, int datalen);
  476. extern ipp_status_t    ippErrorValue(const char *name);
  477. extern ipp_t        *ippNewRequest(ipp_op_t op);
  478. extern const char    *ippOpString(ipp_op_t op);
  479. extern ipp_op_t        ippOpValue(const char *name);
  480. extern ipp_state_t    ippReadIO(void *src, ipp_iocb_t cb, int blocking,
  481.                       ipp_t *parent, ipp_t *ipp);
  482. extern ipp_state_t    ippWriteIO(void *dst, ipp_iocb_t cb, int blocking,
  483.                        ipp_t *parent, ipp_t *ipp);
  484.  
  485.  
  486. /*
  487.  * C++ magic...
  488.  */
  489.  
  490. #  ifdef __cplusplus
  491. }
  492. #  endif /* __cplusplus */
  493. #endif /* !_CUPS_IPP_H_ */
  494.  
  495. /*
  496.  * End of "$Id: ipp.h 7721 2008-07-11 22:48:49Z mike $".
  497.  */
  498.