NetSurf
|
/brief function table for file and filename operations. More...
#include <file.h>
Data Fields | |
nserror(* | mkpath )(char **str, size_t *size, size_t nemb, va_list ap) |
Generate a path from one or more component elemnts. More... | |
nserror(* | basename )(const char *path, char **str, size_t *size) |
Get the basename of a file. More... | |
nserror(* | nsurl_to_path )(struct nsurl *url, char **path) |
Create a path from a nsurl. More... | |
nserror(* | path_to_nsurl )(const char *path, struct nsurl **url) |
Create a nsurl from a path. More... | |
nserror(* | mkdir_all )(const char *fname) |
Ensure that all directory elements needed to store a filename exist. More... | |
/brief function table for file and filename operations.
function table implementing an interface to file and filename functionality appropriate for the OS filesystem. All paths are in terms of the OS filesystem convention and must not require additional system specific changes.
Get the basename of a file.
This gets the last element of a path and returns it.
[in] | path | The path to extract the name from. |
[in,out] | str | Pointer to string pointer if this is NULL enough storage will be allocated for the path element. |
[in,out] | size | The size of the space available if str not NULL on input and set to the total output length on output. |
Definition at line 84 of file file.h.
Referenced by fetch_curl_postdata_convert(), and verify_file_register().
nserror(* gui_file_table::mkdir_all) (const char *fname) |
Ensure that all directory elements needed to store a filename exist.
[in] | fname | The filename to ensure the path to exists. |
Definition at line 116 of file file.h.
Referenced by netsurf_mkdir_all(), and verify_file_register().
nserror(* gui_file_table::mkpath) (char **str, size_t *size, size_t nemb, va_list ap) |
Generate a path from one or more component elemnts.
If a string is allocated it must be freed by the caller.
[in,out] | str | pointer to string pointer if this is NULL enough storage will be allocated for the complete path. |
[in,out] | size | The size of the space available if str not NULL on input and if not NULL set to the total output length on output. |
[in] | nemb | The number of elements. |
[in] | ap | The elements of the path as string pointers. |
Definition at line 68 of file file.h.
Referenced by netsurf_mkpath(), and verify_file_register().
Create a path from a nsurl.
[in] | url | The url to encode. |
[out] | path | A string containing the result path which must be freed by the caller. |
Definition at line 95 of file file.h.
Referenced by fetch_file_setup(), netsurf_nsurl_to_path(), and verify_file_register().
Create a nsurl from a path.
Perform the necessary operations on a path to generate a nsurl.
[in] | path | The path to convert. |
[out] | url | pointer to recive the nsurl, The returned url should be unreferenced by the caller. |
Definition at line 108 of file file.h.
Referenced by netsurf_path_to_nsurl(), process_dir_ent(), and verify_file_register().