NetSurf
Functions | Variables
fetch.c File Reference

Interfaces for fetch table. More...

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <limits.h>
#include "utils/nsurl.h"
#include "utils/log.h"
#include "utils/filepath.h"
#include "utils/file.h"
#include "netsurf/fetch.h"
#include "framebuffer/findfile.h"
#include "framebuffer/fetch.h"
Include dependency graph for fetch.c:

Go to the source code of this file.

Functions

static nsurlget_resource_url (const char *path)
 Translate resource to full url. More...
 
static const char * fetch_filetype (const char *unix_path)
 filetype – determine the MIME type of a local file More...
 

Variables

static struct gui_fetch_table fetch_table
 
struct gui_fetch_tableframebuffer_fetch_table = &fetch_table
 

Detailed Description

Interfaces for fetch table.

Definition in file fetch.c.

Function Documentation

◆ fetch_filetype()

static const char * fetch_filetype ( const char *  unix_path)
static

filetype – determine the MIME type of a local file

Definition at line 65 of file fetch.c.

References NSLOG.

◆ get_resource_url()

static nsurl * get_resource_url ( const char *  path)
static

Translate resource to full url.

Transforms a resource: path into a full URL. The returned URL is used as the target for a redirect. The caller takes ownership of the returned nsurl including unrefing it when finished with it.

Parameters
pathThe path of the resource to locate.
Returns
A string containing the full URL of the target object or NULL if no suitable resource can be found.

Definition at line 49 of file fetch.c.

References filepath_sfind(), netsurf_path_to_nsurl(), path(), PATH_MAX, and respaths.

Here is the call graph for this function:

Variable Documentation

◆ fetch_table

struct gui_fetch_table fetch_table
static
Initial value:
= {
.filetype = fetch_filetype,
.get_resource_url = get_resource_url,
}
static nsurl * get_resource_url(const char *path)
Translate resource to full url.
Definition: fetch.c:49
static const char * fetch_filetype(const char *unix_path)
filetype – determine the MIME type of a local file
Definition: fetch.c:65

Definition at line 94 of file fetch.c.

◆ framebuffer_fetch_table

struct gui_fetch_table* framebuffer_fetch_table = &fetch_table

Definition at line 100 of file fetch.c.

Referenced by main().