NetSurf
|
Atari file handling callbacks. More...
#include <stdarg.h>
#include <string.h>
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include "utils/utils.h"
#include "utils/corestrings.h"
#include "utils/url.h"
#include "utils/nsurl.h"
#include "utils/file.h"
Go to the source code of this file.
Functions | |
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. More... | |
static nserror | atari_basename (const char *path, char **str, size_t *size) |
Get the basename of a file using GEMDOS path handling. More... | |
static nserror | atari_nsurl_to_path (struct nsurl *url, char **path_out) |
Create a path from a nsurl using GEMDOS file handling. More... | |
static nserror | atari_path_to_nsurl (const char *path, struct nsurl **url_out) |
Create a nsurl from a path using GEMDOS file handling. More... | |
static nserror | atari_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 * | atari_file_table = &file_table |
Atari file handling callbacks.
Most of this code was taken from windows/gui.c
Definition in file file.c.
|
static |
Get the basename of a file using GEMDOS 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 75 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 229 of file file.c.
References NSERROR_NOT_DIRECTORY, NSERROR_NOT_FOUND, NSERROR_OK, and nsmkdir.
|
static |
Generate a GEMDOS 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 56 of file file.c.
References vsnstrjoin().
Create a path from a nsurl using GEMDOS 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 112 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 GEMDOS 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 183 of file file.c.
References FILE_SCHEME_PREFIX, FILE_SCHEME_PREFIX_LEN, NSERROR_BAD_PARAMETER, NSERROR_NOMEM, NSERROR_OK, nsurl_create(), path(), and url_escape().
struct gui_file_table* atari_file_table = &file_table |
|
static |