php-internal-docs 8.4.8
Unofficial docs for php/php-src
Loading...
Searching...
No Matches
document_type.c
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
9
10
13 size_t length);
14
15
18{
20
21 element = lexbor_mraw_calloc(document->mraw,
23 if (element == NULL) {
24 return NULL;
25 }
26
28
29 node->owner_document = lxb_dom_document_owner(document);
31
32 return element;
33}
34
37 const lxb_dom_document_type_t *dtype)
38{
42
44 if (new == NULL) {
45 return NULL;
46 }
47
48 status = lxb_dom_node_interface_copy(&new->node, &dtype->node, false);
49 if (status != LXB_STATUS_OK) {
51 }
52
53 if (document == dtype->node.owner_document) {
54 new->name = dtype->name;
55 }
56 else {
58 dtype->name);
59 if (data == NULL) {
61 }
62
65 data->entry.length);
66 if (data == NULL) {
68 }
69
70 new->name = (lxb_dom_attr_id_t) data;
71 }
72
73 if (lexbor_str_copy(&new->public_id,
74 &dtype->public_id, document->text) == NULL)
75 {
77 }
78
79 if (lexbor_str_copy(&new->system_id,
80 &dtype->system_id, document->text) == NULL)
81 {
83 }
84
85 return new;
86}
87
88
91{
93 lexbor_str_t public_id;
94 lexbor_str_t system_id;
95
96 text = lxb_dom_interface_node(document_type)->owner_document->text;
97 public_id = document_type->public_id;
98 system_id = document_type->system_id;
99
101
102 (void) lexbor_str_destroy(&public_id, text, false);
103 (void) lexbor_str_destroy(&system_id, text, false);
104
105 return NULL;
106}
107
108/*
109 * No inline functions for ABI.
110 */
111const lxb_char_t *
116
117const lxb_char_t *
123
124const lxb_char_t *
size_t len
Definition apprentice.c:174
uintptr_t lxb_dom_attr_id_t
Definition attr_const.h:18
@ LXB_STATUS_OK
Definition base.h:49
#define LXB_API
Definition def.h:48
DNS_STATUS status
Definition dns_win32.c:49
lxb_dom_document_type_t * lxb_dom_document_type_interface_create(lxb_dom_document_t *document)
lxb_dom_document_type_t * lxb_dom_document_type_interface_clone(lxb_dom_document_t *document, const lxb_dom_document_type_t *dtype)
lxb_dom_document_type_t * lxb_dom_document_type_interface_destroy(lxb_dom_document_type_t *document_type)
const lxb_char_t * lxb_dom_document_type_system_id_noi(lxb_dom_document_type_t *doc_type, size_t *len)
LXB_API lxb_dom_attr_data_t * lxb_dom_attr_qualified_name_append(lexbor_hash_t *hash, const lxb_char_t *name, size_t length)
Definition attr.c:385
const lxb_char_t * lxb_dom_document_type_public_id_noi(lxb_dom_document_type_t *doc_type, size_t *len)
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_system_id(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_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
#define lxb_dom_interface_node(obj)
Definition interface.h:31
struct lxb_dom_node lxb_dom_node_t
Definition interface.h:38
lxb_inline lxb_dom_document_t * lxb_dom_document_owner(lxb_dom_document_t *document)
Definition document.h:198
@ LXB_DOM_NODE_TYPE_DOCUMENT_TYPE
Definition node.h:34
#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
struct lexbor_hash lexbor_hash_t
Definition hash.h:41
hash(string $algo, string $data, bool $binary=false, array $options=[])
Definition hash.stub.php:12
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
lxb_status_t lxb_dom_node_interface_copy(lxb_dom_node_t *dst, const lxb_dom_node_t *src, bool is_attr)
Definition node.c:136
lxb_dom_node_t * lxb_dom_node_interface_destroy(lxb_dom_node_t *node)
Definition node.c:124
void * lexbor_mraw_calloc(lexbor_mraw_t *mraw, size_t size)
Definition mraw.c:227
unsigned const char * text
Definition php_ffi.h:53
zend_constant * data
lxb_char_t * lexbor_str_copy(lexbor_str_t *dest, const lexbor_str_t *target, lexbor_mraw_t *mraw)
Definition str.c:247
lexbor_str_t * lexbor_str_destroy(lexbor_str_t *str, lexbor_mraw_t *mraw, bool destroy_obj)
Definition str.c:76
lxb_dom_node_t node
lxb_dom_attr_id_t name
lexbor_mraw_t * mraw
Definition document.h:53
lexbor_mraw_t * text
Definition document.h:54
lexbor_hash_t * attrs
Definition document.h:56
lxb_dom_document_t * owner_document
Definition node.h:50
lxb_dom_node_type_t type
Definition node.h:59
unsigned int lxb_status_t
Definition types.h:28
unsigned char lxb_char_t
Definition types.h:27
ZEND_API void(ZEND_FASTCALL *zend_touch_vm_stack_data)(void *vm_stack_data)
zend_string * name