84 leafname = strrchr(
path,
'\\');
91 fname = strdup(leafname);
98 *size = strlen(fname);
121 if ((url == NULL) || (path_out == NULL)) {
127 if (lwc_string_caseless_isequal(scheme, corestring_lwc_file,
128 &match) != lwc_error_ok)
132 lwc_string_unref(scheme);
133 if (match ==
false) {
138 if (urlpath == NULL) {
143 lwc_string_length(urlpath),
146 lwc_string_unref(urlpath);
152 if ((
path[2] ==
':') || (
path[2] ==
'|')) {
191 if ((
path == NULL) || (url_out == NULL) || (*
path == 0)) {
202 while (*escpaths ==
'/') {
208 urlstr = malloc(urllen);
209 if (urlstr == NULL) {
235 dname = strdup(fname);
237 sep = strrchr(dname,
'\\');
246 if (stat(dname, &sb) == 0) {
248 if (S_ISDIR(sb.st_mode)) {
257 while (*sep ==
'\\') {
260 while ((sep = strchr(sep,
'\\')) != NULL) {
262 if (stat(dname, &sb) != 0) {
263 if (
nsmkdir(dname, S_IRWXU) != 0) {
269 if (! S_ISDIR(sb.st_mode)) {
277 while (*sep ==
'\\') {
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 atari_path_to_nsurl(const char *path, struct nsurl **url_out)
Create a nsurl from a path using GEMDOS file handling.
static nserror atari_mkdir_all(const char *fname)
Ensure that all directory elements needed to store a filename exist.
static nserror atari_mkpath(char **str, size_t *size, size_t nelm, va_list ap)
Generate a GEMDOS path from one or more component elemnts.
static struct gui_file_table file_table
static nserror atari_basename(const char *path, char **str, size_t *size)
Get the basename of a file using GEMDOS path handling.
struct gui_file_table * atari_file_table
static nserror atari_nsurl_to_path(struct nsurl *url, char **path_out)
Create a path from a nsurl using GEMDOS file handling.
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_escape(const char *unescaped, bool sptoplus, const char *escexceptions, char **result)
Escape a string suitable for inclusion in an URL.
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.