blob: b959afe8be3a6d2167894de3a2de5a59d8f81362 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
|
/*
* This file is part of LibNSLayout
* Licensed under the ISC License, http://opensource.org/licenses/ISC
* Copyright 2015 Michael Drake <tlsa@netsurf-browser.org>
*/
/** \file src/util/dom-str.c
* Layout object handling
*/
#include <stdlib.h>
#include <stdio.h>
#include "util/dom-str.h"
#include "util/util.h"
dom_string *nsl_dom_str_node_inserted;
dom_string *nsl_dom_str_subtree_modified;
/* Exported function, documented in src/util/dom-str.h */
nslayout_error nsl_dom_str_init(void)
{
dom_exception exc;
exc = dom_string_create((const uint8_t *)"DOMNodeInserted",
SLEN("DOMNodeInserted"),
&nsl_dom_str_node_inserted);
if (exc != DOM_NO_ERR) {
/* TODO: free stuff, return value */
printf("Failed to create string!\n");
return NSLAYOUT_NO_MEM;
}
exc = dom_string_create((const uint8_t *)"DOMSubtreeModified",
SLEN("DOMSubtreeModified"),
&nsl_dom_str_subtree_modified);
if (exc != DOM_NO_ERR) {
/* TODO: free stuff, return value */
printf("Failed to create string!\n");
return NSLAYOUT_NO_MEM;
}
return NSLAYOUT_OK;
}
/* Exported function, documented in src/util/dom-str.h */
nslayout_error nsl_dom_str_fini(void)
{
dom_string_unref(nsl_dom_str_node_inserted);
dom_string_unref(nsl_dom_str_subtree_modified);
return NSLAYOUT_OK;
}
|