NetSurf
Data Structures | Typedefs | Functions | Variables
content.c File Reference

javascript content implementation More...

#include <assert.h>
#include <string.h>
#include <stdbool.h>
#include <stdlib.h>
#include "utils/errors.h"
#include "utils/config.h"
#include "content/content_protected.h"
#include "content/content_factory.h"
#include "content/hlcache.h"
#include "utils/log.h"
#include "utils/messages.h"
#include "utils/utils.h"
#include "javascript/content.h"
Include dependency graph for content.c:

Go to the source code of this file.

Data Structures

struct  javascript_content
 

Typedefs

typedef struct javascript_content javascript_content
 

Functions

static nserror javascript_create (const content_handler *handler, lwc_string *imime_type, const struct http_parameter *params, llcache_handle *llcache, const char *fallback_charset, bool quirks, struct content **c)
 
static bool javascript_convert (struct content *c)
 
static nserror javascript_clone (const struct content *old, struct content **newc)
 
static void javascript_destroy (struct content *c)
 
static content_type javascript_content_type (void)
 
 CONTENT_FACTORY_REGISTER_TYPES (javascript, javascript_types, javascript_content_handler)
 

Variables

static const content_handler javascript_content_handler
 
static const char * javascript_types []
 

Detailed Description

javascript content implementation

Definition in file content.c.

Typedef Documentation

◆ javascript_content

Function Documentation

◆ CONTENT_FACTORY_REGISTER_TYPES()

CONTENT_FACTORY_REGISTER_TYPES ( javascript  ,
javascript_types  ,
javascript_content_handler   
)

◆ javascript_clone()

static nserror javascript_clone ( const struct content old,
struct content **  newc 
)
static

Definition at line 76 of file content.c.

References javascript_content::base, content__clone(), content_destroy(), NSERROR_NOMEM, and NSERROR_OK.

Here is the call graph for this function:

◆ javascript_content_type()

static content_type javascript_content_type ( void  )
static

Definition at line 100 of file content.c.

References CONTENT_JS.

◆ javascript_convert()

static bool javascript_convert ( struct content c)
static

Definition at line 67 of file content.c.

References content_set_done(), and content_set_ready().

Here is the call graph for this function:

◆ javascript_create()

static nserror javascript_create ( const content_handler handler,
lwc_string *  imime_type,
const struct http_parameter params,
llcache_handle llcache,
const char *  fallback_charset,
bool  quirks,
struct content **  c 
)
static

Definition at line 43 of file content.c.

References javascript_content::base, content__init(), content::fallback_charset, content::handler, llcache, NSERROR_NOMEM, NSERROR_OK, and content::quirks.

Here is the call graph for this function:

◆ javascript_destroy()

static void javascript_destroy ( struct content c)
static

Definition at line 96 of file content.c.

Variable Documentation

◆ javascript_content_handler

const content_handler javascript_content_handler
static
Initial value:
= {
.create = javascript_create,
.data_complete = javascript_convert,
.destroy = javascript_destroy,
.clone = javascript_clone,
.no_share = false,
}
static bool javascript_convert(struct content *c)
Definition: content.c:67
static content_type javascript_content_type(void)
Definition: content.c:100
static nserror javascript_create(const content_handler *handler, lwc_string *imime_type, const struct http_parameter *params, llcache_handle *llcache, const char *fallback_charset, bool quirks, struct content **c)
Definition: content.c:43
static nserror javascript_clone(const struct content *old, struct content **newc)
Definition: content.c:76
static void javascript_destroy(struct content *c)
Definition: content.c:96

Definition at line 106 of file content.c.

◆ javascript_types

const char* javascript_types[]
static
Initial value:
= {
"application/javascript",
"application/ecmascript",
"application/x-javascript",
"text/javascript",
"text/ecmascript",
}

Definition at line 115 of file content.c.