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

Function httpAssembleURIf

cups/http-support.c:434–479  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

432 */
433
434http_uri_status_t /* O - URI status */
435httpAssembleURIf(
436 http_uri_coding_t encoding, /* I - Encoding flags */
437 char *uri, /* I - URI buffer */
438 int urilen, /* I - Size of URI buffer */
439 const char *scheme, /* I - Scheme name */
440 const char *username, /* I - Username */
441 const char *host, /* I - Hostname or address */
442 int port, /* I - Port number */
443 const char *resourcef, /* I - Printf-style resource */
444 ...) /* I - Additional arguments as needed */
445{
446 va_list ap; /* Pointer to additional arguments */
447 char resource[1024]; /* Formatted resource string */
448 int bytes; /* Bytes in formatted string */
449
450
451 /*
452 * Range check input...
453 */
454
455 if (!uri || urilen < 1 || !scheme || port < 0 || !resourcef)
456 {
457 if (uri)
458 *uri = '\0';
459
460 return (HTTP_URI_STATUS_BAD_ARGUMENTS);
461 }
462
463 /*
464 * Format the resource string and assemble the URI...
465 */
466
467 va_start(ap, resourcef);
468 bytes = vsnprintf(resource, sizeof(resource), resourcef, ap);
469 va_end(ap);
470
471 if ((size_t)bytes >= sizeof(resource))
472 {
473 *uri = '\0';
474 return (HTTP_URI_STATUS_OVERFLOW);
475 }
476 else
477 return (httpAssembleURI(encoding, uri, urilen, scheme, username, host,
478 port, resource));
479}
480
481
482/*

Callers 15

create_jobFunction · 0.85
load_drvFunction · 0.85
load_tarFunction · 0.85
add_jobFunction · 0.85
close_jobFunction · 0.85
copy_job_attrsFunction · 0.85
copy_printer_attrsFunction · 0.85
copy_subscription_attrsFunction · 0.85
create_local_bg_threadFunction · 0.85
create_local_printerFunction · 0.85
send_documentFunction · 0.85
cupsdAddClassFunction · 0.85

Calls 1

httpAssembleURIFunction · 0.85

Tested by

no test coverage detected