55 if (
uri->mountpoint + 1 ==
uri->filename ||
56 uri->mountpoint ==
uri->filename )
59 return uri->mountpoint;
65 if (
uri->mountpoint + 1 ==
uri->filename ||
66 uri->mountpoint ==
uri->filename )
70 uri->filename[-1] =
'/';
71 uri->filename = sep + 1;
91 if ( *symlink ==
'/' )
98 strlen (
uri->mountpoint );
99 if ( ! ( new_path =
malloc (
len *
sizeof (
char ) ) ) )
107 if ( ! ( new_path =
malloc (
len *
sizeof (
char ) ) ) )
111 strcpy ( new_path, symlink );
128 for ( sep =
uri->lookup_pos ; *sep !=
'\0' && *sep !=
'/'; sep++ )
132 uri->lookup_pos = sep;
133 if ( *sep !=
'\0' ) {
136 if ( *
start ==
'\0' )
void nfs_uri_free(struct nfs_uri *uri)
#define EINVAL
Invalid argument.
char * strrchr(const char *src, int character)
Find rightmost character within a string.
char * dirname(char *path)
Return directory name from path.
#define ENOENT
No such file or directory.
int strncmp(const char *first, const char *second, size_t max)
Compare strings.
uint32_t start
Starting offset.
#define ENOMEM
Not enough space.
const char * path
Path (after URI decoding)
char * strcpy(char *dest, const char *src)
Copy string.
char * basename(char *path)
Return base name from path.
static void(* free)(struct refcnt *refcnt))
int nfs_uri_init(struct nfs_uri *nfs_uri, const struct uri *uri)
char * strchr(const char *src, int character)
Find character within a string.
char * strdup(const char *src)
Duplicate string.
size_t strlen(const char *src)
Get length of string.
char * nfs_uri_mountpoint(const struct nfs_uri *uri)
void * malloc(size_t size)
Allocate memory.
Network File System protocol URI handling functions.
A Uniform Resource Identifier.
int nfs_uri_symlink(struct nfs_uri *uri, const char *symlink)
int nfs_uri_next_mountpoint(struct nfs_uri *uri)
#define NULL
NULL pointer (VOID *)
char * nfs_uri_next_path_component(struct nfs_uri *uri)