php-internal-docs 8.4.8
Unofficial docs for php/php-src
Loading...
Searching...
No Matches
document_type.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2018-2021 Alexander Borisov
3 *
4 * Author: Alexander Borisov <borisov@lexbor.com>
5 */
6
7#ifndef LEXBOR_DOM_DOCUMENT_TYPE_H
8#define LEXBOR_DOM_DOCUMENT_TYPE_H
9
10#ifdef __cplusplus
11extern "C" {
12#endif
13
14#include "lexbor/core/str.h"
15
20
21
29
30
33
36 const lxb_dom_document_type_t *dtype);
37
40
41
42/*
43 * Inline functions
44 */
47{
49
50 static const lxb_char_t lxb_empty[] = "";
51
53 doc_type->name);
54 if (data == NULL || doc_type->name == LXB_DOM_ATTR__UNDEF) {
55 if (len != NULL) {
56 *len = 0;
57 }
58
59 return lxb_empty;
60 }
61
62 if (len != NULL) {
63 *len = data->entry.length;
64 }
65
66 return lexbor_hash_entry_str(&data->entry);
67}
68
71{
72 if (len != NULL) {
73 *len = doc_type->public_id.length;
74 }
75
76 return doc_type->public_id.data;
77}
78
81{
82 if (len != NULL) {
83 *len = doc_type->system_id.length;
84 }
85
86 return doc_type->system_id.data;
87}
88
89/*
90 * No inline functions for ABI.
91 */
92LXB_API const lxb_char_t *
94
95LXB_API const lxb_char_t *
97 size_t *len);
98
99LXB_API const lxb_char_t *
101 size_t *len);
102
103
104#ifdef __cplusplus
105} /* extern "C" */
106#endif
107
108#endif /* LEXBOR_DOM_DOCUMENT_TYPE_H */
size_t len
Definition apprentice.c:174
uintptr_t lxb_dom_attr_id_t
Definition attr_const.h:18
@ LXB_DOM_ATTR__UNDEF
Definition attr_const.h:21
#define LXB_API
Definition def.h:48
LXB_API lxb_dom_document_type_t * lxb_dom_document_type_interface_create(lxb_dom_document_t *document)
LXB_API const lxb_char_t * lxb_dom_document_type_public_id_noi(lxb_dom_document_type_t *doc_type, size_t *len)
lxb_inline const lxb_char_t * lxb_dom_document_type_system_id(lxb_dom_document_type_t *doc_type, size_t *len)
LXB_API lxb_dom_document_type_t * lxb_dom_document_type_interface_clone(lxb_dom_document_t *document, const lxb_dom_document_type_t *dtype)
LXB_API lxb_dom_document_type_t * lxb_dom_document_type_interface_destroy(lxb_dom_document_type_t *document_type)
LXB_API const lxb_char_t * lxb_dom_document_type_name_noi(lxb_dom_document_type_t *doc_type, size_t *len)
lxb_inline const lxb_char_t * lxb_dom_document_type_public_id(lxb_dom_document_type_t *doc_type, size_t *len)
LXB_API const lxb_char_t * lxb_dom_document_type_system_id_noi(lxb_dom_document_type_t *doc_type, size_t *len)
lxb_inline const lxb_char_t * lxb_dom_document_type_name(lxb_dom_document_type_t *doc_type, size_t *len)
struct lxb_dom_document lxb_dom_document_t
Definition interface.h:41
struct lxb_dom_document_type lxb_dom_document_type_t
Definition interface.h:42
struct lxb_dom_node lxb_dom_node_t
Definition interface.h:38
#define NULL
Definition gdcache.h:45
lxb_inline lxb_char_t * lexbor_hash_entry_str(const lexbor_hash_entry_t *entry)
Definition hash.h:161
const lxb_dom_attr_data_t * lxb_dom_attr_data_by_id(lexbor_hash_t *hash, lxb_dom_attr_id_t attr_id)
Definition attr.c:411
zend_constant * data
lxb_char_t * data
Definition str.h:47
size_t length
Definition str.h:48
lxb_dom_node_t node
lxb_dom_attr_id_t name
lexbor_hash_t * attrs
Definition document.h:56
lxb_dom_document_t * owner_document
Definition node.h:50
#define lxb_inline
Definition types.h:21
unsigned char lxb_char_t
Definition types.h:27