Functions | |
char * | c_basename (const char *path) |
char * | c_dirname (const char *path) |
int | c_parse_uri (const char *uri, char **scheme, char **user, char **passwd, char **host, unsigned int *port, char **path) |
int | c_tmpname (char *template) |
char* c_basename | ( | const char * | path | ) |
basename - parse filename component.
basename breaks a null-terminated pathname string into a filename component. c_basename() returns the component following the final '/'. Trailing '/' characters are not counted as part of the pathname.
path | The path to parse. |
char* c_dirname | ( | const char * | path | ) |
Parse directory component.
dirname breaks a null-terminated pathname string into a directory component. In the usual case, c_dirname() returns the string up to, but not including, the final '/'. Trailing '/' characters are not counted as part of the pathname. The caller must free the memory.
path | The path to parse. |
int c_parse_uri | ( | const char * | uri, | |
char ** | scheme, | |||
char ** | user, | |||
char ** | passwd, | |||
char ** | host, | |||
unsigned int * | port, | |||
char ** | path | |||
) |
parse a uri and split it into components.
parse_uri parses an uri in the format
[<scheme>:][//[<user>[:<password>]@]<host>[:<port>]]/[<path>]
into its compoments. If you only want a special component, pass NULL for all other components. All components will be allocated if they have been found.
uri | The uri to parse. | |
scheme | String for the scheme component | |
user | String for the username component | |
passwd | String for the password component | |
host | String for the password component | |
port | Integer for the port | |
path | String for the path component with a leading slash. |
int c_tmpname | ( | char * | template | ) |
Make a temporary filename.
template | Template to replace. The last six characters of template must be XXXXXX and these are replaced with a string that makes the filename more or less unique. Since it will be modified, template must not be a string constant, but should be declared as a character array. |