/* Generated by nsgenbind
 *
 * nsgenbind is published under the MIT Licence.
 * nsgenbind is similar to a compiler is a purely transformative tool which
 * explicitly makes no copyright claim on this generated output
 */

/* DukTape JavaScript bindings for NetSurf browser
 *
 * Copyright 2015 Vincent Sanders <vince@netsurf-browser.org>
 * This file is part of NetSurf, http://www.netsurf-browser.org/
 * Released under the terms of the MIT License,
 *        http://www.opensource.org/licenses/mit-license
 */

#include <dom/dom.h>

#include "utils/log.h"
#include "utils/nsurl.h"

#include "javascript/duktape/duktape.h"

struct browser_window;
struct html_content;
struct dom_node;
struct dom_element;
struct dom_document;
struct dom_html_element;
struct dom_node_character_data;
struct dom_node_text;
struct dom_node_list;
struct dom_node_comment;
struct dom_html_collection;
struct dom_html_br_element;


#ifndef dukky_binding_h
#define dukky_binding_h

#define _MAGIC(S) ("\xFF\xFFNETSURF_DUKTAPE_" S)
#define MAGIC(S) _MAGIC(#S)
#define PROTO_MAGIC MAGIC(PROTOTYPES)
#define PRIVATE_MAGIC MAGIC(PRIVATE)
#define INIT_MAGIC MAGIC(INIT)
#define NODE_MAGIC MAGIC(NODE_MAP)
#define _PROTO_NAME(K) _MAGIC("PROTOTYPE_" K)
#define PROTO_NAME(K) _PROTO_NAME(#K)
#define _PROP_NAME(K,V) _MAGIC(K "_PROPERTY_" V)
#define PROP_NAME(K,V) _PROP_NAME(#K,#V)

/* Constant strings */
extern const char *dukky_error_fmt_argument;
extern const char *dukky_error_fmt_bool_type;
extern const char *dukky_error_fmt_number_type;
extern const char *dukky_magic_string_private;
extern const char *dukky_magic_string_prototypes;

duk_bool_t dukky_instanceof(duk_context *ctx, duk_idx_t index, const char *klass);
duk_ret_t dukky_create_prototypes(duk_context *ctx);

#endif
