/* * This file is part of LibNSLayout * Licensed under the ISC License, http://opensource.org/licenses/ISC * Copyright 2015 Michael Drake */ /** \file src/util/dom-str.c * Layout object handling */ #include #include #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; }