/*
- * "$Id: ipp.c,v 1.55.2.32 2003/03/26 20:20:18 mike Exp $"
+ * "$Id: ipp.c,v 1.55.2.33 2003/03/26 20:31:56 mike Exp $"
*
* Internet Printing Protocol support functions for the Common UNIX
* Printing System (CUPS).
}
/*
- * Finally, add 1 byte for the "end of attributes/collection" tag and return...
+ * Finally, add 1 byte for the "end of attributes" tag and return...
*/
- DEBUG_printf(("bytes = %d\n", bytes + 1));
+ if (!collection)
+ bytes ++;
- return (bytes + 1);
+ DEBUG_printf(("bytes = %d\n", bytes));
+
+ return (bytes);
}
/*
- * End of "$Id: ipp.c,v 1.55.2.32 2003/03/26 20:20:18 mike Exp $".
+ * End of "$Id: ipp.c,v 1.55.2.33 2003/03/26 20:31:56 mike Exp $".
*/
/*
- * "$Id: testipp.c,v 1.1.2.1 2003/03/21 18:07:34 mike Exp $"
+ * "$Id: testipp.c,v 1.1.2.2 2003/03/26 20:31:57 mike Exp $"
*
* IPP test program for the Common UNIX Printing System (CUPS).
*
ipp_t *col; /* Collection */
ipp_t *request; /* Request */
ipp_state_t state; /* State */
+ int length; /* Length of data */
request = ippNew();
ippAddString(col, IPP_TAG_JOB, IPP_TAG_KEYWORD, "media-color", NULL, "blue");
ippAddCollection(request, IPP_TAG_JOB, "media-col", col);
+ length = ippLength(request);
+ if (length != sizeof(collection))
+ printf("ERROR ippLength didn't compute the correct length (%d instead of %d bytes!)\n",
+ length, sizeof(collection));
+
wused = 0;
while ((state = ippWriteIO(wbuffer, write_cb, 1, NULL, request)) != IPP_DATA)
if (state == IPP_ERROR)
/*
- * End of "$Id: testipp.c,v 1.1.2.1 2003/03/21 18:07:34 mike Exp $".
+ * End of "$Id: testipp.c,v 1.1.2.2 2003/03/26 20:31:57 mike Exp $".
*/