NetSurf
|
Windows file operation table implementation. More...
#include <stdbool.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <windows.h>
#include "utils/errors.h"
#include "utils/nsurl.h"
#include "utils/log.h"
#include "utils/utils.h"
#include "utils/corestrings.h"
#include "utils/url.h"
#include "utils/file.h"
#include "utils/string.h"
#include "netsurf/browser_window.h"
#include "windows/file.h"
Go to the source code of this file.
Functions | |
static nserror | windows_mkpath (char **str, size_t *size, size_t nelm, va_list ap) |
Generate a windows path from one or more component elemnts. More... | |
static nserror | windows_basename (const char *path, char **str, size_t *size) |
Get the basename of a file using windows path handling. More... | |
static nserror | windows_nsurl_to_path (struct nsurl *url, char **path_out) |
Create a path from a nsurl using windows file handling. More... | |
static nserror | windows_path_to_nsurl (const char *path, struct nsurl **url_out) |
Create a nsurl from a path using windows file handling. More... | |
static nserror | windows_mkdir_all (const char *fname) |
Ensure that all directory elements needed to store a filename exist. More... | |
Variables | |
static struct gui_file_table | file_table |
struct gui_file_table * | win32_file_table = &file_table |
Windows file operation table implementation.
Definition in file file.c.
|
static |
Get the basename of a file using windows path handling.
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 77 of file file.c.
References NSERROR_BAD_PARAMETER, NSERROR_NOMEM, NSERROR_OK, and path().
|
static |
Ensure that all directory elements needed to store a filename exist.
fname | The filename to ensure the path to exists. |
Definition at line 239 of file file.c.
References NSERROR_NOT_DIRECTORY, NSERROR_NOT_FOUND, NSERROR_OK, and nsmkdir.
|
static |
Generate a windows 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] | nelm | The number of elements. |
[in] | ap | The elements of the path as string pointers. |
Definition at line 57 of file file.c.
References vsnstrjoin().
Create a path from a nsurl using windows file handling.
[in] | url | The url to encode. |
[out] | path_out | A string containing the result path which should be freed by the caller. |
Definition at line 115 of file file.c.
References NSERROR_BAD_PARAMETER, NSERROR_OK, nsurl_get_component(), NSURL_PATH, NSURL_SCHEME, path(), and url_unescape().
Create a nsurl from a path using windows file handling.
Perform the necessary operations on a path to generate a nsurl.
[in] | path | The path to convert. |
[out] | url_out | pointer to recive the nsurl, The returned url should be unreferenced by the caller. |
Definition at line 194 of file file.c.
References FILE_SCHEME_PREFIX, FILE_SCHEME_PREFIX_LEN, NSERROR_BAD_PARAMETER, NSERROR_NOMEM, nsurl_create(), and path().
|
static |
struct gui_file_table* win32_file_table = &file_table |