/builddir/build/BUILD/gru-0.2.0/src/network/gru_uri.h File Reference
#include <inttypes.h>
#include <stdbool.h>
#include <arpa/inet.h>
#include <common/gru_portable.h>
#include <common/gru_status.h>
#include <string/gru_alt.h>
#include <common/gru_keypair.h>
#include <common/gru_variant.h>
#include <uriparser/Uri.h>
#include <collection/gru_list.h>
Go to the source code of this file.
Data Structures |
struct | gru_uri_t_ |
Typedefs |
typedef enum gru_uri_parse_opt_t_ | gru_uri_parse_opt_t |
typedef enum gru_uri_format_opt_t_ | gru_uri_format_opt_t |
typedef struct gru_uri_t_ | gru_uri_t |
Enumerations |
enum | gru_uri_parse_opt_t_ { GRU_URI_PARSE_DEFAULT = 0,
GRU_URI_PARSE_STRIP = 1
} |
enum | gru_uri_format_opt_t_ { GRU_URI_FORMAT_NONE = 0,
GRU_URI_FORMAT_PORT = 1,
GRU_URI_FORMAT_PATH = 2,
GRU_URI_FORMAT_DEFAULT
} |
Functions |
gru_export gru_uri_t | gru_uri_parse (const char *gru_restrict uri, gru_status_t *gru_restrict status) |
| Default URI parser.
|
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.
|
gru_export char * | gru_uri_simple_format (const gru_uri_t *gru_restrict uri, gru_status_t *gru_restrict status) |
| Converts a URI object to a string.
|
gru_export char * | gru_uri_format (const gru_uri_t *gru_restrict uri, gru_uri_format_opt_t fopt, gru_status_t *gru_restrict status) |
| A more elaborate URI string converter that can filter parts of the URI.
|
gru_export bool | gru_uri_set_scheme (gru_uri_t *uri, const char *scheme) |
| Sets the scheme in a URI object.
|
gru_export bool | gru_uri_set_path (gru_uri_t *uri, const char *path) |
| Sets the URI path.
|
gru_export gru_uri_t | gru_uri_clone (gru_uri_t other, gru_status_t *status) |
| Clone a URI object.
|
gru_export void | gru_uri_cleanup (gru_uri_t *uri) |
| Cleans up a URI object.
|
Typedef Documentation
Enumeration Type Documentation
- Enumerator:
GRU_URI_FORMAT_NONE |
|
GRU_URI_FORMAT_PORT |
Formats only scheme and host.
|
GRU_URI_FORMAT_PATH |
Formats only scheme, host and port if available.
|
GRU_URI_FORMAT_DEFAULT |
Formats scheme, host, port and path if available.
|
- Enumerator:
GRU_URI_PARSE_DEFAULT |
|
GRU_URI_PARSE_STRIP |
|
Function Documentation
gru_export void gru_uri_cleanup |
( |
gru_uri_t * |
uri |
) |
|
Cleans up a URI object.
- Parameters:
-
| uri | a pointer to a URI object to clean |
Clone a URI object.
- Parameters:
-
| other | the object to clone |
| status | status 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
A more elaborate URI string converter that can filter parts of the URI.
- Parameters:
-
| uri | a pointer to an URI object |
| fopt | formatting options (see gru_uri_format_opt_t) |
| status | status object |
- Returns:
- a new URI string that must be free'd after use
Default URI parser.
- Parameters:
-
| uri | URI string (ie.: scheme://host:port/path) |
| status | status object |
- Returns:
- A parsed URI object with each component of the URI broken down
URI parser with additional options.
- Parameters:
-
| uri | URI string (ie.: scheme://host:port/path) |
| parseopt | parse options (see gru_uri_format_opt_t) |
| status | status object |
- Returns:
- A parsed URI object with each component of the URI broken down
gru_export bool gru_uri_set_path |
( |
gru_uri_t * |
uri, |
|
|
const char * |
path | |
|
) |
| | |
Sets the URI path.
- Parameters:
-
| uri | a pointer to an URI object |
| path | the path |
- Returns:
- true if success or false otherwise
gru_export bool gru_uri_set_scheme |
( |
gru_uri_t * |
uri, |
|
|
const char * |
scheme | |
|
) |
| | |
Sets the scheme in a URI object.
- Parameters:
-
| uri | a pointer to an URI object |
| scheme | the scheme to set it to |
- Returns:
- true if success or false otherwise
gru_export char* gru_uri_simple_format |
( |
const gru_uri_t *gru_restrict |
uri, |
|
|
gru_status_t *gru_restrict |
status | |
|
) |
| | |
Converts a URI object to a string.
- Parameters:
-
| uri | a pointer to an URI object |
| status | status object |
- Returns:
- a new URI string that must be free'd after use