86 leafname = strrchr(
path,
'\\');
93 fname = strdup(leafname);
100 *size = strlen(fname);
123 if ((url == NULL) || (path_out == NULL)) {
129 if (lwc_string_caseless_isequal(scheme, corestring_lwc_file,
130 &match) != lwc_error_ok)
134 lwc_string_unref(scheme);
135 if (match ==
false) {
140 if (urlpath == NULL) {
145 lwc_string_length(urlpath),
148 lwc_string_unref(urlpath);
154 if ((
path[2] ==
':') || (
path[2] ==
'|')) {
164 sidx = strrchr(
path,
'/');
165 while (sidx != NULL) {
167 sidx = strrchr(
path,
'/');
201 if ((
path == NULL) || (url_out == NULL) || (*
path == 0)) {
207 urlstr = malloc(urllen);
208 if (urlstr == NULL) {
220 sidx = strrchr(urlstr,
'\\');
221 while (sidx != NULL) {
223 sidx = strrchr(urlstr,
'\\');
245 dname = strdup(fname);
247 sep = strrchr(dname,
'\\');
256 if (stat(dname, &sb) == 0) {
258 if (S_ISDIR(sb.st_mode)) {
267 while (*sep ==
'\\') {
270 while ((sep = strchr(sep,
'\\')) != NULL) {
272 if (stat(dname, &sb) != 0) {
273 if (
nsmkdir(dname, S_IRWXU) != 0) {
279 if (! S_ISDIR(sb.st_mode)) {
287 while (*sep ==
'\\') {
Browser window creation and manipulation interface.
Useful interned string pointers (interface).
#define FILE_SCHEME_PREFIX_LEN
File url prefix length.
#define FILE_SCHEME_PREFIX
File url prefix.
nserror
Enumeration of error codes.
@ NSERROR_NOT_FOUND
Requested item not found.
@ NSERROR_BAD_PARAMETER
Bad Parameter.
@ NSERROR_NOT_DIRECTORY
Missing directory.
@ NSERROR_NOMEM
Memory exhaustion.
static nserror windows_nsurl_to_path(struct nsurl *url, char **path_out)
Create a path from a nsurl using windows file handling.
struct gui_file_table * win32_file_table
static nserror windows_basename(const char *path, char **str, size_t *size)
Get the basename of a file using windows path handling.
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.
static nserror windows_path_to_nsurl(const char *path, struct nsurl **url_out)
Create a nsurl from a path using windows file handling.
static struct gui_file_table file_table
static nserror windows_mkdir_all(const char *fname)
Ensure that all directory elements needed to store a filename exist.
Windows file operation table interface.
NetSurf URL handling (interface).
nserror nsurl_create(const char *const url_s, nsurl **url)
Create a NetSurf URL object from a URL string.
lwc_string * nsurl_get_component(const nsurl *url, nsurl_component part)
Get part of a URL as a lwc_string, from a NetSurf URL object.
struct nsurl nsurl
NetSurf URL object.
Interface to utility string handling.
nserror vsnstrjoin(char **str, size_t *size, char sep, size_t nelm, va_list ap)
Generate a string from one or more component elements separated with a single value.
/brief function table for file and filename operations.
nserror(* mkpath)(char **str, size_t *size, size_t nemb, va_list ap)
Generate a path from one or more component elemnts.
nserror url_unescape(const char *str, size_t length, size_t *length_out, char **result_out)
Convert an escaped string to plain.
Interface to URL parsing and joining operations.
Default operations table for files.
Interface to a number of general purpose functionality.
#define nsmkdir(dir, mode)
POSIX mkdir function.
static nserror path(const struct redraw_context *ctx, const plot_style_t *pstyle, const float *p, unsigned int n, const float transform[6])
Plots a path.