GRU - Generic Reusable Utilities
Loading...
Searching...
No Matches
Functions
gru_uri.c File Reference
#include "gru_uri.h"

Functions

gru_uri_t gru_uri_parse (const char *url, gru_status_t *status)
 
gru_export gru_uri_t gru_uri_parse_ex (const char *gru_restrict url, gru_uri_parse_opt_t parseopt, gru_status_t *gru_restrict status)
 URI parser with additional options. More...
 
char * gru_uri_simple_format (const gru_uri_t *uri, gru_status_t *status)
 
char * gru_uri_format (const gru_uri_t *uri, gru_uri_format_opt_t fopt, gru_status_t *status)
 
bool gru_uri_set_scheme (gru_uri_t *uri, const char *scheme)
 Sets the scheme in a URI object. More...
 
bool gru_uri_set_path (gru_uri_t *uri, const char *path)
 Sets the URI path. More...
 
gru_export gru_uri_t gru_uri_clone (gru_uri_t other, gru_status_t *status)
 Clone a URI object. More...
 
void gru_uri_cleanup (gru_uri_t *uri)
 Cleans up a URI object. More...
 

Function Documentation

◆ gru_uri_cleanup()

void gru_uri_cleanup ( gru_uri_t uri)

Cleans up a URI object.

Parameters
uria pointer to a URI object to clean
Examples
network/gru_uri_test.c, and network/gru_uri_test_opt.c.

◆ gru_uri_clone()

gru_export gru_uri_t gru_uri_clone ( gru_uri_t  other,
gru_status_t status 
)

Clone a URI object.

Parameters
otherthe object to clone
statusstatus object
Returns
A cloned object that must's be cleaned up after use. Check the status object to determine whether cloning was successful or not

◆ gru_uri_format()

char * gru_uri_format ( const gru_uri_t uri,
gru_uri_format_opt_t  fopt,
gru_status_t status 
)

◆ gru_uri_parse()

gru_uri_t gru_uri_parse ( const char *  url,
gru_status_t status 
)

◆ gru_uri_parse_ex()

gru_export gru_uri_t gru_uri_parse_ex ( const char *gru_restrict  url,
gru_uri_parse_opt_t  parseopt,
gru_status_t *gru_restrict  status 
)

URI parser with additional options.

Parameters
uriURI string (ie.: scheme://host:port/path)
parseoptparse options (see gru_uri_format_opt_t)
statusstatus object
Returns
A parsed URI object with each component of the URI broken down
Examples
network/gru_uri_test_opt.c.

◆ gru_uri_set_path()

bool gru_uri_set_path ( gru_uri_t uri,
const char *  path 
)

Sets the URI path.

Parameters
uria pointer to an URI object
paththe path
Returns
true if success or false otherwise

◆ gru_uri_set_scheme()

bool gru_uri_set_scheme ( gru_uri_t uri,
const char *  scheme 
)

Sets the scheme in a URI object.

Parameters
uria pointer to an URI object
schemethe scheme to set it to
Returns
true if success or false otherwise

◆ gru_uri_simple_format()

char * gru_uri_simple_format ( const gru_uri_t uri,
gru_status_t status 
)