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

Function httpSeparateURI

cups/http-support.c:946–1305  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

944 */
945
946http_uri_status_t /* O - Result of separation */
947httpSeparateURI(
948 http_uri_coding_t decoding, /* I - Decoding flags */
949 const char *uri, /* I - Universal Resource Identifier */
950 char *scheme, /* O - Scheme (http, https, etc.) */
951 int schemelen, /* I - Size of scheme buffer */
952 char *username, /* O - Username */
953 int usernamelen, /* I - Size of username buffer */
954 char *host, /* O - Hostname */
955 int hostlen, /* I - Size of hostname buffer */
956 int *port, /* O - Port number to use */
957 char *resource, /* O - Resource/filename */
958 int resourcelen) /* I - Size of resource buffer */
959{
960 char *ptr, /* Pointer into string... */
961 *end; /* End of string */
962 const char *sep; /* Separator character */
963 http_uri_status_t status; /* Result of separation */
964
965
966 /*
967 * Initialize everything to blank...
968 */
969
970 if (scheme && schemelen > 0)
971 *scheme = '\0';
972
973 if (username && usernamelen > 0)
974 *username = '\0';
975
976 if (host && hostlen > 0)
977 *host = '\0';
978
979 if (port)
980 *port = 0;
981
982 if (resource && resourcelen > 0)
983 *resource = '\0';
984
985 /*
986 * Range check input...
987 */
988
989 if (!uri || !port || !scheme || schemelen <= 0 || !username ||
990 usernamelen <= 0 || !host || hostlen <= 0 || !resource ||
991 resourcelen <= 0)
992 return (HTTP_URI_STATUS_BAD_ARGUMENTS);
993
994 if (!*uri)
995 return (HTTP_URI_STATUS_BAD_URI);
996
997 /*
998 * Grab the scheme portion of the URI...
999 */
1000
1001 status = HTTP_URI_STATUS_OK;
1002
1003 if (!strncmp(uri, "//", 2))

Callers 15

compare_urisFunction · 0.85
do_monitor_printer_stateFunction · 0.85
get_stringFunction · 0.85
finish_document_uriFunction · 0.85
process_httpFunction · 0.85
process_ippFunction · 0.85
process_jobFunction · 0.85
cat_drvFunction · 0.85
cupsdReadClientFunction · 0.85
add_classFunction · 0.85
add_job_subscriptionsFunction · 0.85
add_printerFunction · 0.85

Calls 2

_cups_strcasecmpFunction · 0.85
http_copy_decodeFunction · 0.85

Tested by 4

mainFunction · 0.68
mainFunction · 0.68
mainFunction · 0.68
mainFunction · 0.68