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

Function cupsdValidateDest

scheduler/printers.c:2929–3072  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2927 */
2928
2929const char * /* O - Printer or class name */
2930cupsdValidateDest(
2931 const char *uri, /* I - Printer URI */
2932 cups_ptype_t *dtype, /* O - Type (printer or class) */
2933 cupsd_printer_t **printer) /* O - Printer pointer */
2934{
2935 cupsd_printer_t *p; /* Current printer */
2936 char localname[1024],/* Localized hostname */
2937 *lptr, /* Pointer into localized hostname */
2938 *sptr, /* Pointer into server name */
2939 *rptr, /* Pointer into resource */
2940 scheme[32], /* Scheme portion of URI */
2941 username[64], /* Username portion of URI */
2942 hostname[HTTP_MAX_HOST],
2943 /* Host portion of URI */
2944 resource[HTTP_MAX_URI];
2945 /* Resource portion of URI */
2946 int port; /* Port portion of URI */
2947
2948
2949 /*
2950 * Initialize return values...
2951 */
2952
2953 if (printer)
2954 *printer = NULL;
2955
2956 if (dtype)
2957 *dtype = (cups_ptype_t)0;
2958
2959 /*
2960 * Pull the hostname and resource from the URI...
2961 */
2962
2963 httpSeparateURI(HTTP_URI_CODING_ALL, uri, scheme, sizeof(scheme),
2964 username, sizeof(username), hostname, sizeof(hostname),
2965 &port, resource, sizeof(resource));
2966
2967 /*
2968 * See if the resource is a class or printer...
2969 */
2970
2971 if (!strncmp(resource, "/classes/", 9))
2972 {
2973 /*
2974 * Class...
2975 */
2976
2977 rptr = resource + 9;
2978 }
2979 else if (!strncmp(resource, "/printers/", 10))
2980 {
2981 /*
2982 * Printer...
2983 */
2984
2985 rptr = resource + 10;
2986 }

Callers 15

accept_jobsFunction · 0.85
add_classFunction · 0.85
cancel_all_jobsFunction · 0.85
cancel_jobFunction · 0.85
create_jobFunction · 0.85
create_subscriptionsFunction · 0.85
delete_printerFunction · 0.85
get_jobsFunction · 0.85
get_ppdFunction · 0.85
get_printer_attrsFunction · 0.85
get_printer_supportedFunction · 0.85
get_subscriptionsFunction · 0.85

Calls 5

httpSeparateURIFunction · 0.85
cupsdFindDestFunction · 0.85
_cups_strcasecmpFunction · 0.85
cupsArrayFirstFunction · 0.85
cupsArrayNextFunction · 0.85

Tested by

no test coverage detected