Lines Matching refs:NULL

56     if (len <= 0) return NULL;  in strnstr()
62 if (len <= (ssize_t)needleLen) return NULL; in strnstr()
161 if (op_to_set == NULL) { in set_ipp_version()
185 if (http == NULL) { in determine_ipp_version()
204 ipp_t *request = NULL; in test_and_set_ipp_version()
216 ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri", NULL, printer_uri); in test_and_set_ipp_version()
219 NULL, __request_ipp_version); in test_and_set_ipp_version()
220 if ((response = cupsDoRequest(http, request, http_resource)) == NULL) { in test_and_set_ipp_version()
285 if (response != NULL) ippDelete(response); in test_and_set_ipp_version()
299 ipp_t *request = NULL; in get_PrinterState()
300 ipp_t *response = NULL; in get_PrinterState()
306 if (printer_state_dyn == NULL) { in get_PrinterState()
318 ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri", NULL, printer_uri); in get_PrinterState()
321 sizeof(pattrs) / sizeof(pattrs[0]), NULL, pattrs); in get_PrinterState()
323 if ((response = ipp_doCupsRequest(http, request, http_resource, printer_uri)) == NULL) { in get_PrinterState()
351 if ((attrptr = ippFindAttribute(response, "printer-state", IPP_TAG_ENUM)) == NULL) { in get_PrinterStateReason()
374 if ((attrptr = ippFindAttribute(response, "printer-state-reasons", IPP_TAG_KEYWORD)) == NULL) { in get_PrinterStateReason()
382 ippGetString(attrptr, idx, NULL)); in get_PrinterStateReason()
383 if (strncmp(ippGetString(attrptr, idx, NULL), IPP_PRNT_STATE_NONE, in get_PrinterStateReason()
397 } else if (strncmp(ippGetString(attrptr, idx, NULL), IPP_PRNT_STATE_SPOOL_FULL, in get_PrinterStateReason()
411 } else if (strncmp(ippGetString(attrptr, idx, NULL), IPP_PRNT_STATE_MARKER_SUPPLY_LOW, in get_PrinterStateReason()
414 } else if (strncmp(ippGetString(attrptr, idx, NULL), IPP_PRNT_STATE_TONER_LOW, in get_PrinterStateReason()
417 } else if (strncmp(ippGetString(attrptr, idx, NULL), IPP_PRNT_STATE_OTHER_WARN, in get_PrinterStateReason()
422 if (strncmp(ippGetString(attrptr, idx, NULL), IPP_PRNT_STATE_MEDIA_NEEDED, in get_PrinterStateReason()
425 } else if (strncmp(ippGetString(attrptr, idx, NULL), IPP_PRNT_STATE_MEDIA_EMPTY, in get_PrinterStateReason()
428 } else if (strncmp(ippGetString(attrptr, idx, NULL), IPP_PRNT_STATE_TONER_EMPTY, in get_PrinterStateReason()
431 } else if (strncmp(ippGetString(attrptr, idx, NULL), in get_PrinterStateReason()
435 } else if (strncmp(ippGetString(attrptr, idx, NULL), IPP_PRNT_STATE_DOOR_OPEN, in get_PrinterStateReason()
438 } else if (strncmp(ippGetString(attrptr, idx, NULL), IPP_PRNT_STATE_COVER_OPEN, in get_PrinterStateReason()
441 } else if (strncmp(ippGetString(attrptr, idx, NULL), IPP_PRNT_STATE_MEDIA_JAM, in get_PrinterStateReason()
444 } else if (strncmp(ippGetString(attrptr, idx, NULL), IPP_PRNT_SHUTDOWN, in get_PrinterStateReason()
447 } else if (strncmp(ippGetString(attrptr, idx, NULL), IPP_PRNT_STATE_OTHER_ERR, in get_PrinterStateReason()
450 } else if (strncmp(ippGetString(attrptr, idx, NULL), IPP_PRNT_PAUSED, in get_PrinterStateReason()
463 if ((attr = ippFindAttribute(response, "job-state", IPP_TAG_ENUM)) == NULL) { in set_jobStateDyn()
502 if ((attr = ippFindAttribute(response, "job-state-reasons", IPP_TAG_KEYWORD)) == NULL) { in parse_jobStateReasons()
508 const char *text = ippGetString(attr, i, NULL); in parse_jobStateReasons()
596 if (job_state_dyn == NULL) { in get_JobStatus()
601 if (job_state != NULL) { in get_JobStatus()
621 ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri", NULL, printer_uri); in get_JobStatus()
624 NULL, requesting_user); in get_JobStatus()
626 sizeof(jattrs) / sizeof(jattrs[0]), NULL, jattrs); in get_JobStatus()
632 if ((response = cupsDoRequest(http, request, http_resource)) == NULL) { in get_JobStatus()
690 if (response != NULL) ippDelete(response); in get_JobStatus()
764 ippTagString(ippGetValueTag(attr)), ippGetString(attr, i, NULL)); in print_col()
793 if (ippGetName(attr) == NULL) { in print_attr()
852 ippTagString(ippGetValueTag(attr)), ippGetString(attr, i, NULL)); in print_attr()
889 if (ippVersions != NULL) { in parse_IPPVersions()
893 if (attrptr != NULL) { in parse_IPPVersions()
896 if (strcmp(ipp10, ippGetString(attrptr, i, NULL)) == 0) { in parse_IPPVersions()
898 } else if (strcmp(ipp11, ippGetString(attrptr, i, NULL)) == 0) { in parse_IPPVersions()
900 } else if (strcmp(ipp20, ippGetString(attrptr, i, NULL)) == 0) { in parse_IPPVersions()
903 LOGD("found another ipp version. %s", ippGetString(attrptr, i, NULL)); in parse_IPPVersions()
1023 ippFindAttribute(response, "media-col-ready", IPP_TAG_BEGIN_COLLECTION)) != NULL) { in parse_getMediaSupported()
1032 (attrptr2 != NULL); in parse_getMediaSupported()
1038 (attrptr3 != NULL); in parse_getMediaSupported()
1060 ippGetString(attrptr2, 0, NULL), MAX_STRING); in parse_getMediaSupported()
1064 && strstr(mediaReadySet.media_tray_tag, "roll") != NULL) { in parse_getMediaSupported()
1080 && (attrptr = ippFindAttribute(response, "media-ready", IPP_TAG_KEYWORD)) != NULL) { in parse_getMediaSupported()
1086 ippGetString(attrptr, i, NULL), MAX_STRING); in parse_getMediaSupported()
1099 if ((attrptr = ippFindAttribute(response, "media-supported", IPP_TAG_KEYWORD)) != NULL) { in parse_getMediaSupported()
1102 idx = ipp_find_media_size(ippGetString(attrptr, i, NULL), &media_sizeTemp); in parse_getMediaSupported()
1215 if ((attrptr = ippFindAttribute(response, "printer-dns-sd-name", IPP_TAG_NAME)) != NULL) { in parse_printerAttributes()
1216 strlcpy(capabilities->name, ippGetString(attrptr, 0, NULL), sizeof(capabilities->name)); in parse_printerAttributes()
1220 if ((attrptr = ippFindAttribute(response, "printer-info", IPP_TAG_TEXT)) != NULL) { in parse_printerAttributes()
1221 strlcpy(capabilities->name, ippGetString(attrptr, 0, NULL), sizeof(capabilities->name)); in parse_printerAttributes()
1226 if ((attrptr = ippFindAttribute(response, "printer-name", IPP_TAG_TEXT)) != NULL) { in parse_printerAttributes()
1227 strlcpy(capabilities->name, ippGetString(attrptr, 0, NULL), sizeof(capabilities->name)); in parse_printerAttributes()
1231 if ((attrptr = ippFindAttribute(response, "printer-make-and-model", IPP_TAG_TEXT)) != NULL) { in parse_printerAttributes()
1232 strlcpy(capabilities->make, ippGetString(attrptr, 0, NULL), sizeof(capabilities->make)); in parse_printerAttributes()
1235 if ((attrptr = ippFindAttribute(response, "printer-uuid", IPP_TAG_URI)) != NULL) { in parse_printerAttributes()
1236 strlcpy(capabilities->uuid, ippGetString(attrptr, 0, NULL), sizeof(capabilities->uuid)); in parse_printerAttributes()
1239 if ((attrptr = ippFindAttribute(response, "printer-location", IPP_TAG_TEXT)) != NULL) { in parse_printerAttributes()
1240 strlcpy(capabilities->location, ippGetString(attrptr, 0, NULL), in parse_printerAttributes()
1244 if ((attrptr = ippFindAttribute(response, "media-default", IPP_TAG_KEYWORD)) != NULL in parse_printerAttributes()
1246 strlcpy(capabilities->mediaDefault, ippGetString(attrptr, 0, NULL), in parse_printerAttributes()
1250 if ((attrptr = ippFindAttribute(response, "color-supported", IPP_TAG_BOOLEAN)) != NULL) { in parse_printerAttributes()
1255 if ((attrptr = ippFindAttribute(response, "copies-supported", IPP_TAG_RANGE)) != NULL) { in parse_printerAttributes()
1265 NULL) { in parse_printerAttributes()
1267 if (strcmp("color", ippGetString(attrptr, i, NULL)) == 0) { in parse_printerAttributes()
1273 NULL) { in parse_printerAttributes()
1288 != NULL) { in parse_printerAttributes()
1290 if (strcmp(imagePDF, ippGetString(attrptr, i, NULL)) == 0) { in parse_printerAttributes()
1292 } else if (strcmp(applicationPDF, ippGetString(attrptr, i, NULL)) == 0) { in parse_printerAttributes()
1294 } else if (strcmp(imagePCLm, ippGetString(attrptr, i, NULL)) == 0) { in parse_printerAttributes()
1296 } else if (strcmp(applicationPDF, ippGetString(attrptr, i, NULL)) == 0) { in parse_printerAttributes()
1298 } else if (strcmp(imagePWG, ippGetString(attrptr, i, NULL)) == 0) { in parse_printerAttributes()
1304 if ((attrptr = ippFindAttribute(response, "sides-supported", IPP_TAG_KEYWORD)) != NULL) { in parse_printerAttributes()
1307 if (strcmp(IPP_SIDES_TWO_SIDED_SHORT_EDGE, ippGetString(attrptr, i, NULL)) == 0) { in parse_printerAttributes()
1309 } else if (strcmp(IPP_SIDES_TWO_SIDED_LONG_EDGE, ippGetString(attrptr, i, NULL)) == 0) { in parse_printerAttributes()
1317 if (((attrptr = ippFindAttribute(response, "media-type-supported", IPP_TAG_KEYWORD)) != NULL) in parse_printerAttributes()
1319 != NULL)) { in parse_printerAttributes()
1321 if (strcasestr(ippGetString(attrptr, i, NULL), "photographic-glossy")) { in parse_printerAttributes()
1323 } else if (strcasestr(ippGetString(attrptr, i, NULL), "photo")) { in parse_printerAttributes()
1325 } else if (strcasestr(ippGetString(attrptr, i, NULL), "stationery")) { in parse_printerAttributes()
1327 } else if (strcasestr(ippGetString(attrptr, i, NULL), "auto")) { in parse_printerAttributes()
1345 IPP_TAG_RESOLUTION)) != NULL) { in parse_printerAttributes()
1348 IPP_TAG_RESOLUTION)) != NULL) { in parse_printerAttributes()
1356 if ((attrptr = ippFindAttribute(response, "ipp-versions-supported", IPP_TAG_KEYWORD)) != NULL) { in parse_printerAttributes()
1362 if (strcmp(ipp10, ippGetString(attrptr, i, NULL)) == 0) { in parse_printerAttributes()
1364 } else if (strcmp(ipp11, ippGetString(attrptr, i, NULL)) == 0) { in parse_printerAttributes()
1366 } else if (strcmp(ipp20, ippGetString(attrptr, i, NULL)) == 0) { in parse_printerAttributes()
1369 LOGD("found another ipp version. %s", ippGetString(attrptr, i, NULL)); in parse_printerAttributes()
1389 if ((attrptr = ippFindAttribute(response, "epcl-version-supported", IPP_TAG_KEYWORD)) != NULL) { in parse_printerAttributes()
1391 LOGD("setting epcl_ipp_version (KEYWORD) %s", ippGetString(attrptr, i, NULL)); in parse_printerAttributes()
1394 if (strstr(ippGetString(attrptr, i, NULL), epcl10) != NULL) { in parse_printerAttributes()
1401 if ((attrptr = ippFindAttribute(response, "epcl-version-supported", IPP_TAG_TEXT)) != NULL) { in parse_printerAttributes()
1403 LOGD("setting epcl_ipp_verion (TEXT) %s", ippGetString(attrptr, i, NULL)); in parse_printerAttributes()
1406 if (strstr(ippGetString(attrptr, i, NULL), epcl10) != NULL) { in parse_printerAttributes()
1414 NULL) { in parse_printerAttributes()
1421 (j < 4) && (attrptr != NULL); attrptr = ippNextAttribute(collection)) { in parse_printerAttributes()
1435 if ((attrptr = ippFindAttribute(response, "media-size-name", IPP_TAG_KEYWORD)) != NULL) { in parse_printerAttributes()
1443 IPP_TAG_INTEGER)) != NULL) { in parse_printerAttributes()
1462 IPP_TAG_KEYWORD)) != NULL) { in parse_printerAttributes()
1463 LOGD("pclm-compression-method-preferred=%s", ippGetString(attrptr, 0, NULL)); in parse_printerAttributes()
1468 if ((attrptr = ippFindAttribute(response, "pclm-raster-back-side", IPP_TAG_KEYWORD)) == NULL) { in parse_printerAttributes()
1471 if (attrptr != NULL && strcmp(ippGetString(attrptr, 0, NULL), "rotated") != 0) { in parse_printerAttributes()
1480 NULL) { in parse_printerAttributes()
1490 NULL) { in parse_printerAttributes()
1500 NULL) { in parse_printerAttributes()
1510 NULL) { in parse_printerAttributes()
1527 if ((attrptr = ippFindAttribute(response, "printer-device-id", IPP_TAG_TEXT)) != NULL) { in parse_printerAttributes()
1528 if (strstr(ippGetString(attrptr, 0, NULL), "PCL3GUI") != NULL) { in parse_printerAttributes()
1537 if ((attrptr = ippFindAttribute(response, "output-bin-supported", IPP_TAG_KEYWORD)) != NULL) { in parse_printerAttributes()
1538 if (strstr(ippGetString(attrptr, 0, NULL), "face-up") != NULL) { in parse_printerAttributes()
1542 if ((attrptr = ippFindAttribute(response, "printer-output-tray", IPP_TAG_STRING)) != NULL) { in parse_printerAttributes()
1546 if (length > 0 && strnstr(tray_str, "faceUp", (size_t)length) != NULL) { in parse_printerAttributes()
1554 IPP_TAG_KEYWORD)) != NULL) { in parse_printerAttributes()
1556 if (strcmp("document-source-application-name", ippGetString(attrptr, i, NULL)) == 0) { in parse_printerAttributes()
1559 strcmp("document-source-application-version", ippGetString(attrptr, i, NULL)) == in parse_printerAttributes()
1562 } else if (strcmp("document-source-os-name", ippGetString(attrptr, i, NULL)) == 0) { in parse_printerAttributes()
1564 } else if (strcmp("document-source-os-version", ippGetString(attrptr, i, NULL)) == 0) { in parse_printerAttributes()
1572 … if ((attrptr = ippFindAttribute(response, "print-scaling-supported", IPP_TAG_KEYWORD)) != NULL) { in parse_printerAttributes()
1575 strlcpy(capabilities->print_scalings_supported[i], ippGetString(attrptr, i, NULL), in parse_printerAttributes()
1583 if ((attrptr = ippFindAttribute(response, "print-scaling-default", IPP_TAG_KEYWORD)) != NULL) { in parse_printerAttributes()
1584 strlcpy(capabilities->print_scaling_default, ippGetString(attrptr, 0, NULL), in parse_printerAttributes()
1591 IPP_TAG_BOOLEAN)) != NULL && ippGetBoolean(attrptr, 0)) { in parse_printerAttributes()
1610 if ((attrptr = ippFindAttribute(response, "printer-uri-supported", IPP_TAG_URI)) != NULL) { in parse_printerUris()
1612 uris[i].uri = ippGetString(attrptr, i, NULL); in parse_printerUris()
1619 != NULL) { in parse_printerUris()
1622 if (strcmp("none", ippGetString(attrptr, i, NULL)) != 0 && in parse_printerUris()
1623 strcmp("requesting-user-name", ippGetString(attrptr, i, NULL)) != 0) { in parse_printerUris()
1625 ippGetString(attrptr, i, NULL)); in parse_printerUris()
1717 http_t *curl_http = NULL; in ipp_cups_connect()
1721 if ((connect_info->uri_path == NULL) || (strlen(connect_info->uri_path) == 0)) { in ipp_cups_connect()
1729 if (strstr(connect_info->uri_scheme,IPPS_PREFIX) != NULL) { in ipp_cups_connect()
1730 curl_http = httpConnect2(connect_info->printer_addr, ippPortNumber, NULL, AF_UNSPEC, in ipp_cups_connect()
1731 HTTP_ENCRYPTION_ALWAYS, 1, HTTP_TIMEOUT_MILLIS, NULL); in ipp_cups_connect()
1734 if (curl_http == NULL) { in ipp_cups_connect()
1735 curl_http = httpConnect2(connect_info->printer_addr, ippPortNumber, NULL, AF_UNSPEC, in ipp_cups_connect()
1736 HTTP_ENCRYPTION_REQUIRED, 1, HTTP_TIMEOUT_MILLIS, NULL); in ipp_cups_connect()
1739 curl_http = httpConnect2(connect_info->printer_addr, ippPortNumber, NULL, AF_UNSPEC, in ipp_cups_connect()
1740 HTTP_ENCRYPTION_IF_REQUESTED, 1, HTTP_TIMEOUT_MILLIS, NULL); in ipp_cups_connect()
1743 httpSetTimeout(curl_http, (double)connect_info->timeout / 1000, NULL, 0); in ipp_cups_connect()
1744 httpAssembleURIf(HTTP_URI_CODING_ALL, printer_uri, uriLength, connect_info->uri_scheme, NULL, in ipp_cups_connect()
1747 if (curl_http == NULL) { in ipp_cups_connect()
1751 cupsSetServerCertCB(NULL, NULL); in ipp_cups_connect()
1760 ipp_t *response = NULL; in ippSendRequest()
1772 if (result == HTTP_CONTINUE && response == NULL) { in ippSendRequest()
1796 ipp_t *response = NULL; in ipp_doCupsRequest()
1803 if (http == NULL || request == NULL || http_resource == NULL || printer_uri == NULL) { in ipp_doCupsRequest()
1804 return NULL; in ipp_doCupsRequest()
1809 if (!wprintIsRunning()) return NULL; in ipp_doCupsRequest()
1820 if (response == NULL) { in ipp_doCupsRequest()
1866 response = NULL; in ipp_doCupsRequest()
1871 response = NULL; in ipp_doCupsRequest()
1889 ipp_t *request = NULL; /* IPP request object */ in getJobId()
1890 ipp_t *response = NULL; /* IPP response object */ in getJobId()
1894 if (request != NULL) { in getJobId()
1895 ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri", NULL, printer_uri); in getJobId()
1898 NULL, requesting_user); in getJobId()
1900 sizeof(jattrs) / sizeof(jattrs[0]), NULL, jattrs); in getJobId()
1902 if ((response = ipp_doCupsRequest(http, request, http_resource, printer_uri)) == NULL) { in getJobId()
1907 if (attr != NULL) job_id = ippGetInteger(attr, 0); in getJobId()
1911 if (request != NULL) ippDelete(request); in getJobId()
1912 if (response != NULL) ippDelete(response); in getJobId()
1937 httpAssembleURIf(HTTP_URI_CODING_ALL, printer_uri, 1024, scheme, NULL, in tryNextResourceExtension()