MCPcopy Create free account
hub / github.com/OpenPrinting/cups / new_request

Function new_request

backend/ipp.c:2840–3029  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2838 */
2839
2840static ipp_t * /* O - Request data */
2841new_request(
2842 ipp_op_t op, /* I - IPP operation code */
2843 int version, /* I - IPP version number */
2844 const char *uri, /* I - printer-uri value */
2845 const char *user, /* I - requesting-user-name value */
2846 const char *title, /* I - job-name value */
2847 int num_options, /* I - Number of options to send */
2848 cups_option_t *options, /* I - Options to send */
2849 const char *compression, /* I - compression value or NULL */
2850 int copies, /* I - copies value or 0 */
2851 const char *format, /* I - document-format value or NULL */
2852 _ppd_cache_t *pc, /* I - PPD cache and mapping data */
2853 ppd_file_t *ppd, /* I - PPD file data */
2854 ipp_attribute_t *media_col_sup, /* I - media-col-supported values */
2855 ipp_attribute_t *doc_handling_sup, /* I - multiple-document-handling-supported values */
2856 ipp_attribute_t *print_color_mode_sup,
2857 /* I - Printer supports print-color-mode? */
2858 ipp_attribute_t *print_scaling_sup) /* I - print-scaling-supported values */
2859{
2860 ipp_t *request; /* Request data */
2861 const char *keyword; /* PWG keyword */
2862
2863
2864 /*
2865 * Create the IPP request...
2866 */
2867
2868 request = ippNewRequest(op);
2869 ippSetVersion(request, version / 10, version % 10);
2870
2871 fprintf(stderr, "DEBUG: %s IPP/%d.%d\n",
2872 ippOpString(request->request.op.operation_id),
2873 request->request.op.version[0],
2874 request->request.op.version[1]);
2875
2876 /*
2877 * Add standard attributes...
2878 */
2879
2880 ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri", NULL, uri);
2881 fprintf(stderr, "DEBUG: printer-uri=\"%s\"\n", uri);
2882
2883 if (user && *user)
2884 {
2885 ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_NAME, "requesting-user-name", NULL, user);
2886 fprintf(stderr, "DEBUG: requesting-user-name=\"%s\"\n", user);
2887 }
2888
2889 if (title && *title)
2890 {
2891 ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_NAME, "job-name", NULL, title);
2892 fprintf(stderr, "DEBUG: job-name=\"%s\"\n", title);
2893 }
2894
2895 if (format && op != IPP_OP_CREATE_JOB)
2896 {
2897 ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_MIMETYPE, "document-format", NULL, format);

Callers 1

mainFunction · 0.85

Calls 15

ippNewRequestFunction · 0.85
ippSetVersionFunction · 0.85
ippOpStringFunction · 0.85
ippAddStringFunction · 0.85
_cupsConvertOptionsFunction · 0.85
cupsGetOptionFunction · 0.85
ippContainsStringFunction · 0.85
_httpDecodeURIFunction · 0.85
_cups_strcasecmpFunction · 0.85
_cups_strncasecmpFunction · 0.85
_cups_strcpyFunction · 0.85
ippNewFunction · 0.85

Tested by

no test coverage detected