You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

17 lines
543 B
C

#include <string.h>
/* url_to_proto - This takes in a URL, and returns the protocol.
Example - 'https://example.org' would return 'https'. */
char* url_to_proto(char* url);
/* url_to_hostname - This takes in a URL, and returns the hostname.
Example - 'https://example.org' would return 'example.org'. */
char* url_to_hostname(char* url);
/* url_to_path - Returns the path portion of a URL.
Example: 'https://example.org/index.html' will return '/index.html'
Any empty path will also return '/index.html' */
char* url_to_path(char* url);