[cups] Printer-Attributes question

Michael Sweet msweet at apple.com
Thu Apr 21 08:43:02 PDT 2016


Dmitry,

I don't see any output attached.

> On Apr 21, 2016, at 5:05 AM, Дмитрий Воронин <carriingfate92 at yandex.ru> wrote:
> 
> Hello,
> 
>> Yes, printer-uri-supported is a "1setOf uri" attribute, which means 1 or more values.  But there should only be a single instance of the printer-uri-supported attribute, regardless of the number of values.
> 
>> No.
> 
>> Some operations return multiple groups of attributes so (for example) you'll see multiple "job-name" attributes in the response to Get-Jobs.  Each group of attributes is separated by an xxx-group-tag on the wire, which shows up as an empty attribute in the list with > a NULL name and group tag of IPP_TAG_ZERO.
> 
>> For operations that only return a single group of attributes, you can assume that attribute names are unique within that group and can rely on the return value from ippFindAttribute.
> 
> Ok, here I run this code for getting printers:
> 
>    ipp_t *request = ippNewRequest( CUPS_GET_PRINTERS );
> 
>    ippAddString( request
>                 , IPP_TAG_OPERATION
>                 , IPP_TAG_KEYWORD
>                 , "requested-attributes"
>                 , NULL
>                 , "printer-description"/*"all"*/ );
>    ipp_t *responce = cupsDoRequest( &connection
>                                   , request
>                                   , "/" );
>    for ( ipp_attribute_t *attribute = ippFirstAttribute( responce );
>          attribute;
>          attribute = ippNextAttribute( responce ) )
>    {
> 		/* get attribute and it's value */
>    }
> 
> 
> When code is running, I have output: (please see attachmnent). I see that as part of one group comes 2 attribute printer-uri-supported.
> 
> I use CUPS 2.1.3
> 
> -- 
> Best regards, Dmitry Voronin
> _______________________________________________
> cups mailing list
> cups at cups.org
> https://www.cups.org/mailman/listinfo/cups

_________________________________________________________
Michael Sweet, Senior Printing System Engineer




More information about the cups mailing list