45 NSLOG(netsurf, INFO,
"unix path %s", unix_path);
46 l = strlen(unix_path);
47 if (2 < l && strcasecmp(unix_path + l - 3,
"css") == 0)
49 if (2 < l && strcasecmp(unix_path + l - 3,
"jpg") == 0)
51 if (3 < l && strcasecmp(unix_path + l - 4,
"jpeg") == 0)
53 if (2 < l && strcasecmp(unix_path + l - 3,
"gif") == 0)
55 if (2 < l && strcasecmp(unix_path + l - 3,
"png") == 0)
57 if (2 < l && strcasecmp(unix_path + l - 3,
"jng") == 0)
59 if (2 < l && strcasecmp(unix_path + l - 3,
"svg") == 0)
61 if (2 < l && strcasecmp(unix_path + l - 3,
"bmp") == 0)
62 return "image/x-ms-bmp";
91 const uint8_t **data_out,
99 reshandle = FindResource(NULL,
path,
"USER");
100 if (reshandle == NULL) {
104 data_len = SizeofResource(NULL, reshandle);
109 datahandle = LoadResource(NULL, reshandle);
110 if (datahandle == NULL) {
113 data = LockResource(datahandle);
119 *data_len_out = data_len;
Fetching of data from a URL (interface).
nserror
Enumeration of error codes.
@ NSERROR_NOT_FOUND
Requested item not found.
char * filepath_sfind(char **respathv, char *filepath, const char *filename)
Searches an array of resource paths for a file.
Utility routines to obtain paths to file resources.
const char * fetch_filetype(const char *unix_path)
filetype – determine the MIME type of a local file
static struct gui_fetch_table fetch_table
win32 fetch operation table
static nsurl * nsw32_get_resource_url(const char *path)
Translate resource to full win32 url.
nserror nsw32_get_resource_data(const char *path, const uint8_t **data_out, size_t *data_len_out)
Translate resource to win32 resource data.
struct gui_fetch_table * win32_fetch_table
win32 API fetch operation table
Interface to platform-specific fetcher operations.
#define NSLOG(catname, level, logmsg, args...)
struct nsurl nsurl
NetSurf URL object.
Interface to utility string handling.
function table for fetcher operations.
const char *(* filetype)(const char *unix_path)
Determine the MIME type of a local file.
nserror netsurf_path_to_nsurl(const char *path, struct nsurl **url)
Create a nsurl from a path.
Default operations table for files.
char ** G_resource_pathv
resource search path vector.
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.