*
* Contents:
*
+ * cupsGetDevices() - Get available printer devices.
*/
/*
const char *device_class, /* device-class value */
*device_id, /* device-id value */
*device_info, /* device-info value */
+ *device_location, /* device-location value */
*device_make_and_model, /* device-make-and-model value */
*device_uri; /* device-uri value */
int blocking; /* Current blocking-IO mode */
device_class = NULL;
device_id = NULL;
device_info = NULL;
+ device_location = "";
device_make_and_model = NULL;
device_uri = NULL;
attr = NULL;
if (device_class && device_id && device_info && device_make_and_model &&
device_uri)
(*callback)(device_class, device_id, device_info,
- device_make_and_model, device_uri, user_data);
+ device_make_and_model, device_uri, device_location,
+ user_data);
device_class = NULL;
device_id = NULL;
device_info = NULL;
+ device_location = "";
device_make_and_model = NULL;
device_uri = NULL;
}
else if (!strcmp(attr->name, "device-info") &&
attr->value_tag == IPP_TAG_TEXT)
device_info = attr->values[0].string.text;
+ else if (!strcmp(attr->name, "device-location") &&
+ attr->value_tag == IPP_TAG_TEXT)
+ device_location = attr->values[0].string.text;
else if (!strcmp(attr->name, "device-make-and-model") &&
attr->value_tag == IPP_TAG_TEXT)
device_make_and_model = attr->values[0].string.text;
if (device_class && device_id && device_info && device_make_and_model &&
device_uri)
(*callback)(device_class, device_id, device_info,
- device_make_and_model, device_uri, user_data);
+ device_make_and_model, device_uri, device_location, user_data);
/*
* Set the IPP status and return...
httpFlush(http);
if (status == IPP_ERROR)
- _cupsSetError(IPP_ERROR, NULL);
+ _cupsSetError(IPP_ERROR, NULL, 0);
else
{
attr = ippFindAttribute(response, "status-message", IPP_TAG_TEXT);
attr ? attr->values[0].string.text : ""));
_cupsSetError(response->request.status.status_code,
- attr ? attr->values[0].string.text :
- ippErrorString(response->request.status.status_code));
+ attr ? attr->values[0].string.text :
+ ippErrorString(response->request.status.status_code), 0);
}
ippDelete(response);